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