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