!
! ********************************************************************
! *                                                                  *
! *  Copyright 2001 Compaq Computer Corporation                      *
! *                                                                  *
! *  COMPAQ Registered in U.S. Patent and Trademark Office.          *
! *                                                                  *
! *  Confidential computer software. Valid license from Compaq or    *
! *  authorized sublicensor required for possession, use or copying. *
! *  Consistent with FAR 12.211 and 12.212, Commercial Computer      *
! *  Software, Computer Software Documentation, and Technical Data   *
! *  for Commercial Items are licensed to the U.S. Government under  *
! *  vendor's standard commercial license.                           *
! *                                                                  *
! ********************************************************************
!
module ole32
!dec$objcomment lib: "ole32.lib"

  ! class registration flags; passed to CoRegisterClassObject
  integer, parameter :: REGCLS_SINGLEUSE = 0        ! Class object only generates one instance
  integer, parameter :: REGCLS_MULTIPLEUSE = 1      ! Same class object generates multiple inst
  integer, parameter :: REGCLS_MULTI_SEPARATE = 2   ! Multiple use, but separate control over 
                                                    ! each
  integer, parameter :: REGCLS_SUSPENDED = 4        ! Register as suspended, will be activated
                                                    ! when app calls CoResumeClassObjects
  integer, parameter :: REGCLS_SURROGATE = 8        ! Must be used when a surrogate process is
                                                    ! registering a class object that will be
                                                    ! loaded in the surrogate

  INTERFACE

	FUNCTION CoRegisterClassObject( &
						rclsid,		& ! Class identifier (CLSID) to be registered
						pUnk,		& ! Pointer to the class object
						dwClsContext, & ! Context for running executable code
						flags,      & ! How to connect to the class object
						lpdwRegister) ! Pointer to the value returned
          USE DFWINTY
          integer(4) :: CoRegisterClassObject ! HRESULT
!DEC$ ATTRIBUTES DEFAULT :: CoRegisterClassObject
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS:'_CoRegisterClassObject@20' :: CoRegisterClassObject
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS:'CoRegisterClassObject' :: CoRegisterClassObject
!DEC$ ENDIF
          TYPE (GUID), INTENT(IN)			:: rclsid 
          !DEC$ ATTRIBUTES REFERENCE		:: rclsid
          integer(LPVOID), intent(in)       :: pUnk
          !DEC$ ATTRIBUTES VALUE            :: pUnk
          integer(DWORD), intent(in)        :: dwClsContext
          !DEC$ ATTRIBUTES VALUE            :: dwClsContext
          integer(DWORD), intent(in)        :: flags
          !DEC$ ATTRIBUTES VALUE            :: flags
          integer(DWORD), intent(out)       :: lpdwRegister
          !DEC$ ATTRIBUTES REFERENCE        :: lpdwRegister
	END FUNCTION CoRegisterClassObject

	FUNCTION CoRevokeClassObject( &
						dwRegister) ! Pointer to the value returned
          USE DFWINTY
          integer(4) :: CoRevokeClassObject ! HRESULT
!DEC$ ATTRIBUTES DEFAULT :: CoRevokeClassObject
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS:'_CoRevokeClassObject@4' :: CoRevokeClassObject
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS:'CoRevokeClassObject' :: CoRevokeClassObject
!DEC$ ENDIF
          integer(DWORD), intent(in)       :: dwRegister
          !DEC$ ATTRIBUTES VALUE           :: dwRegister
	END FUNCTION CoRevokeClassObject

	FUNCTION CoResumeClassObjects()
          USE DFWINTY
          integer(4) :: CoResumeClassObjects ! HRESULT
!DEC$ ATTRIBUTES DEFAULT :: CoResumeClassObjects
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS:'_CoResumeClassObjects@0' :: CoResumeClassObjects
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS:'CoResumeClassObjects' :: CoResumeClassObjects
!DEC$ ENDIF
	END FUNCTION CoResumeClassObjects

	FUNCTION CoAddRefServerProcess()
          USE DFWINTY
          integer(ULONG) :: CoAddRefServerProcess
!DEC$ ATTRIBUTES DEFAULT :: CoAddRefServerProcess
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS:'_CoAddRefServerProcess@0' :: CoAddRefServerProcess
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS:'CoAddRefServerProcess' :: CoAddRefServerProcess
!DEC$ ENDIF
	END FUNCTION CoAddRefServerProcess

	FUNCTION CoReleaseServerProcess()
          USE DFWINTY
          integer(ULONG) :: CoReleaseServerProcess
!DEC$ ATTRIBUTES DEFAULT :: CoReleaseServerProcess
!DEC$IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS:'_CoReleaseServerProcess@0' :: CoReleaseServerProcess
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS:'CoReleaseServerProcess' :: CoReleaseServerProcess
!DEC$ ENDIF
	END FUNCTION CoReleaseServerProcess

  end interface

end module

