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 |
---|
62 | '#if (WINVER >= 400) |
---|
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 |
---|
71 | '#if (_WIN32_WINNT >= 0x0500) |
---|
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 |
---|
138 | pwszServerPrincName As PWSTR |
---|
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 |
---|
146 | pwszName As PWSTR |
---|
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 | |
---|
159 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) |
---|
160 | #ifdef _WIN32_DCOM |
---|
161 | Const Enum COINIT |
---|
162 | COINIT_MULTITHREADED = = &h0 |
---|
163 | COINIT_APARTMENTTHREADED = = &h2 |
---|
164 | COINIT_DISABLE_OLE1DDE = = &h4 |
---|
165 | COINIT_SPEED_OVER_MEMORY = = &h8 |
---|
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__ |
---|
172 | '#if (_WIN32_WINNT >= 0x0501) |
---|
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 | |
---|
193 | '#if (_WIN32_WINNT >= 0x0500) |
---|
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" () |
---|
260 | '#if (_WIN32_WINNT >= 0x0501) |
---|
261 | Declare Sub CoFreeUnusedLibrariesEx Lib "ole32" (dwUnloadDelay As DWord, dwReserved As DWord) |
---|
262 | '#endif |
---|
263 | |
---|
264 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM |
---|
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 | |
---|
331 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM |
---|
332 | #ifdef _WIN32_DCOM |
---|
333 | /* objidl.hでのMULTI_QIの宣言が必要。 |
---|
334 | Declare Function CoGetInstanceFromFile Lib "ole32" ( |
---|
335 | ByVal pServerInfo As *COSERVERINFO, |
---|
336 | ByRef clsid As CLSID, |
---|
337 | ByVal punkOuter As *IUnknown, |
---|
338 | ByVal dwClsCtx As DWord, |
---|
339 | ByVal grfMode As DWord, |
---|
340 | ByVal pwszName As *OLECHAR |
---|
341 | ByVal dwCount As DWord, |
---|
342 | ByVal pResults As *MULTI_QI) As HRESULT |
---|
343 | |
---|
344 | Declare Function CoGetInstanceFromIStorage Lib "ole32" ( |
---|
345 | ByVal pServerInfo As *COSERVERINFO, |
---|
346 | ByRef clsid As CLSID, |
---|
347 | ByVal punkOuter As *IUnknown, |
---|
348 | ByVal dwClsCtx As DWord, |
---|
349 | ByVal grfMode As DWord, |
---|
350 | ByVal pstg As *IStorage |
---|
351 | ByVal dwCount As DWord, |
---|
352 | ByVal pResults As *MULTI_QI) As HRESULT |
---|
353 | |
---|
354 | Declare Function CoCreateInstanceEx Lib "ole32" ( |
---|
355 | ByRef clsid As CLSID, |
---|
356 | ByVal punkOuter As *IUnknown, |
---|
357 | ByVal dwClsCtx As DWord, |
---|
358 | ByVal pServerInfo As *COSERVERINFO, |
---|
359 | ByVal dwCount As DWord, |
---|
360 | ByVal pResults As *MULTI_QI) As HRESULT |
---|
361 | */ |
---|
362 | #endif ' DCOM |
---|
363 | |
---|
364 | /* Call related APIs */ |
---|
365 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM |
---|
366 | #ifdef _WIN32_DCOM |
---|
367 | |
---|
368 | Declare Function CoGetCancelObject Lib "ole32" (dwThreadId As DWord, ByRef iid As IID, ByRef pUnk As Any) As HRESULT |
---|
369 | Declare Function CoSetCancelObject Lib "ole32" (pUnk As *IUnknown) As HRESULT |
---|
370 | Declare Function CoCancelCall Lib "ole32" (dwThreadId As DWord, ulTimeout As DWord) As HRESULT |
---|
371 | Declare Function CoTestCancel Lib "ole32" () As HRESULT |
---|
372 | Declare Function CoEnableCallCancellation Lib "ole32" (pReserved As VoidPtr) As HRESULT |
---|
373 | Declare Function CoDisableCallCancellation Lib "ole32" (pReserved As VoidPtr) As HRESULT |
---|
374 | Declare Function CoAllowSetForegroundWindow Lib "ole32" (pUnk As *IUnknown, pvReserved As VoidPtr) As HRESULT |
---|
375 | Declare Function DcomChannelSetHResult Lib "ole32" (pvReserved As HRESULT, pulReserved As DWord, appsHR As HRESULT) As HRESULT |
---|
376 | |
---|
377 | #endif |
---|
378 | |
---|
379 | /* other helpers */ |
---|
380 | |
---|
381 | Declare Function StringFromCLSID Lib "ole32" (ByRef rclsid As CLSID, ByRef lpsz As LPOLESTR) As HRESULT |
---|
382 | Declare Function CLSIDFromString Lib "ole32" (lpsz As LPOLESTR, ByRef clsid As CLSID) As HRESULT |
---|
383 | Declare Function StringFromIID Lib "ole32" (ByRef iid As IID, ByRef lpsz As LPOLESTR) As HRESULT |
---|
384 | Declare Function IIDFromString Lib "ole32" (lpsz As LPOLESTR, ByRef iid As IID) As HRESULT |
---|
385 | Declare Function CoIsOle1Class Lib "ole32" (ByRef rclsid As CLSID) As BOOL |
---|
386 | Declare Function ProgIDFromCLSID Lib "ole32" (ByRef clsid As CLSID, ByRef lpszProgID As LPOLESTR) As HRESULT |
---|
387 | Declare Function CLSIDFromProgID Lib "ole32" (lpszProgID As LPCOLESTR, ByRef clsid As CLSID) As HRESULT |
---|
388 | Declare Function CLSIDFromProgIDEx Lib "ole32" (lpszProgID As LPCOLESTR, ByRef clsid As CLSID) As HRESULT |
---|
389 | Declare Function StringFromGUID2 Lib "ole32" (ByRef rguid As GUID, lpsz As LPOLESTR, cchMax As Long) As Long |
---|
390 | |
---|
391 | Declare Function CoCreateGuid Lib "ole32" (ByRef guid As GUID) As HRESULT |
---|
392 | |
---|
393 | Declare Function CoFileTimeToDosDateTime Lib "ole32" (ByRef FileTime As FILETIME, ByRef DosDate As Word, ByRef DosTime As Word) As BOOL |
---|
394 | Declare Function CoDosDateTimeToFileTime Lib "ole32" (nDosDate As Word, nDosTime As Word, ByRef FileTime As FILETIME) As BOOL |
---|
395 | Declare Function CoFileTimeNow Lib "ole32" (ByRef FileTime As FILETIME) As HRESULT |
---|
396 | |
---|
397 | Declare Function CoRegisterMessageFilter Lib "ole32" (pMessageFilter As *IMessageFilter, ByRef pMessageFilter As *IMessageFilter) As HRESULT |
---|
398 | |
---|
399 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM |
---|
400 | #ifdef _WIN32_DCOM |
---|
401 | Declare Function CoRegisterChannelHook Lib "ole32" (ByRef ExtensionUuid As GUID, pChannelHook As *IChannelHook) As HRESULT |
---|
402 | #endif ' DCOM |
---|
403 | |
---|
404 | '#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) 'DCOM |
---|
405 | #ifdef _WIN32_DCOM |
---|
406 | |
---|
407 | Declare Function CoWaitForMultipleHandles Lib "ole32" ( |
---|
408 | ByVal dwFlags As DWord, |
---|
409 | ByVal dwTimeout As DWord, |
---|
410 | ByVal cHandles As DWord, |
---|
411 | ByVal pHandles As *HANDLE, |
---|
412 | ByRef dwindex As DWord) As HRESULT |
---|
413 | |
---|
414 | /* Flags for Synchronization API and Classes */ |
---|
415 | |
---|
416 | Const Enum COWAIT_FLAGS |
---|
417 | COWAIT_WAITALL = 1 |
---|
418 | COWAIT_ALERTABLE = 2 |
---|
419 | COWAIT_INPUTAVAILABLE = 4 |
---|
420 | End Enum |
---|
421 | |
---|
422 | #endif ' DCOM |
---|
423 | |
---|
424 | /* for flushing OLESCM remote binding handles */ |
---|
425 | |
---|
426 | #ifdef __UNDECLARED__ |
---|
427 | '#if (_WIN32_WINNT >= 0x0501) |
---|
428 | Declare Function CoInvalidateRemoteMachineBindings Lib "ole32" (pszMachineName As LPOLESTR) As HRESULT |
---|
429 | #endif |
---|
430 | |
---|
431 | /* TreatAs APIS */ |
---|
432 | |
---|
433 | Declare Function CoGetTreatAsClass Lib "ole32" (ByRef clsidOld As CLSID, ByRef ClsidNew As CLSID) As HRESULT |
---|
434 | Declare Function CoTreatAsClass Lib "ole32" (ByRef clsidOld As CLSID, ByRef clsidNew As CLSID) As HRESULT |
---|
435 | |
---|
436 | /* the server dlls must define their DllGetClassObject and DllCanUnloadNow |
---|
437 | * to match these; the typedefs are located here to ensure all are changed at |
---|
438 | * the same time. |
---|
439 | */ |
---|
440 | |
---|
441 | TypeDef LPFNGETCLASSOBJECT = *Function(ByRef rclsid As CLSID, ByRef riid As IID, ByRef ppv As Any) As HRESULT |
---|
442 | TypeDef LPFNCANUNLOADNOW = *Function() As HRESULT |
---|
443 | |
---|
444 | /* |
---|
445 | Declare Function DllGetClassObject(ByRef rclsid As CLSID, ByRef riid As IID, ByVal ppv As *VoidPtr) As HRESULT |
---|
446 | Declare Function DllCanUnloadNow() As HRESULT |
---|
447 | */ |
---|
448 | |
---|
449 | /****** Default Memory Allocation ******************************************/ |
---|
450 | Declare Function CoTaskMemAlloc Lib "ole32" (cb As SIZE_T) As VoidPtr |
---|
451 | Declare Function CoTaskMemRealloc Lib "ole32" (pv As VoidPtr, cb As SIZE_T) As VoidPtr |
---|
452 | Declare Sub CoTaskMemFree Lib "ole32" (pv As VoidPtr) |
---|
453 | |
---|
454 | /****** DV APIs ***********************************************************/ |
---|
455 | |
---|
456 | /* This function is declared in objbase.h and ole2.h */ |
---|
457 | Declare Function CreateDataAdviseHolder Lib "ole32" (ByRef pDAHolder As *IDataAdviseHolder) As HRESULT |
---|
458 | Declare Function CreateDataCache Lib "ole32" (pUnkOuter As *IUnknown, ByRef rclsid As CLSID, ByRef riid As IID, ByRef ppv As Any) As HRESULT |
---|
459 | |
---|
460 | /****** Storage API Prototypes ********************************************/ |
---|
461 | |
---|
462 | |
---|
463 | Declare Function StgCreateDocfile Lib "ole32" ( |
---|
464 | ByVal pwcsName As *OLECHAR, |
---|
465 | ByVal grfMode As DWord, |
---|
466 | ByVal reserved As DWord, |
---|
467 | ByRef pstgOpen As *IStorage) As HRESULT |
---|
468 | |
---|
469 | Declare Function StgCreateDocfileOnILockBytes Lib "ole32" ( |
---|
470 | ByVal plkbyt As *ILockBytes, |
---|
471 | ByVal grfMode As DWord, |
---|
472 | ByVal reserved As DWord, |
---|
473 | ByRef pstgOpen As *IStorage) As HRESULT |
---|
474 | |
---|
475 | Declare Function StgOpenStorage Lib "ole32" ( |
---|
476 | ByVal pwcsName As *OLECHAR, |
---|
477 | ByVal pstgPriority As *IStorage, |
---|
478 | ByVal grfMode As DWord, |
---|
479 | ByVal snbExclude As SNB, |
---|
480 | ByVal reserved As DWord, |
---|
481 | ByRef pstgOpen As *IStorage) As HRESULT |
---|
482 | Declare Function StgOpenStorageOnILockBytes Lib "ole32" ( |
---|
483 | ByVal plkbyt As *ILockBytes, |
---|
484 | ByVal pstgPriority As *IStorage, |
---|
485 | ByVal grfMode As DWord, |
---|
486 | ByVal snbExclude As SNB, |
---|
487 | ByVal reserved As DWord, |
---|
488 | ByRef pstgOpen As *IStorage) As HRESULT |
---|
489 | |
---|
490 | Declare Function StgIsStorageFile Lib "ole32" (pwcsName As *OLECHAR) As HRESULT |
---|
491 | Declare Function StgIsStorageILockBytes Lib "ole32" (plkbyt As *ILockBytes) As HRESULT |
---|
492 | |
---|
493 | Declare Function StgSetTimes Lib "ole32" ( |
---|
494 | ByVal pszName As *OLECHAR, |
---|
495 | ByRef pctime As FILETIME, |
---|
496 | ByRef patime As FILETIME, |
---|
497 | ByRef pmtime As FILETIME) As HRESULT |
---|
498 | |
---|
499 | Declare Function StgOpenAsyncDocfileOnIFillLockBytes Lib "ole32" ( |
---|
500 | ByVal pflb As *IFillLockBytes, |
---|
501 | ByVal grfMode As DWord, |
---|
502 | ByVal asyncFlags As DWord, |
---|
503 | ByRef pstgOpen As *IStorage) As HRESULT |
---|
504 | |
---|
505 | Declare Function StgGetIFillLockBytesOnILockBytes Lib "ole32" ( |
---|
506 | ByVal pilb As *ILockBytes, |
---|
507 | ByRef pflb As *IFillLockBytes) As HRESULT |
---|
508 | |
---|
509 | Declare Function StgGetIFillLockBytesOnFile Lib "ole32" ( |
---|
510 | ByVal pwcsName As *OLECHAR, |
---|
511 | ByRef pflb As *IFillLockBytes) As HRESULT |
---|
512 | /* |
---|
513 | Declare Function StgOpenLayoutDocfile Lib "ole32" ( |
---|
514 | ByVal pwcsName As *OLECHAR, |
---|
515 | ByVal grfMode As DWord, |
---|
516 | ByVal reserved As DWord, |
---|
517 | ByRef pstgOpen As *IStorage) As HRESULT |
---|
518 | */ |
---|
519 | /* |
---|
520 | // STG initialization options for StgCreateStorageEx and StgOpenStorageEx |
---|
521 | #if _WIN32_WINNT == 0x500 |
---|
522 | #define STGOPTIONS_VERSION 1 |
---|
523 | #elif _WIN32_WINNT > 0x500 |
---|
524 | #define STGOPTIONS_VERSION 2 |
---|
525 | #else |
---|
526 | #define STGOPTIONS_VERSION 0 |
---|
527 | #endif |
---|
528 | */ |
---|
529 | Type STGOPTIONS |
---|
530 | usVersion As Word |
---|
531 | reserved As Word |
---|
532 | ulSectorSize As DWord |
---|
533 | '#if STGOPTIONS_VERSION >= 2 |
---|
534 | ' pwcsTemplateFile As PCWSTR /' version 2 or above |
---|
535 | '#endif |
---|
536 | End Type |
---|
537 | |
---|
538 | Declare Function StgCreateStorageEx Lib "ole32" ( |
---|
539 | ByVal pwcsName As *OLECHAR, |
---|
540 | ByVal grfMode As DWord, |
---|
541 | ByVal stgfmt As DWord, |
---|
542 | ByVal grfAttrs As DWord, |
---|
543 | ByVal pStgOptions As *STGOPTIONS, |
---|
544 | ByVal reserved As VoidPtr, |
---|
545 | ByRef riid As IID, |
---|
546 | ByRef pObjectOpen As Any) As HRESULT |
---|
547 | |
---|
548 | Declare Function StgOpenStorageEx Lib "ole32" ( |
---|
549 | ByVal pwcsName As *OLECHAR, |
---|
550 | ByVal grfMode As DWord, |
---|
551 | ByVal stgfmt As DWord, |
---|
552 | ByVal grfAttrs As DWord, |
---|
553 | ByVal pStgOptions As *STGOPTIONS, |
---|
554 | ByVal reserved As VoidPtr, |
---|
555 | ByRef riid As IID, |
---|
556 | ByRef pObjectOpen As Any) As HRESULT |
---|
557 | |
---|
558 | |
---|
559 | ' Moniker APIs |
---|
560 | |
---|
561 | Declare Function BindMoniker Lib "ole32" (pmk As *IMoniker, grfOpt As DWord, ByRef iidResult As IID, ByRef pvResult As Any) As HRESULT |
---|
562 | /* |
---|
563 | Declare Function CoInstall Lib "ole32" ( |
---|
564 | ByVal pbc As *IBindCtx, |
---|
565 | ByVal dwFlags As DWord, |
---|
566 | ByRef pClassSpec As uCLSSPEC, |
---|
567 | ByRef pQuery As QUERYCONTEXT, |
---|
568 | ByVal pszCodeBase As PWSTR) As HRESULT |
---|
569 | */ |
---|
570 | Declare Function CoGetObject Lib "ole32" (pszName As PCWSTR, pBindOptions As *BIND_OPTS, ByRef riid As IID, ByRef ppv As Any) As HRESULT |
---|
571 | Declare Function MkParseDisplayName Lib "ole32" (pbc As *IBindCtx, szUserName As LPCOLESTR, ByRef pchEaten As DWord, ByRef pmk As *IMoniker) As HRESULT |
---|
572 | Declare Function MonikerRelativePathTo Lib "ole32" (pmkSrc As *IMoniker, pmkDest As *IMoniker, ByRef pmkRelPath As *IMoniker, dwReserved As BOOL) As HRESULT |
---|
573 | Declare Function MonikerCommonPrefixWith Lib "ole32" (pmkThis As *IMoniker, pmkOther As *IMoniker, ByRef ppmkCommon As *IMoniker) As HRESULT |
---|
574 | Declare Function CreateBindCtx Lib "ole32" (reserved As DWord, ByRef pbc As *IBindCtx) As HRESULT |
---|
575 | Declare Function CreateGenericComposite Lib "ole32" ( pmkFirst As *IMoniker, pmkRest As *IMoniker, ByRef pmkComposite As *IMoniker) As HRESULT |
---|
576 | Declare Function GetClassFile Lib "ole32" (szFilename As LPCOLESTR, ByRef clsid As CLSID) As HRESULT |
---|
577 | Declare Function CreateClassMoniker Lib "ole32" (ByRef rclsid As CLSID, ByRef pmk As *IMoniker) As HRESULT |
---|
578 | Declare Function CreateFileMoniker Lib "ole32" (lpszPathName As LPCOLESTR, ByRef pmk As *IMoniker) As HRESULT |
---|
579 | Declare Function CreateItemMoniker Lib "ole32" (lpszDelim As LPCOLESTR, lpszItem As LPCOLESTR, ByRef pmk As *IMoniker) As HRESULT |
---|
580 | Declare Function CreateAntiMoniker Lib "ole32" (ByRef pmk As *IMoniker) As HRESULT |
---|
581 | Declare Function CreatePointerMoniker Lib "ole32" (punk As *IUnknown, ByRef pmk As *IMoniker) As HRESULT |
---|
582 | Declare Function CreateObjrefMoniker Lib "ole32" (punk As *IUnknown, ByRef pmk As *IMoniker) As HRESULT |
---|
583 | Declare Function GetRunningObjectTable Lib "ole32" (reserved As DWord, ByRef prot As *IRunningObjectTable) As HRESULT |
---|
584 | |
---|
585 | Interface IBindStatusCallback ' urlmon.sbp |
---|
586 | Inherits IUnknown |
---|
587 | End Interface |
---|
588 | '#include <urlmon.sbp> |
---|
589 | '#include <propidl.sbp> |
---|
590 | |
---|
591 | ' Standard Progress Indicator impolementation |
---|
592 | |
---|
593 | Declare Function CreateStdProgressIndicator Lib "ole32" ( |
---|
594 | ByVal hwndParent As HWND, |
---|
595 | ByVal pszTitle As LPCOLESTR, |
---|
596 | ByVal pIbscCaller As *IBindStatusCallback, |
---|
597 | ByRef pIbsc As *IBindStatusCallback) As HRESULT |
---|
598 | |
---|
599 | |
---|
600 | #endif '_INC_OBJBASE |
---|