[1] | 1 | ' objbase.sbp
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | #ifndef _INC_OBJBASE
|
---|
| 5 | #define _INC_OBJBASE
|
---|
| 6 |
|
---|
| 7 | Type CSPLATFORM 'wtypes.sbp
|
---|
| 8 | dwPlatformId As DWord
|
---|
| 9 | dwVersionHi As DWord
|
---|
| 10 | dwVersionLo As DWord
|
---|
| 11 | dwProcessorArch As DWord
|
---|
| 12 | End Type
|
---|
| 13 |
|
---|
| 14 | Type QUERYCONTEXT 'wtypes.sbp
|
---|
| 15 | dwContext As DWord
|
---|
| 16 | latform As CSPLATFORM
|
---|
| 17 | Locale As LCID
|
---|
| 18 | dwVersionHi As DWord
|
---|
| 19 | dwVersionLo As DWord
|
---|
| 20 | End Type
|
---|
| 21 |
|
---|
| 22 | TypeDef RPC_AUTH_IDENTITY_HANDLE = VoidPtr 'Declared in Rpcdce.sbp; include Rpc.sbp.
|
---|
| 23 | TypeDef RPC_AUTHZ_HANDLE = VoidPtr 'Declared in Rpcdce.sbp; include Rpc.sbp.
|
---|
| 24 |
|
---|
| 25 | TypeDef IID = GUID
|
---|
| 26 | TypeDef CLSID = GUID
|
---|
| 27 |
|
---|
| 28 | Sub LISet32(ByRef li As LARGE_INTEGER, v As Long)
|
---|
| 29 | With li
|
---|
| 30 | If v < 0 Then
|
---|
| 31 | .HighPart = -1
|
---|
| 32 | Else
|
---|
| 33 | .HighPart = 0
|
---|
| 34 | End If
|
---|
| 35 | .LowPart = v
|
---|
| 36 | End With
|
---|
| 37 | End Sub
|
---|
| 38 | Sub ULISet32(ByRef li As ULARGE_INTEGER, v As DWord)
|
---|
| 39 | With li
|
---|
| 40 | .HighPart = 0
|
---|
| 41 | .LowPart = v
|
---|
| 42 | End With
|
---|
| 43 | End Sub
|
---|
| 44 |
|
---|
| 45 | Const MARSHALINTERFACE_MIN = 500
|
---|
| 46 |
|
---|
| 47 | Const CWCSTORAGENAME = 32
|
---|
| 48 |
|
---|
| 49 | /* Storage instantiation modes */
|
---|
| 50 | Const STGM_DIRECT = &h00000000
|
---|
| 51 | Const STGM_TRANSACTED = &h00010000
|
---|
| 52 | Const STGM_SIMPLE = &h08000000
|
---|
| 53 |
|
---|
| 54 | Const STGM_READ = &h00000000
|
---|
| 55 | Const STGM_WRITE = &h00000001
|
---|
| 56 | Const STGM_READWRITE = &h00000002
|
---|
| 57 |
|
---|
| 58 | Const STGM_SHARE_DENY_NONE = &h00000040
|
---|
| 59 | Const STGM_SHARE_DENY_READ = &h00000030
|
---|
| 60 | Const STGM_SHARE_DENY_WRITE = &h00000020
|
---|
| 61 | Const STGM_SHARE_EXCLUSIVE = &h00000010
|
---|
| 62 |
|
---|
| 63 | Const STGM_PRIORITY = &h00040000
|
---|
| 64 | Const STGM_DELETEONRELEASE = &h04000000
|
---|
| 65 | '#if (WINVER >= 400)
|
---|
| 66 | Const STGM_NOSCRATCH = &h00100000
|
---|
| 67 | '#endif /* WINVER */
|
---|
| 68 |
|
---|
| 69 | Const STGM_CREATE = &h00001000
|
---|
| 70 | Const STGM_CONVERT = &h00020000
|
---|
| 71 | Const STGM_FAILIFTHERE = &h00000000
|
---|
| 72 |
|
---|
| 73 | Const STGM_NOSNAPSHOT = &h00200000
|
---|
| 74 | '#if (_WIN32_WINNT >= 0x0500)
|
---|
| 75 | Const STGM_DIRECT_SWMR = &h00400000
|
---|
| 76 | '#endif
|
---|
| 77 |
|
---|
| 78 | /* flags for internet asyncronous and layout docfile */
|
---|
| 79 | Const ASYNC_MODE_COMPATIBILITY = &h00000001
|
---|
| 80 | Const ASYNC_MODE_DEFAULT = &h00000000
|
---|
| 81 |
|
---|
| 82 | Const STGTY_REPEAT = &h00000100
|
---|
| 83 | Const STG_TOEND = &hFFFFFFFF
|
---|
| 84 |
|
---|
| 85 | Const STG_LAYOUT_SEQUENTIAL = &h00000000
|
---|
| 86 | Const STG_LAYOUT_INTERLEAVED = &h00000001
|
---|
| 87 |
|
---|
| 88 | Const STGFMT_STORAGE = 0
|
---|
| 89 | Const STGFMT_NATIVE = 1
|
---|
| 90 | Const STGFMT_FILE = 3
|
---|
| 91 | Const STGFMT_ANY = 4
|
---|
| 92 | Const STGFMT_DOCFILE = 5
|
---|
| 93 |
|
---|
| 94 | Const STGFMT_DOCUMENT = 0
|
---|
| 95 |
|
---|
| 96 | '/* here is where we pull in the MIDL generated headers for the interfaces */
|
---|
| 97 | 'typedef interface IRpcStubBuffer IRpcStubBuffer;
|
---|
| 98 | 'typedef interface IRpcChannelBuffer IRpcChannelBuffer;
|
---|
| 99 |
|
---|
| 100 | #include <unknwn.sbp>
|
---|
| 101 | #include <objidl.sbp>
|
---|
| 102 |
|
---|
| 103 | '-------------------
|
---|
| 104 | ' IStream Interface
|
---|
| 105 | '-------------------
|
---|
| 106 |
|
---|
| 107 | Type STATSTG
|
---|
| 108 | pwcsName As LPOLESTR
|
---|
| 109 | dwType As DWord
|
---|
| 110 | cbSize As ULARGE_INTEGER
|
---|
| 111 | ntime As FILETIME
|
---|
| 112 | ctime As FILETIME
|
---|
| 113 | atime As FILETIME
|
---|
| 114 | grfMode As DWord
|
---|
| 115 | grfLocksSupported As DWord
|
---|
| 116 | clsid As CLSID
|
---|
| 117 | grfStateBits As DWord
|
---|
| 118 | reserved As DWord
|
---|
| 119 | End Type
|
---|
| 120 |
|
---|
| 121 | Const CLSCTX_INPROC_SERVER = &H01
|
---|
| 122 | Const CLSCTX_INPROC_HANDLER = &H02
|
---|
| 123 | Const CLSCTX_LOCAL_SERVER = &H4
|
---|
| 124 | Const CLSCTX_INPROC_SERVER16 = &H8
|
---|
| 125 | Const CLSCTX_REMOTE_SERVER = &H10
|
---|
| 126 | Const CLSCTX_INPROC_HANDLER16 = &H20
|
---|
| 127 | Const CLSCTX_INPROC_SERVERX86 = &H40
|
---|
| 128 | Const CLSCTX_INPROC_HANDLERX86 = &H80
|
---|
| 129 | Const CLSCTX_ESERVER_HANDLER = &H100
|
---|
| 130 |
|
---|
| 131 | Const CLSCTX_INPROC = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER
|
---|
| 132 | Const CLSCTX_ALL = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER
|
---|
| 133 | Const CLSCTX_SERVER = CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER
|
---|
| 134 |
|
---|
| 135 | Const Enum REGCLS
|
---|
| 136 | REGCLS_SINGLEUSE = 0
|
---|
| 137 | REGCLS_MULTIPLEUSE = 1
|
---|
| 138 | REGCLS_MULTI_SEPARATE = 2
|
---|
| 139 | REGCLS_SUSPENDED = 4
|
---|
| 140 | REGCLS_SURROGATE = 8
|
---|
| 141 | End Enum
|
---|
| 142 |
|
---|
| 143 | Type COAUTHIDENTITY
|
---|
| 144 | User As *Word
|
---|
| 145 | UserLength As DWord
|
---|
| 146 | Domain As *Word
|
---|
| 147 | DomainLength As DWord
|
---|
| 148 | Password As *Word
|
---|
| 149 | PasswordLength As DWord
|
---|
| 150 | Flags As DWord
|
---|
| 151 | End Type
|
---|
| 152 | Type COAUTHINFO
|
---|
| 153 | dwAuthnSvc As DWord
|
---|
| 154 | dwAuthzSvc As DWord
|
---|
| 155 | pwszServerPrincName As PWSTR
|
---|
| 156 | dwAuthnLevel As DWord
|
---|
| 157 | dwImpersonationLevel As DWord
|
---|
| 158 | pAuthIdentityData As *COAUTHIDENTITY
|
---|
| 159 | dwCapabilities As DWord
|
---|
| 160 | End Type
|
---|
| 161 | Type COSERVERINFO
|
---|
| 162 | dwReserved1 As DWord
|
---|
| 163 | pwszName As PWSTR
|
---|
| 164 | pAuthInfo As *COAUTHINFO
|
---|
| 165 | dwReserved2 As DWord
|
---|
| 166 | End Type
|
---|
| 167 | Declare Function CoInitialize Lib "ole32" (pvReserved As VoidPtr) As HRESULT
|
---|
| 168 | Declare Sub CoUninitialize Lib "ole32" ()
|
---|
| 169 | 'Declare Sub CoGetMalloc Lib "ole32" (dwMemContext As DWord, ByRef pMalloc As *IMalloc) As HRESULT
|
---|
| 170 | Declare Function CoGetCurrentProcess Lib "ole32" () As DWord
|
---|
| 171 | 'Declare Function CoRegisterMallocSpy Lib "ole32" (pMallocSpy As *IMallocSpy) As HRESULT
|
---|
| 172 | Declare Function CoRevokeMallocSpy Lib "ole32" () As HRESULT
|
---|
| 173 | 'Declare Function CoCreateStandardMalloc Lib "ole32" (memctx As DWord, ByRef pMalloc As *IMalloc) As HRESULT
|
---|
| 174 |
|
---|
| 175 |
|
---|
| 176 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM)
|
---|
| 177 | #ifdef _WIN32_DCOM
|
---|
| 178 | Const Enum COINIT
|
---|
| 179 | COINIT_MULTITHREADED = = &h0
|
---|
| 180 | COINIT_APARTMENTTHREADED = = &h2
|
---|
| 181 | COINIT_DISABLE_OLE1DDE = = &h4
|
---|
| 182 | COINIT_SPEED_OVER_MEMORY = = &h8
|
---|
| 183 | End Enum
|
---|
| 184 | Declare Function CoInitializeEx Lib "ole32" (pvReserved As VoidPtr, dwCoInit As DWord) As HRESULT
|
---|
| 185 | Declare Function CoGetCallerTID Lib "ole32" (ByRef dwTID AS DWord) As HRESULT
|
---|
| 186 | #endif
|
---|
| 187 |
|
---|
| 188 | #ifdef __UNDECLARED__
|
---|
| 189 | '#if (_WIN32_WINNT >= 0x0501)
|
---|
| 190 | ' 注意:このcokkieは本来ULARGE_INTEGER型
|
---|
| 191 | 'Declare Function CoRegisterInitializeSpy Lib "ole32" (pSpy As *IInitializeSpy, ByRef uliCokkie As QWord) As HRESULT
|
---|
| 192 | Declare Function CoRevokeInitializeSpy Lib "ole32" (uliCookie As QWord) As HRESULT
|
---|
| 193 |
|
---|
| 194 | Declare Function CoGetContextToken Lib "ole32" (ByRef token As ULONG_PTR) As HRESULT
|
---|
| 195 |
|
---|
| 196 | Const Enum COMSD
|
---|
| 197 | SD_LAUNCHPERMISSIONS = 0
|
---|
| 198 | SD_ACCESSPERMISSIONS = 1
|
---|
| 199 | SD_LAUNCHRESTRICTIONS = 2
|
---|
| 200 | SD_ACCESSRESTRICTIONS = 3
|
---|
| 201 | End Enum
|
---|
| 202 | 'Declare Function CoGetSystemSecurityPermissions(comSDType As COMSD, ByRef ppSD As *SECURITY_DESCRIPTOR) As HRESULT
|
---|
| 203 | #endif
|
---|
| 204 |
|
---|
| 205 | '#if DBG == 1
|
---|
| 206 | 'Declare Function DebugCoGetRpcFault Lib "" () As DWord
|
---|
| 207 | 'Declare Sub DebugCoSetRpcFault Lib "" (ul As DWord)
|
---|
| 208 | '#endif
|
---|
| 209 |
|
---|
| 210 | Dim GUID_NULL = [0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0]] As GUID
|
---|
| 211 |
|
---|
| 212 | Function IsEqualGUID(ByRef rguid1 As GUID, ByRef rguid2 As GUID) As BOOL
|
---|
| 213 | IsEqualGUID = Not memcmp(VarPtr(rguid1),VarPtr(rguid2),SizeOf(GUID))
|
---|
| 214 | End Function
|
---|
| 215 | Function IsEqualIID(ByRef riid1 As GUID, ByRef riid2 As GUID) As BOOL
|
---|
| 216 | IsEqualIID=IsEqualGUID(riid1,riid2)
|
---|
| 217 | End Function
|
---|
| 218 | Function IsEqualCLSID(ByRef rclsid1 As CLSID, ByRef rclsid2 As CLSID) As BOOL
|
---|
| 219 | IsEqualCLSID=IsEqualGUID(rclsid1,rclsid2)
|
---|
| 220 | End Function
|
---|
| 221 |
|
---|
| 222 | '#if (_WIN32_WINNT >= 0x0500)
|
---|
| 223 |
|
---|
| 224 | Type SOleTlsDataPublic
|
---|
| 225 | pvReserved0[ELM(2)] As VoidPtr
|
---|
| 226 | dwReserved0[ELM(3)] As DWord
|
---|
| 227 | pvReserved1[ELM(1)] As VoidPtr
|
---|
| 228 | dwReserved1[ELM(3)] As DWord
|
---|
| 229 | pvReserved2[ELM(4)] As VoidPtr
|
---|
| 230 | dwReserved2[ELM(1)] As DWord
|
---|
| 231 | pCurrentCtx As VoidPtr
|
---|
| 232 | End Type
|
---|
| 233 |
|
---|
| 234 | '#endif
|
---|
| 235 |
|
---|
| 236 | /* COM+ APIs */
|
---|
| 237 |
|
---|
| 238 | Declare Function CoGetObjectContext Lib "ole32" (ByRef riid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 239 |
|
---|
| 240 | /* register/revoke/get class objects */
|
---|
| 241 |
|
---|
| 242 | Declare Function CoGetClassObject Lib "ole32" (ByRef rclsid As CLSID, dwClsContext As DWord, pServerInfo As *COSERVERINFO, ByRef refiid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 243 | Declare Function CoRegisterClassObject Lib "ole32" (ByRef rclsid As CLSID, pUnk As *IUnknown, dwClsContext As DWord, flags As DWord, ByRef dwRegister As DWord) As HRESULT
|
---|
| 244 | Declare Function CoRevokeClassObject Lib "ole32" (dwRegister As DWord) As HRESULT
|
---|
| 245 | Declare Function CoResumeClassObjects Lib "ole32" () As HRESULT
|
---|
| 246 | Declare Function CoSuspendClassObjects Lib "ole32" () As HRESULT
|
---|
| 247 | Declare Function CoAddRefServerProcess Lib "ole32" () As DWord
|
---|
| 248 | Declare Function CoReleaseServerProcess Lib "ole32" () As DWord
|
---|
| 249 | Declare Function CoGetPSClsid Lib "ole32" (ByRef riid As IID, ByRef rclsid As CLSID) As HRESULT
|
---|
| 250 | Declare Function CoRegisterPSClsid Lib "ole32" (ByRef riid As IID, ByRef rclsid As CLSID) As HRESULT
|
---|
| 251 |
|
---|
| 252 | /* Registering surrogate processes */
|
---|
| 253 | 'Declare Function CoRegisterSurrogate Lib "ole32" (pSurrogate As *ISurrogate) As HRESULT
|
---|
| 254 |
|
---|
| 255 | /* marshaling interface pointers */
|
---|
| 256 |
|
---|
| 257 | Declare Function CoGetMarshalSizeMax Lib "ole32" (ByRef ulSize As DWord, ByRef riid As IID, pUnk As *IUnknown, dwDestContext As DWord, pvDestContext As VoidPtr, mshlflags As DWord) As HRESULT
|
---|
| 258 | Declare Function CoMarshalInterface Lib "ole32" (pStm As *IStream, ByRef riid As IID, pUnk As *IUnknown, dwDestContext As DWord, pvDestContext As VoidPtr, mshlflags As DWord) As HRESULT
|
---|
| 259 | Declare Function CoUnmarshalInterface Lib "ole32" (pstm As *IStream, ByRef riid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 260 | Declare Function CoMarshalHresult Lib "ole32" (pstm As *IStream, hresult As HRESULT) As HRESULT
|
---|
| 261 | Declare Function CoUnmarshalHresult Lib "ole32" (pstm As *IStream, ByRef phresult As HRESULT) As HRESULT
|
---|
| 262 | Declare Function CoReleaseMarshalData Lib "ole32" (pstm As *IStream) As HRESULT
|
---|
| 263 | Declare Function CoDisconnectObject Lib "ole32" (pUnk As *IUnknown, dwReserved As DWord) As HRESULT
|
---|
| 264 | Declare Function CoLockObjectExternal Lib "ole32" (pUnk As *IUnknown, fLock As BOOL, fLastUnlockReleases As BOOL) As HRESULT
|
---|
| 265 | 'Declare Function CoGetStandardMarshal Lib "ole32" (ByRef riid As IID, pUnk As *IUnknown, dwDestContext As DWord, pvDestContext As VoidPtr, mshlflags As DWord, ByRef pMarshal As *IMarshal) As HRESULT
|
---|
| 266 |
|
---|
| 267 | Declare Function CoGetStdMarshalEx Lib "ole32" (pUnkOuter As *IUnknown, smexflags As DWord, ByRef pUnkInner As *IUnknown) As HRESULT
|
---|
| 268 |
|
---|
| 269 | /* flags for CoGetStdMarshalEx */
|
---|
| 270 | Const Enum STDMSHLFLAGS
|
---|
| 271 | SMEXF_SERVER = &h01
|
---|
| 272 | SMEXF_HANDLER = &h02
|
---|
| 273 | End Enum
|
---|
| 274 |
|
---|
| 275 | Declare Function CoIsHandlerConnected Lib "ole32" (pUnk As *IUnknown) As BOOL
|
---|
| 276 |
|
---|
| 277 | /* Apartment model inter-thread interface passing helpers */
|
---|
| 278 | Declare Function CoMarshalInterThreadInterfaceInStream Lib "ole32" (ByRef riid As IID, pUnk As *IUnknown, ByRef pStm As *IStream) As HRESULT
|
---|
| 279 |
|
---|
| 280 | Declare Function CoGetInterfaceAndReleaseStream Lib "ole32" (pStm As *IStream, ByRef riid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 281 | Declare Function CoCreateFreeThreadedMarshaler Lib "ole32" (punkOuter As *IUnknown, ByRef punkMarshal As *IUnknown) As HRESULT
|
---|
| 282 |
|
---|
| 283 | /* dll loading helpers; keeps track of ref counts and unloads all on exit */
|
---|
| 284 |
|
---|
| 285 | Declare Function CoLoadLibrary Lib "ole32" (lpszLibName As LPOLESTR, bAutoFree As BOOL) As HINSTANCE
|
---|
| 286 | Declare Sub CoFreeLibrary Lib "ole32" (hInst As HINSTANCE)
|
---|
| 287 | Declare Sub CoFreeAllLibraries Lib "ole32" ()
|
---|
| 288 | Declare Sub CoFreeUnusedLibraries Lib "ole32" ()
|
---|
| 289 | '#if (_WIN32_WINNT >= 0x0501)
|
---|
| 290 | Declare Sub CoFreeUnusedLibrariesEx Lib "ole32" (dwUnloadDelay As DWord, dwReserved As DWord)
|
---|
| 291 | '#endif
|
---|
| 292 |
|
---|
| 293 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM
|
---|
| 294 | #ifdef _WIN32_DCOM
|
---|
| 295 |
|
---|
| 296 | /* Call Security. */
|
---|
| 297 |
|
---|
| 298 | Declare Function CoInitializeSecurity Lib "ole32" (
|
---|
| 299 | ByVal pSecDesc As *SECURITY_DESCRIPTOR,
|
---|
| 300 | ByVal cAuthSvc As *SOLE_AUTHENTICATION_SERVICE,
|
---|
| 301 | ByVal pReserved1 As VoidPtr,
|
---|
| 302 | ByVal dwAuthnLevel As DWord,
|
---|
| 303 | ByVal dwImpLevel As DWord,
|
---|
| 304 | ByVal pAuthList As VoidPtr,
|
---|
| 305 | ByVal dwCapabilities As DWord
|
---|
| 306 | ByVal pReserved3 As VoidPtr) As HRESULT
|
---|
| 307 | Declare Function CoGetCallContext Lib "ole32" (
|
---|
| 308 | ByRef riid As IID,
|
---|
| 309 | ByRef pInterface As Any) As HRESULT
|
---|
| 310 | Declare Function CoQueryProxyBlanket Lib "ole32" (
|
---|
| 311 | ByVal pProxy As *IUnknown,
|
---|
| 312 | ByRef AuthnSvc As DWord,
|
---|
| 313 | ByVal pAuthzSvc As *DWord,
|
---|
| 314 | ByVal pServerPrincName As **OLECHAR,
|
---|
| 315 | ByVal pAuthnLevel As *DWord,
|
---|
| 316 | ByVal pImpLevel As *DWord,
|
---|
| 317 | ByVal pAuthInfo As *RPC_AUTH_IDENTITY_HANDLE
|
---|
| 318 | ByVal pCapabilites As *DWord) As HRESULT
|
---|
| 319 | Declare Function CoSetProxyBlanket Lib "ole32" (
|
---|
| 320 | ByVal pProxy As *IUnknown,
|
---|
| 321 | ByVal dwAuthnSvc As DWord,
|
---|
| 322 | ByVal dwAuthzSvc As DWord,
|
---|
| 323 | ByVal pServerPrincName As *OLECHAR,
|
---|
| 324 | ByVal dwAuthnLevel As DWord,
|
---|
| 325 | ByVal dwImpLevel As DWord,
|
---|
| 326 | ByVal pAuthInfo As RPC_AUTH_IDENTITY_HANDLE,
|
---|
| 327 | ByVal dwCapabilities As DWord) As HRESULT
|
---|
| 328 | Declare Function CoCopyProxy Lib "ole32" (
|
---|
| 329 | ByVal pProxySrc As *IUnknown,
|
---|
| 330 | ByRef pProxyDst As *IUnknown) As HRESULT
|
---|
| 331 | Declare Function CoQueryClientBlanket Lib "ole32" (
|
---|
| 332 | ByVal pAuthnSvc As *DWord,
|
---|
| 333 | ByVal pAuthzSvc As *DWord,
|
---|
| 334 | ByVal pServerPrincName As **OLECHAR,
|
---|
| 335 | ByVal pAuthnLevel As *DWord,
|
---|
| 336 | ByVal pImpLevel As *DWord,
|
---|
| 337 | ByVal pPrivs As *RPC_AUTHZ_HANDLE
|
---|
| 338 | ByVal pCapabilities As *DWord) As HRESULT
|
---|
| 339 | Declare Function CoImpersonateClient Lib "ole32" () As HRESULT
|
---|
| 340 | Declare Function CoRevertToSelf Lib "ole32" () As HRESULT
|
---|
| 341 | /*
|
---|
| 342 | Declare Function CoRevertToSelf Lib "ole32" (
|
---|
| 343 | ByRef cAuthSvc As DWord,
|
---|
| 344 | ByRef asAuthSvc As *SOLE_AUTHENTICATION_SERVICE) As HRESULT
|
---|
| 345 | */
|
---|
| 346 | Declare Function CoSwitchCallContext Lib "ole32" (
|
---|
| 347 | ByVal pNewObject As *IUnknown,
|
---|
| 348 | ByRef ppOldObject As *IUnknown) As HRESULT
|
---|
| 349 |
|
---|
| 350 | Const COM_RIGHTS_EXECUTE = 1
|
---|
| 351 | Const COM_RIGHTS_EXECUTE_LOCAL = 2
|
---|
| 352 | Const COM_RIGHTS_EXECUTE_REMOTE = 4
|
---|
| 353 | Const COM_RIGHTS_ACTIVATE_LOCAL = 8
|
---|
| 354 | Const COM_RIGHTS_ACTIVATE_REMOTE = 16
|
---|
| 355 |
|
---|
| 356 | #endif ' DCOM
|
---|
| 357 |
|
---|
| 358 | Declare Function CoCreateInstance Lib "ole32" (ByRef clsid As CLSID, pUnknown As *IUnknown, dwClsContext As DWord, ByRef refiid As IID, ByRef pObj As Any) As HRESULT
|
---|
| 359 |
|
---|
| 360 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM
|
---|
| 361 | #ifdef _WIN32_DCOM
|
---|
| 362 | /* objidl.hでのMULTI_QIの宣言が必要。
|
---|
| 363 | Declare Function CoGetInstanceFromFile Lib "ole32" (
|
---|
| 364 | ByVal pServerInfo As *COSERVERINFO,
|
---|
| 365 | ByRef clsid As CLSID,
|
---|
| 366 | ByVal punkOuter As *IUnknown,
|
---|
| 367 | ByVal dwClsCtx As DWord,
|
---|
| 368 | ByVal grfMode As DWord,
|
---|
| 369 | ByVal pwszName As *OLECHAR
|
---|
| 370 | ByVal dwCount As DWord,
|
---|
| 371 | ByVal pResults As *MULTI_QI) As HRESULT
|
---|
| 372 |
|
---|
| 373 | Declare Function CoGetInstanceFromIStorage Lib "ole32" (
|
---|
| 374 | ByVal pServerInfo As *COSERVERINFO,
|
---|
| 375 | ByRef clsid As CLSID,
|
---|
| 376 | ByVal punkOuter As *IUnknown,
|
---|
| 377 | ByVal dwClsCtx As DWord,
|
---|
| 378 | ByVal grfMode As DWord,
|
---|
| 379 | ByVal pstg As *IStorage
|
---|
| 380 | ByVal dwCount As DWord,
|
---|
| 381 | ByVal pResults As *MULTI_QI) As HRESULT
|
---|
| 382 |
|
---|
| 383 | Declare Function CoCreateInstanceEx Lib "ole32" (
|
---|
| 384 | ByRef clsid As CLSID,
|
---|
| 385 | ByVal punkOuter As *IUnknown,
|
---|
| 386 | ByVal dwClsCtx As DWord,
|
---|
| 387 | ByVal pServerInfo As *COSERVERINFO,
|
---|
| 388 | ByVal dwCount As DWord,
|
---|
| 389 | ByVal pResults As *MULTI_QI) As HRESULT
|
---|
| 390 | */
|
---|
| 391 | #endif ' DCOM
|
---|
| 392 |
|
---|
| 393 | /* Call related APIs */
|
---|
| 394 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM
|
---|
| 395 | #ifdef _WIN32_DCOM
|
---|
| 396 |
|
---|
| 397 | Declare Function CoGetCancelObject Lib "ole32" (dwThreadId As DWord, ByRef iid As IID, ByRef pUnk As Any) As HRESULT
|
---|
| 398 | Declare Function CoSetCancelObject Lib "ole32" (pUnk As *IUnknown) As HRESULT
|
---|
| 399 | Declare Function CoCancelCall Lib "ole32" (dwThreadId As DWord, ulTimeout As DWord) As HRESULT
|
---|
| 400 | Declare Function CoTestCancel Lib "ole32" () As HRESULT
|
---|
| 401 | Declare Function CoEnableCallCancellation Lib "ole32" (pReserved As VoidPtr) As HRESULT
|
---|
| 402 | Declare Function CoDisableCallCancellation Lib "ole32" (pReserved As VoidPtr) As HRESULT
|
---|
| 403 | Declare Function CoAllowSetForegroundWindow Lib "ole32" (pUnk As *IUnknown, pvReserved As VoidPtr) As HRESULT
|
---|
| 404 | Declare Function DcomChannelSetHResult Lib "ole32" (pvReserved As HRESULT, pulReserved As DWord, appsHR As HRESULT) As HRESULT
|
---|
| 405 |
|
---|
| 406 | #endif
|
---|
| 407 |
|
---|
| 408 | /* other helpers */
|
---|
| 409 |
|
---|
| 410 | Declare Function StringFromCLSID Lib "ole32" (ByRef rclsid As CLSID, ByRef lpsz As LPOLESTR) As HRESULT
|
---|
| 411 | Declare Function CLSIDFromString Lib "ole32" (lpsz As LPOLESTR, ByRef clsid As CLSID) As HRESULT
|
---|
| 412 | Declare Function StringFromIID Lib "ole32" (ByRef iid As IID, ByRef lpsz As LPOLESTR) As HRESULT
|
---|
| 413 | Declare Function IIDFromString Lib "ole32" (lpsz As LPOLESTR, ByRef iid As IID) As HRESULT
|
---|
| 414 | Declare Function CoIsOle1Class Lib "ole32" (ByRef rclsid As CLSID) As BOOL
|
---|
| 415 | Declare Function ProgIDFromCLSID Lib "ole32" (ByRef clsid As CLSID, ByRef lpszProgID As LPOLESTR) As HRESULT
|
---|
| 416 | Declare Function CLSIDFromProgID Lib "ole32" (lpszProgID As LPCOLESTR, ByRef clsid As CLSID) As HRESULT
|
---|
| 417 | Declare Function CLSIDFromProgIDEx Lib "ole32" (lpszProgID As LPCOLESTR, ByRef clsid As CLSID) As HRESULT
|
---|
| 418 | Declare Function StringFromGUID2 Lib "ole32" (ByRef rguid As GUID, lpsz As LPOLESTR, cchMax As Long) As Long
|
---|
| 419 |
|
---|
| 420 | Declare Function CoCreateGuid Lib "ole32" (ByRef guid As GUID) As HRESULT
|
---|
| 421 |
|
---|
| 422 | Declare Function CoFileTimeToDosDateTime Lib "ole32" (ByRef FileTime As FILETIME, ByRef DosDate As Word, ByRef DosTime As Word) As BOOL
|
---|
| 423 | Declare Function CoDosDateTimeToFileTime Lib "ole32" (nDosDate As Word, nDosTime As Word, ByRef FileTime As FILETIME) As BOOL
|
---|
| 424 | Declare Function CoFileTimeNow Lib "ole32" (ByRef FileTime As FILETIME) As HRESULT
|
---|
| 425 |
|
---|
| 426 | Declare Function CoRegisterMessageFilter Lib "ole32" (pMessageFilter As *IMessageFilter, ByRef pMessageFilter As *IMessageFilter) As HRESULT
|
---|
| 427 |
|
---|
| 428 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM
|
---|
| 429 | #ifdef _WIN32_DCOM
|
---|
| 430 | Declare Function CoRegisterChannelHook Lib "ole32" (ByRef ExtensionUuid As GUID, pChannelHook As *IChannelHook) As HRESULT
|
---|
| 431 | #endif ' DCOM
|
---|
| 432 |
|
---|
| 433 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM
|
---|
| 434 | #ifdef _WIN32_DCOM
|
---|
| 435 |
|
---|
| 436 | Declare Function CoWaitForMultipleHandles Lib "ole32" (
|
---|
| 437 | ByVal dwFlags As DWord,
|
---|
| 438 | ByVal dwTimeout As DWord,
|
---|
| 439 | ByVal cHandles As DWord,
|
---|
| 440 | ByVal pHandles As *HANDLE,
|
---|
| 441 | ByRef dwindex As DWord) As HRESULT
|
---|
| 442 |
|
---|
| 443 | /* Flags for Synchronization API and Classes */
|
---|
| 444 |
|
---|
| 445 | Const Enum COWAIT_FLAGS
|
---|
| 446 | COWAIT_WAITALL = 1
|
---|
| 447 | COWAIT_ALERTABLE = 2
|
---|
| 448 | COWAIT_INPUTAVAILABLE = 4
|
---|
| 449 | End Enum
|
---|
| 450 |
|
---|
| 451 | #endif ' DCOM
|
---|
| 452 |
|
---|
| 453 | /* for flushing OLESCM remote binding handles */
|
---|
| 454 |
|
---|
| 455 | #ifdef __UNDECLARED__
|
---|
| 456 | '#if (_WIN32_WINNT >= 0x0501)
|
---|
| 457 | Declare Function CoInvalidateRemoteMachineBindings Lib "ole32" (pszMachineName As LPOLESTR) As HRESULT
|
---|
| 458 | #endif
|
---|
| 459 |
|
---|
| 460 | /* TreatAs APIS */
|
---|
| 461 |
|
---|
| 462 | Declare Function CoGetTreatAsClass Lib "ole32" (ByRef clsidOld As CLSID, ByRef ClsidNew As CLSID) As HRESULT
|
---|
| 463 | Declare Function CoTreatAsClass Lib "ole32" (ByRef clsidOld As CLSID, ByRef clsidNew As CLSID) As HRESULT
|
---|
| 464 |
|
---|
| 465 | /* the server dlls must define their DllGetClassObject and DllCanUnloadNow
|
---|
| 466 | * to match these; the typedefs are located here to ensure all are changed at
|
---|
| 467 | * the same time.
|
---|
| 468 | */
|
---|
| 469 |
|
---|
| 470 | TypeDef LPFNGETCLASSOBJECT = *Function(ByRef rclsid As CLSID, ByRef riid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 471 | TypeDef LPFNCANUNLOADNOW = *Function() As HRESULT
|
---|
| 472 |
|
---|
| 473 | /*
|
---|
| 474 | Declare Function DllGetClassObject(ByRef rclsid As CLSID, ByRef riid As IID, ByVal ppv As *VoidPtr) As HRESULT
|
---|
| 475 | Declare Function DllCanUnloadNow() As HRESULT
|
---|
| 476 | */
|
---|
| 477 |
|
---|
| 478 | /****** Default Memory Allocation ******************************************/
|
---|
| 479 | Declare Function CoTaskMemAlloc Lib "ole32" (cb As SIZE_T) As VoidPtr
|
---|
| 480 | Declare Function CoTaskMemRealloc Lib "ole32" (pv As VoidPtr, cb As SIZE_T) As VoidPtr
|
---|
| 481 | Declare Sub CoTaskMemFree Lib "ole32" (pv As VoidPtr)
|
---|
| 482 |
|
---|
| 483 | /****** DV APIs ***********************************************************/
|
---|
| 484 |
|
---|
| 485 | /* This function is declared in objbase.h and ole2.h */
|
---|
| 486 | Declare Function CreateDataAdviseHolder Lib "ole32" (ByRef pDAHolder As *IDataAdviseHolder) As HRESULT
|
---|
| 487 | Declare Function CreateDataCache Lib "ole32" (pUnkOuter As *IUnknown, ByRef rclsid As CLSID, ByRef riid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 488 |
|
---|
| 489 | /****** Storage API Prototypes ********************************************/
|
---|
| 490 |
|
---|
| 491 |
|
---|
| 492 | Declare Function StgCreateDocfile Lib "ole32" (
|
---|
| 493 | ByVal pwcsName As *OLECHAR,
|
---|
| 494 | ByVal grfMode As DWord,
|
---|
| 495 | ByVal reserved As DWord,
|
---|
| 496 | ByRef pstgOpen As *IStorage) As HRESULT
|
---|
| 497 |
|
---|
| 498 | Declare Function StgCreateDocfileOnILockBytes Lib "ole32" (
|
---|
| 499 | ByVal plkbyt As *ILockBytes,
|
---|
| 500 | ByVal grfMode As DWord,
|
---|
| 501 | ByVal reserved As DWord,
|
---|
| 502 | ByRef pstgOpen As *IStorage) As HRESULT
|
---|
| 503 |
|
---|
| 504 | Declare Function StgOpenStorage Lib "ole32" (
|
---|
| 505 | ByVal pwcsName As *OLECHAR,
|
---|
| 506 | ByVal pstgPriority As *IStorage,
|
---|
| 507 | ByVal grfMode As DWord,
|
---|
| 508 | ByVal snbExclude As SNB,
|
---|
| 509 | ByVal reserved As DWord,
|
---|
| 510 | ByRef pstgOpen As *IStorage) As HRESULT
|
---|
| 511 | Declare Function StgOpenStorageOnILockBytes Lib "ole32" (
|
---|
| 512 | ByVal plkbyt As *ILockBytes,
|
---|
| 513 | ByVal pstgPriority As *IStorage,
|
---|
| 514 | ByVal grfMode As DWord,
|
---|
| 515 | ByVal snbExclude As SNB,
|
---|
| 516 | ByVal reserved As DWord,
|
---|
| 517 | ByRef pstgOpen As *IStorage) As HRESULT
|
---|
| 518 |
|
---|
| 519 | Declare Function StgIsStorageFile Lib "ole32" (pwcsName As *OLECHAR) As HRESULT
|
---|
| 520 | Declare Function StgIsStorageILockBytes Lib "ole32" (plkbyt As *ILockBytes) As HRESULT
|
---|
| 521 |
|
---|
| 522 | Declare Function StgSetTimes Lib "ole32" (
|
---|
| 523 | ByVal pszName As *OLECHAR,
|
---|
| 524 | ByRef pctime As FILETIME,
|
---|
| 525 | ByRef patime As FILETIME,
|
---|
| 526 | ByRef pmtime As FILETIME) As HRESULT
|
---|
| 527 |
|
---|
| 528 | Declare Function StgOpenAsyncDocfileOnIFillLockBytes Lib "ole32" (
|
---|
| 529 | ByVal pflb As *IFillLockBytes,
|
---|
| 530 | ByVal grfMode As DWord,
|
---|
| 531 | ByVal asyncFlags As DWord,
|
---|
| 532 | ByRef pstgOpen As *IStorage) As HRESULT
|
---|
| 533 |
|
---|
| 534 | Declare Function StgGetIFillLockBytesOnILockBytes Lib "ole32" (
|
---|
| 535 | ByVal pilb As *ILockBytes,
|
---|
| 536 | ByRef pflb As *IFillLockBytes) As HRESULT
|
---|
| 537 |
|
---|
| 538 | Declare Function StgGetIFillLockBytesOnFile Lib "ole32" (
|
---|
| 539 | ByVal pwcsName As *OLECHAR,
|
---|
| 540 | ByRef pflb As *IFillLockBytes) As HRESULT
|
---|
| 541 | /*
|
---|
| 542 | Declare Function StgOpenLayoutDocfile Lib "ole32" (
|
---|
| 543 | ByVal pwcsName As *OLECHAR,
|
---|
| 544 | ByVal grfMode As DWord,
|
---|
| 545 | ByVal reserved As DWord,
|
---|
| 546 | ByRef pstgOpen As *IStorage) As HRESULT
|
---|
| 547 | */
|
---|
| 548 | /*
|
---|
| 549 | // STG initialization options for StgCreateStorageEx and StgOpenStorageEx
|
---|
| 550 | #if _WIN32_WINNT == 0x500
|
---|
| 551 | #define STGOPTIONS_VERSION 1
|
---|
| 552 | #elif _WIN32_WINNT > 0x500
|
---|
| 553 | #define STGOPTIONS_VERSION 2
|
---|
| 554 | #else
|
---|
| 555 | #define STGOPTIONS_VERSION 0
|
---|
| 556 | #endif
|
---|
| 557 | */
|
---|
| 558 | Type STGOPTIONS
|
---|
| 559 | usVersion As Word
|
---|
| 560 | reserved As Word
|
---|
| 561 | ulSectorSize As DWord
|
---|
| 562 | '#if STGOPTIONS_VERSION >= 2
|
---|
| 563 | ' pwcsTemplateFile As PCWSTR /' version 2 or above
|
---|
| 564 | '#endif
|
---|
| 565 | End Type
|
---|
| 566 |
|
---|
| 567 | Declare Function StgCreateStorageEx Lib "ole32" (
|
---|
| 568 | ByVal pwcsName As *OLECHAR,
|
---|
| 569 | ByVal grfMode As DWord,
|
---|
| 570 | ByVal stgfmt As DWord,
|
---|
| 571 | ByVal grfAttrs As DWord,
|
---|
| 572 | ByVal pStgOptions As *STGOPTIONS,
|
---|
| 573 | ByVal reserved As VoidPtr,
|
---|
| 574 | ByRef riid As IID,
|
---|
| 575 | ByRef pObjectOpen As Any) As HRESULT
|
---|
| 576 |
|
---|
| 577 | Declare Function StgOpenStorageEx Lib "ole32" (
|
---|
| 578 | ByVal pwcsName As *OLECHAR,
|
---|
| 579 | ByVal grfMode As DWord,
|
---|
| 580 | ByVal stgfmt As DWord,
|
---|
| 581 | ByVal grfAttrs As DWord,
|
---|
| 582 | ByVal pStgOptions As *STGOPTIONS,
|
---|
| 583 | ByVal reserved As VoidPtr,
|
---|
| 584 | ByRef riid As IID,
|
---|
| 585 | ByRef pObjectOpen As Any) As HRESULT
|
---|
| 586 |
|
---|
| 587 |
|
---|
| 588 | ' Moniker APIs
|
---|
| 589 |
|
---|
| 590 | Declare Function BindMoniker Lib "ole32" (pmk As *IMoniker, grfOpt As DWord, ByRef iidResult As IID, ByRef pvResult As Any) As HRESULT
|
---|
| 591 | /*
|
---|
| 592 | Declare Function CoInstall Lib "ole32" (
|
---|
| 593 | ByVal pbc As *IBindCtx,
|
---|
| 594 | ByVal dwFlags As DWord,
|
---|
| 595 | ByRef pClassSpec As uCLSSPEC,
|
---|
| 596 | ByRef pQuery As QUERYCONTEXT,
|
---|
| 597 | ByVal pszCodeBase As PWSTR) As HRESULT
|
---|
| 598 | */
|
---|
| 599 | Declare Function CoGetObject Lib "ole32" (pszName As PCWSTR, pBindOptions As *BIND_OPTS, ByRef riid As IID, ByRef ppv As Any) As HRESULT
|
---|
| 600 | Declare Function MkParseDisplayName Lib "ole32" (pbc As *IBindCtx, szUserName As LPCOLESTR, ByRef pchEaten As DWord, ByRef pmk As *IMoniker) As HRESULT
|
---|
| 601 | Declare Function MonikerRelativePathTo Lib "ole32" (pmkSrc As *IMoniker, pmkDest As *IMoniker, ByRef pmkRelPath As *IMoniker, dwReserved As BOOL) As HRESULT
|
---|
| 602 | Declare Function MonikerCommonPrefixWith Lib "ole32" (pmkThis As *IMoniker, pmkOther As *IMoniker, ByRef ppmkCommon As *IMoniker) As HRESULT
|
---|
| 603 | Declare Function CreateBindCtx Lib "ole32" (reserved As DWord, ByRef pbc As *IBindCtx) As HRESULT
|
---|
| 604 | Declare Function CreateGenericComposite Lib "ole32" ( pmkFirst As *IMoniker, pmkRest As *IMoniker, ByRef pmkComposite As *IMoniker) As HRESULT
|
---|
| 605 | Declare Function GetClassFile Lib "ole32" (szFilename As LPCOLESTR, ByRef clsid As CLSID) As HRESULT
|
---|
| 606 | Declare Function CreateClassMoniker Lib "ole32" (ByRef rclsid As CLSID, ByRef pmk As *IMoniker) As HRESULT
|
---|
| 607 | Declare Function CreateFileMoniker Lib "ole32" (lpszPathName As LPCOLESTR, ByRef pmk As *IMoniker) As HRESULT
|
---|
| 608 | Declare Function CreateItemMoniker Lib "ole32" (lpszDelim As LPCOLESTR, lpszItem As LPCOLESTR, ByRef pmk As *IMoniker) As HRESULT
|
---|
| 609 | Declare Function CreateAntiMoniker Lib "ole32" (ByRef pmk As *IMoniker) As HRESULT
|
---|
| 610 | Declare Function CreatePointerMoniker Lib "ole32" (punk As *IUnknown, ByRef pmk As *IMoniker) As HRESULT
|
---|
| 611 | Declare Function CreateObjrefMoniker Lib "ole32" (punk As *IUnknown, ByRef pmk As *IMoniker) As HRESULT
|
---|
| 612 | Declare Function GetRunningObjectTable Lib "ole32" (reserved As DWord, ByRef prot As *IRunningObjectTable) As HRESULT
|
---|
| 613 |
|
---|
| 614 | Interface IBindStatusCallback ' urlmon.sbp
|
---|
| 615 | Inherits IUnknown
|
---|
| 616 | End Interface
|
---|
| 617 | '#include <urlmon.sbp>
|
---|
| 618 | '#include <propidl.sbp>
|
---|
| 619 |
|
---|
| 620 | ' Standard Progress Indicator impolementation
|
---|
| 621 |
|
---|
| 622 | Declare Function CreateStdProgressIndicator Lib "ole32" (
|
---|
| 623 | ByVal hwndParent As HWND,
|
---|
| 624 | ByVal pszTitle As LPCOLESTR,
|
---|
| 625 | ByVal pIbscCaller As *IBindStatusCallback,
|
---|
| 626 | ByRef pIbsc As *IBindStatusCallback) As HRESULT
|
---|
| 627 |
|
---|
| 628 |
|
---|
| 629 | #endif '_INC_OBJBASE
|
---|