source: Include/objbase.sbp@ 59

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