source: Include/objbase.sbp@ 166

Last change on this file since 166 was 160, checked in by イグトランス (egtra), 18 years ago

API宣言の追加(主にフォーラムに投稿されたものより)

File size: 23.2 KB
Line 
1' objbase.sbp
2
3
4#ifndef _INC_OBJBASE
5#define _INC_OBJBASE
6
7Type CSPLATFORM 'wtypes.sbp
8 dwPlatformId As DWord
9 dwVersionHi As DWord
10 dwVersionLo As DWord
11 dwProcessorArch As DWord
12End Type
13
14Type QUERYCONTEXT 'wtypes.sbp
15 dwContext As DWord
16 latform As CSPLATFORM
17 Locale As LCID
18 dwVersionHi As DWord
19 dwVersionLo As DWord
20End Type
21
22TypeDef RPC_AUTH_IDENTITY_HANDLE = VoidPtr 'Declared in Rpcdce.sbp; include Rpc.sbp.
23TypeDef RPC_AUTHZ_HANDLE = VoidPtr 'Declared in Rpcdce.sbp; include Rpc.sbp.
24
25TypeDef IID = GUID
26TypeDef CLSID = GUID
27
28Sub 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
37End Sub
38Sub ULISet32(ByRef li As ULARGE_INTEGER, v As DWord)
39 With li
40 .HighPart = 0
41 .LowPart = v
42 End With
43End Sub
44
45Const MARSHALINTERFACE_MIN = 500
46
47Const CWCSTORAGENAME = 32
48
49/* Storage instantiation modes */
50Const STGM_DIRECT = &h00000000
51Const STGM_TRANSACTED = &h00010000
52Const STGM_SIMPLE = &h08000000
53
54Const STGM_READ = &h00000000
55Const STGM_WRITE = &h00000001
56Const STGM_READWRITE = &h00000002
57
58Const STGM_SHARE_DENY_NONE = &h00000040
59Const STGM_SHARE_DENY_READ = &h00000030
60Const STGM_SHARE_DENY_WRITE = &h00000020
61Const STGM_SHARE_EXCLUSIVE = &h00000010
62
63Const STGM_PRIORITY = &h00040000
64Const STGM_DELETEONRELEASE = &h04000000
65'#if (WINVER >= 400)
66Const STGM_NOSCRATCH = &h00100000
67'#endif /* WINVER */
68
69Const STGM_CREATE = &h00001000
70Const STGM_CONVERT = &h00020000
71Const STGM_FAILIFTHERE = &h00000000
72
73Const STGM_NOSNAPSHOT = &h00200000
74'#if (_WIN32_WINNT >= 0x0500)
75Const STGM_DIRECT_SWMR = &h00400000
76'#endif
77
78/* flags for internet asyncronous and layout docfile */
79Const ASYNC_MODE_COMPATIBILITY = &h00000001
80Const ASYNC_MODE_DEFAULT = &h00000000
81
82Const STGTY_REPEAT = &h00000100
83Const STG_TOEND = &hFFFFFFFF
84
85Const STG_LAYOUT_SEQUENTIAL = &h00000000
86Const STG_LAYOUT_INTERLEAVED = &h00000001
87
88Const STGFMT_STORAGE = 0
89Const STGFMT_NATIVE = 1
90Const STGFMT_FILE = 3
91Const STGFMT_ANY = 4
92Const STGFMT_DOCFILE = 5
93
94Const 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
107Const CLSCTX_INPROC_SERVER = &H01
108Const CLSCTX_INPROC_HANDLER = &H02
109Const CLSCTX_LOCAL_SERVER = &H4
110Const CLSCTX_INPROC_SERVER16 = &H8
111Const CLSCTX_REMOTE_SERVER = &H10
112Const CLSCTX_INPROC_HANDLER16 = &H20
113Const CLSCTX_INPROC_SERVERX86 = &H40
114Const CLSCTX_INPROC_HANDLERX86 = &H80
115Const CLSCTX_ESERVER_HANDLER = &H100
116
117Const CLSCTX_INPROC = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER
118Const CLSCTX_ALL = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER
119Const CLSCTX_SERVER = CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER
120
121Const Enum REGCLS
122 REGCLS_SINGLEUSE = 0
123 REGCLS_MULTIPLEUSE = 1
124 REGCLS_MULTI_SEPARATE = 2
125 REGCLS_SUSPENDED = 4
126 REGCLS_SURROGATE = 8
127End Enum
128
129Type 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
137End Type
138Type 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
146End Type
147Type COSERVERINFO
148 dwReserved1 As DWord
149 pwszName As PWSTR
150 pAuthInfo As *COAUTHINFO
151 dwReserved2 As DWord
152End Type
153Declare Function CoInitialize Lib "ole32" (pvReserved As VoidPtr) As HRESULT
154Declare Sub CoUninitialize Lib "ole32" ()
155'Declare Sub CoGetMalloc Lib "ole32" (dwMemContext As DWord, ByRef pMalloc As *IMalloc) As HRESULT
156Declare Function CoGetCurrentProcess Lib "ole32" () As DWord
157'Declare Function CoRegisterMallocSpy Lib "ole32" (pMallocSpy As *IMallocSpy) As HRESULT
158Declare 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
164Const Enum COINIT
165 COINIT_MULTITHREADED = = &h0
166 COINIT_APARTMENTTHREADED = = &h2
167 COINIT_DISABLE_OLE1DDE = = &h4
168 COINIT_SPEED_OVER_MEMORY = = &h8
169End Enum
170Declare Function CoInitializeEx Lib "ole32" (pvReserved As VoidPtr, dwCoInit As DWord) As HRESULT
171Declare 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
178Declare Function CoRevokeInitializeSpy Lib "ole32" (uliCookie As QWord) As HRESULT
179
180Declare Function CoGetContextToken Lib "ole32" (ByRef token As ULONG_PTR) As HRESULT
181
182Const Enum COMSD
183 SD_LAUNCHPERMISSIONS = 0
184 SD_ACCESSPERMISSIONS = 1
185 SD_LAUNCHRESTRICTIONS = 2
186 SD_ACCESSRESTRICTIONS = 3
187End 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
196Dim GUID_NULL = [0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0]] As GUID
197
198Function IsEqualGUID(ByRef rguid1 As GUID, ByRef rguid2 As GUID) As BOOL
199 IsEqualGUID = Not memcmp(VarPtr(rguid1),VarPtr(rguid2),SizeOf(GUID))
200End Function
201Function IsEqualIID(ByRef riid1 As GUID, ByRef riid2 As GUID) As BOOL
202 IsEqualIID=IsEqualGUID(riid1,riid2)
203End Function
204Function IsEqualCLSID(ByRef rclsid1 As CLSID, ByRef rclsid2 As CLSID) As BOOL
205 IsEqualCLSID=IsEqualGUID(rclsid1,rclsid2)
206End Function
207
208'#if (_WIN32_WINNT >= 0x0500)
209
210Type 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
218End Type
219
220'#endif
221
222/* COM+ APIs */
223
224Declare Function CoGetObjectContext Lib "ole32" (ByRef riid As IID, ByRef ppv As Any) As HRESULT
225
226/* register/revoke/get class objects */
227
228Declare Function CoGetClassObject Lib "ole32" (ByRef rclsid As CLSID, dwClsContext As DWord, pServerInfo As *COSERVERINFO, ByRef refiid As IID, ByRef ppv As Any) As HRESULT
229Declare Function CoRegisterClassObject Lib "ole32" (ByRef rclsid As CLSID, pUnk As *IUnknown, dwClsContext As DWord, flags As DWord, ByRef dwRegister As DWord) As HRESULT
230Declare Function CoRevokeClassObject Lib "ole32" (dwRegister As DWord) As HRESULT
231Declare Function CoResumeClassObjects Lib "ole32" () As HRESULT
232Declare Function CoSuspendClassObjects Lib "ole32" () As HRESULT
233Declare Function CoAddRefServerProcess Lib "ole32" () As DWord
234Declare Function CoReleaseServerProcess Lib "ole32" () As DWord
235Declare Function CoGetPSClsid Lib "ole32" (ByRef riid As IID, ByRef rclsid As CLSID) As HRESULT
236Declare 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
243Declare 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
244Declare 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
245Declare Function CoUnmarshalInterface Lib "ole32" (pstm As *IStream, ByRef riid As IID, ByRef ppv As Any) As HRESULT
246Declare Function CoMarshalHresult Lib "ole32" (pstm As *IStream, hresult As HRESULT) As HRESULT
247Declare Function CoUnmarshalHresult Lib "ole32" (pstm As *IStream, ByRef phresult As HRESULT) As HRESULT
248Declare Function CoReleaseMarshalData Lib "ole32" (pstm As *IStream) As HRESULT
249Declare Function CoDisconnectObject Lib "ole32" (pUnk As *IUnknown, dwReserved As DWord) As HRESULT
250Declare 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
253Declare Function CoGetStdMarshalEx Lib "ole32" (pUnkOuter As *IUnknown, smexflags As DWord, ByRef pUnkInner As *IUnknown) As HRESULT
254
255/* flags for CoGetStdMarshalEx */
256Const Enum STDMSHLFLAGS
257 SMEXF_SERVER = &h01
258 SMEXF_HANDLER = &h02
259End Enum
260
261Declare Function CoIsHandlerConnected Lib "ole32" (pUnk As *IUnknown) As BOOL
262
263/* Apartment model inter-thread interface passing helpers */
264Declare Function CoMarshalInterThreadInterfaceInStream Lib "ole32" (ByRef riid As IID, pUnk As *IUnknown, ByRef pStm As *IStream) As HRESULT
265
266Declare Function CoGetInterfaceAndReleaseStream Lib "ole32" (pStm As *IStream, ByRef riid As IID, ByRef ppv As Any) As HRESULT
267Declare 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
271Declare Function CoLoadLibrary Lib "ole32" (lpszLibName As LPOLESTR, bAutoFree As BOOL) As HINSTANCE
272Declare Sub CoFreeLibrary Lib "ole32" (hInst As HINSTANCE)
273Declare Sub CoFreeAllLibraries Lib "ole32" ()
274Declare Sub CoFreeUnusedLibraries Lib "ole32" ()
275'#if (_WIN32_WINNT >= 0x0501)
276Declare 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
284Declare 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
293Declare Function CoGetCallContext Lib "ole32" (
294 ByRef riid As IID,
295 ByRef pInterface As Any) As HRESULT
296Declare 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
305Declare 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
314Declare Function CoCopyProxy Lib "ole32" (
315 ByVal pProxySrc As *IUnknown,
316 ByRef pProxyDst As *IUnknown) As HRESULT
317Declare 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
325Declare Function CoImpersonateClient Lib "ole32" () As HRESULT
326Declare Function CoRevertToSelf Lib "ole32" () As HRESULT
327/*
328Declare Function CoRevertToSelf Lib "ole32" (
329 ByRef cAuthSvc As DWord,
330 ByRef asAuthSvc As *SOLE_AUTHENTICATION_SERVICE) As HRESULT
331*/
332Declare Function CoSwitchCallContext Lib "ole32" (
333 ByVal pNewObject As *IUnknown,
334 ByRef ppOldObject As *IUnknown) As HRESULT
335
336Const COM_RIGHTS_EXECUTE = 1
337Const COM_RIGHTS_EXECUTE_LOCAL = 2
338Const COM_RIGHTS_EXECUTE_REMOTE = 4
339Const COM_RIGHTS_ACTIVATE_LOCAL = 8
340Const COM_RIGHTS_ACTIVATE_REMOTE = 16
341
342#endif ' DCOM
343
344Declare 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の宣言が必要。
349Declare 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
359Declare 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
369Declare 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
383Declare Function CoGetCancelObject Lib "ole32" (dwThreadId As DWord, ByRef iid As IID, ByRef pUnk As Any) As HRESULT
384Declare Function CoSetCancelObject Lib "ole32" (pUnk As *IUnknown) As HRESULT
385Declare Function CoCancelCall Lib "ole32" (dwThreadId As DWord, ulTimeout As DWord) As HRESULT
386Declare Function CoTestCancel Lib "ole32" () As HRESULT
387Declare Function CoEnableCallCancellation Lib "ole32" (pReserved As VoidPtr) As HRESULT
388Declare Function CoDisableCallCancellation Lib "ole32" (pReserved As VoidPtr) As HRESULT
389Declare Function CoAllowSetForegroundWindow Lib "ole32" (pUnk As *IUnknown, pvReserved As VoidPtr) As HRESULT
390Declare Function DcomChannelSetHResult Lib "ole32" (pvReserved As HRESULT, pulReserved As DWord, appsHR As HRESULT) As HRESULT
391
392#endif
393
394/* other helpers */
395
396Declare Function StringFromCLSID Lib "ole32" (ByRef rclsid As CLSID, ByRef lpsz As LPOLESTR) As HRESULT
397Declare Function CLSIDFromString Lib "ole32" (lpsz As LPOLESTR, ByRef clsid As CLSID) As HRESULT
398Declare Function StringFromIID Lib "ole32" (ByRef iid As IID, ByRef lpsz As LPOLESTR) As HRESULT
399Declare Function IIDFromString Lib "ole32" (lpsz As LPOLESTR, ByRef iid As IID) As HRESULT
400Declare Function CoIsOle1Class Lib "ole32" (ByRef rclsid As CLSID) As BOOL
401Declare Function ProgIDFromCLSID Lib "ole32" (ByRef clsid As CLSID, ByRef lpszProgID As LPOLESTR) As HRESULT
402Declare Function CLSIDFromProgID Lib "ole32" (lpszProgID As LPCOLESTR, ByRef clsid As CLSID) As HRESULT
403Declare Function CLSIDFromProgIDEx Lib "ole32" (lpszProgID As LPCOLESTR, ByRef clsid As CLSID) As HRESULT
404Declare Function StringFromGUID2 Lib "ole32" (ByRef rguid As GUID, lpsz As LPOLESTR, cchMax As Long) As Long
405
406Declare Function CoCreateGuid Lib "ole32" (ByRef guid As GUID) As HRESULT
407
408Declare Function CoFileTimeToDosDateTime Lib "ole32" (ByRef FileTime As FILETIME, ByRef DosDate As Word, ByRef DosTime As Word) As BOOL
409Declare Function CoDosDateTimeToFileTime Lib "ole32" (nDosDate As Word, nDosTime As Word, ByRef FileTime As FILETIME) As BOOL
410Declare Function CoFileTimeNow Lib "ole32" (ByRef FileTime As FILETIME) As HRESULT
411
412Declare 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
416Declare 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
422Declare 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
431Const Enum COWAIT_FLAGS
432 COWAIT_WAITALL = 1
433 COWAIT_ALERTABLE = 2
434 COWAIT_INPUTAVAILABLE = 4
435End Enum
436
437#endif ' DCOM
438
439/* for flushing OLESCM remote binding handles */
440
441#ifdef __UNDECLARED__
442'#if (_WIN32_WINNT >= 0x0501)
443Declare Function CoInvalidateRemoteMachineBindings Lib "ole32" (pszMachineName As LPOLESTR) As HRESULT
444#endif
445
446/* TreatAs APIS */
447
448Declare Function CoGetTreatAsClass Lib "ole32" (ByRef clsidOld As CLSID, ByRef ClsidNew As CLSID) As HRESULT
449Declare 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
456TypeDef LPFNGETCLASSOBJECT = *Function(ByRef rclsid As CLSID, ByRef riid As IID, ByRef ppv As Any) As HRESULT
457TypeDef LPFNCANUNLOADNOW = *Function() As HRESULT
458
459/*
460Declare Function DllGetClassObject(ByRef rclsid As CLSID, ByRef riid As IID, ByVal ppv As *VoidPtr) As HRESULT
461Declare Function DllCanUnloadNow() As HRESULT
462*/
463
464/****** Default Memory Allocation ******************************************/
465Declare Function CoTaskMemAlloc Lib "ole32" (cb As SIZE_T) As VoidPtr
466Declare Function CoTaskMemRealloc Lib "ole32" (pv As VoidPtr, cb As SIZE_T) As VoidPtr
467Declare Sub CoTaskMemFree Lib "ole32" (pv As VoidPtr)
468
469/****** DV APIs ***********************************************************/
470
471/* This function is declared in objbase.h and ole2.h */
472Declare Function CreateDataAdviseHolder Lib "ole32" (ByRef pDAHolder As *IDataAdviseHolder) As HRESULT
473Declare 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
478Declare 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
484Declare 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
490Declare 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
497Declare 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
505Declare Function StgIsStorageFile Lib "ole32" (pwcsName As *OLECHAR) As HRESULT
506Declare Function StgIsStorageILockBytes Lib "ole32" (plkbyt As *ILockBytes) As HRESULT
507
508Declare 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
514Declare 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
520Declare Function StgGetIFillLockBytesOnILockBytes Lib "ole32" (
521 ByVal pilb As *ILockBytes,
522 ByRef pflb As *IFillLockBytes) As HRESULT
523
524Declare Function StgGetIFillLockBytesOnFile Lib "ole32" (
525 ByVal pwcsName As *OLECHAR,
526 ByRef pflb As *IFillLockBytes) As HRESULT
527/*
528Declare 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*/
544Type 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
551End Type
552
553Declare 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
563Declare 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
576Declare Function BindMoniker Lib "ole32" (pmk As *IMoniker, grfOpt As DWord, ByRef iidResult As IID, ByRef pvResult As Any) As HRESULT
577/*
578Declare 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*/
585Declare Function CoGetObject Lib "ole32" (pszName As PCWSTR, pBindOptions As *BIND_OPTS, ByRef riid As IID, ByRef ppv As Any) As HRESULT
586Declare Function MkParseDisplayName Lib "ole32" (pbc As *IBindCtx, szUserName As LPCOLESTR, ByRef pchEaten As DWord, ByRef pmk As *IMoniker) As HRESULT
587Declare Function MonikerRelativePathTo Lib "ole32" (pmkSrc As *IMoniker, pmkDest As *IMoniker, ByRef pmkRelPath As *IMoniker, dwReserved As BOOL) As HRESULT
588Declare Function MonikerCommonPrefixWith Lib "ole32" (pmkThis As *IMoniker, pmkOther As *IMoniker, ByRef ppmkCommon As *IMoniker) As HRESULT
589Declare Function CreateBindCtx Lib "ole32" (reserved As DWord, ByRef pbc As *IBindCtx) As HRESULT
590Declare Function CreateGenericComposite Lib "ole32" ( pmkFirst As *IMoniker, pmkRest As *IMoniker, ByRef pmkComposite As *IMoniker) As HRESULT
591Declare Function GetClassFile Lib "ole32" (szFilename As LPCOLESTR, ByRef clsid As CLSID) As HRESULT
592Declare Function CreateClassMoniker Lib "ole32" (ByRef rclsid As CLSID, ByRef pmk As *IMoniker) As HRESULT
593Declare Function CreateFileMoniker Lib "ole32" (lpszPathName As LPCOLESTR, ByRef pmk As *IMoniker) As HRESULT
594Declare Function CreateItemMoniker Lib "ole32" (lpszDelim As LPCOLESTR, lpszItem As LPCOLESTR, ByRef pmk As *IMoniker) As HRESULT
595Declare Function CreateAntiMoniker Lib "ole32" (ByRef pmk As *IMoniker) As HRESULT
596Declare Function CreatePointerMoniker Lib "ole32" (punk As *IUnknown, ByRef pmk As *IMoniker) As HRESULT
597Declare Function CreateObjrefMoniker Lib "ole32" (punk As *IUnknown, ByRef pmk As *IMoniker) As HRESULT
598Declare Function GetRunningObjectTable Lib "ole32" (reserved As DWord, ByRef prot As *IRunningObjectTable) As HRESULT
599
600Interface IBindStatusCallback ' urlmon.sbp
601 Inherits IUnknown
602End Interface
603'#include <urlmon.sbp>
604'#include <propidl.sbp>
605
606' Standard Progress Indicator impolementation
607
608Declare 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
Note: See TracBrowser for help on using the repository browser.