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