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