From 2773c06bd428fe011c8ed236c7a4308e725196b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Thu, 4 Jun 2020 15:05:01 +0000 Subject: [PATCH] gio: Add private headers with missing UWP/COM types MinGW-w64 lacks the appropriate headers, so we have to add them here. Note that these only have the C versions (normally these things come in both C and C++ flavours), since that's what we use. Also note that some of the functions that we don't use (but must describe to maintain binary compatibility) were altered to use IUnknown (basically, an untyped pointer) instead of the appropriate object types, as adding these types would require other types, which would pull even more types, forcing us to drag half of the UWP headers in here. By replacing unused types with IUnknown we can trim a lot of branches from the dependency graph. --- ...gwin32api-application-activation-manager.h | 126 +++++++ gio/gwin32api-iterator.h | 125 +++++++ gio/gwin32api-misc.h | 1 + gio/gwin32api-package.h | 264 ++++++++++++++ gio/gwin32api-storage.h | 339 ++++++++++++++++++ 5 files changed, 855 insertions(+) create mode 100755 gio/gwin32api-application-activation-manager.h create mode 100755 gio/gwin32api-iterator.h create mode 100755 gio/gwin32api-misc.h create mode 100755 gio/gwin32api-package.h create mode 100755 gio/gwin32api-storage.h diff --git a/gio/gwin32api-application-activation-manager.h b/gio/gwin32api-application-activation-manager.h new file mode 100755 index 000000000..cf44b93e6 --- /dev/null +++ b/gio/gwin32api-application-activation-manager.h @@ -0,0 +1,126 @@ +#if NTDDI_VERSION < NTDDI_WIN8 +/* The following code is copied verbatim from MinGW-w64 shobjidl.h */ +/* + * IApplicationActivationManager interface + */ +typedef enum ACTIVATEOPTIONS { + AO_NONE = 0x0, + AO_DESIGNMODE = 0x1, + AO_NOERRORUI = 0x2, + AO_NOSPLASHSCREEN = 0x4 +} ACTIVATEOPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(ACTIVATEOPTIONS) + +#ifndef __IApplicationActivationManager_INTERFACE_DEFINED__ +#define __IApplicationActivationManager_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_IApplicationActivationManager, 0x2e941141, 0x7f97, 0x4756, 0xba,0x1d, 0x9d,0xec,0xde,0x89,0x4a,0x3d); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("2e941141-7f97-4756-ba1d-9decde894a3d") +IApplicationActivationManager : public IUnknown +{ + virtual HRESULT STDMETHODCALLTYPE ActivateApplication( + LPCWSTR appUserModelId, + LPCWSTR arguments, + ACTIVATEOPTIONS options, + DWORD *processId) = 0; + + virtual HRESULT STDMETHODCALLTYPE ActivateForFile( + LPCWSTR appUserModelId, + IShellItemArray *itemArray, + LPCWSTR verb, + DWORD *processId) = 0; + + virtual HRESULT STDMETHODCALLTYPE ActivateForProtocol( + LPCWSTR appUserModelId, + IShellItemArray *itemArray, + DWORD *processId) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IApplicationActivationManager, 0x2e941141, 0x7f97, 0x4756, 0xba,0x1d, 0x9d,0xec,0xde,0x89,0x4a,0x3d) +#endif +#else +typedef struct IApplicationActivationManagerVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IApplicationActivationManager *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IApplicationActivationManager *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IApplicationActivationManager *This); + + /*** IApplicationActivationManager methods ***/ + HRESULT (STDMETHODCALLTYPE *ActivateApplication)( + IApplicationActivationManager *This, + LPCWSTR appUserModelId, + LPCWSTR arguments, + ACTIVATEOPTIONS options, + DWORD *processId); + + HRESULT (STDMETHODCALLTYPE *ActivateForFile)( + IApplicationActivationManager *This, + LPCWSTR appUserModelId, + IShellItemArray *itemArray, + LPCWSTR verb, + DWORD *processId); + + HRESULT (STDMETHODCALLTYPE *ActivateForProtocol)( + IApplicationActivationManager *This, + LPCWSTR appUserModelId, + IShellItemArray *itemArray, + DWORD *processId); + + END_INTERFACE +} IApplicationActivationManagerVtbl; + +interface IApplicationActivationManager { + CONST_VTBL IApplicationActivationManagerVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define IApplicationActivationManager_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IApplicationActivationManager_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IApplicationActivationManager_Release(This) (This)->lpVtbl->Release(This) +/*** IApplicationActivationManager methods ***/ +#define IApplicationActivationManager_ActivateApplication(This,appUserModelId,arguments,options,processId) (This)->lpVtbl->ActivateApplication(This,appUserModelId,arguments,options,processId) +#define IApplicationActivationManager_ActivateForFile(This,appUserModelId,itemArray,verb,processId) (This)->lpVtbl->ActivateForFile(This,appUserModelId,itemArray,verb,processId) +#define IApplicationActivationManager_ActivateForProtocol(This,appUserModelId,itemArray,processId) (This)->lpVtbl->ActivateForProtocol(This,appUserModelId,itemArray,processId) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT IApplicationActivationManager_QueryInterface(IApplicationActivationManager* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG IApplicationActivationManager_AddRef(IApplicationActivationManager* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG IApplicationActivationManager_Release(IApplicationActivationManager* This) { + return This->lpVtbl->Release(This); +} +/*** IApplicationActivationManager methods ***/ +static FORCEINLINE HRESULT IApplicationActivationManager_ActivateApplication(IApplicationActivationManager* This,LPCWSTR appUserModelId,LPCWSTR arguments,ACTIVATEOPTIONS options,DWORD *processId) { + return This->lpVtbl->ActivateApplication(This,appUserModelId,arguments,options,processId); +} +static FORCEINLINE HRESULT IApplicationActivationManager_ActivateForFile(IApplicationActivationManager* This,LPCWSTR appUserModelId,IShellItemArray *itemArray,LPCWSTR verb,DWORD *processId) { + return This->lpVtbl->ActivateForFile(This,appUserModelId,itemArray,verb,processId); +} +static FORCEINLINE HRESULT IApplicationActivationManager_ActivateForProtocol(IApplicationActivationManager* This,LPCWSTR appUserModelId,IShellItemArray *itemArray,DWORD *processId) { + return This->lpVtbl->ActivateForProtocol(This,appUserModelId,itemArray,processId); +} +#endif +#endif + +#endif + + +#endif /* __IApplicationActivationManager_INTERFACE_DEFINED__ */ +#endif /* NTDDI_VERSION < NTDDI_WIN8 */ \ No newline at end of file diff --git a/gio/gwin32api-iterator.h b/gio/gwin32api-iterator.h new file mode 100755 index 000000000..d4df8a7b8 --- /dev/null +++ b/gio/gwin32api-iterator.h @@ -0,0 +1,125 @@ +typedef interface IIterator IIterator; +typedef interface IIterable IIterable; + +/* IIterator */ +typedef struct IIteratorVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IIterator *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IIterator *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IIterator *This); + + /*** IInspectable methods ***/ + HRESULT (STDMETHODCALLTYPE *GetIids)( + IIterator *This, + UINT32 *count, + IID **ids); + + HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( + IIterator *This, + HSTRING *className); + + HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( + IIterator *This, + TrustLevel *trustLevel); + + /*** IIterator methods ***/ + HRESULT (STDMETHODCALLTYPE *get_Current)( + IIterator *This, + IUnknown **current); + + HRESULT (STDMETHODCALLTYPE *get_HasCurrent)( + IIterator *This, + CHAR *hasCurrent); + + HRESULT (STDMETHODCALLTYPE *MoveNext)( + IIterator *This, + CHAR *hasCurrent); + + HRESULT (STDMETHODCALLTYPE *GetMany)( + IIterator *This, + UINT capacity, + void *value, + UINT *actual); + + END_INTERFACE +} IIteratorVtbl; + +interface IIterator { + CONST_VTBL IIteratorVtbl* lpVtbl; +}; + +/*** IUnknown methods ***/ +#define IIterator_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IIterator_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IIterator_Release(This) (This)->lpVtbl->Release(This) +/*** IInspectable methods ***/ +#define IIterator_GetIids(This,count,ids) (This)->lpVtbl->GetIids(This,count,ids) +#define IIterator_GetRuntimeClassName(This,name) (This)->lpVtbl->GetRuntimeClassName(This,name) +#define IIterator_GetTrustLevel(This,level) (This)->lpVtbl->GetTrustLevel(This,level) +/*** IIterator methods ***/ +#define IIterator_get_Current(This,current) (This)->lpVtbl->get_Current(This,current) +#define IIterator_get_HasCurrent(This,hasCurrent) (This)->lpVtbl->get_HasCurrent(This,hasCurrent) +#define IIterator_MoveNext(This,hasCurrent) (This)->lpVtbl->MoveNext(This,hasCurrent) +#define IIterator_GetMany(This,capacity,value,actual) (This)->lpVtbl->GetMany(This,capacity,value,actual) + +/* IIterable */ +typedef struct IIterableVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IIterable *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IIterable *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IIterable *This); + + /*** IInspectable methods ***/ + HRESULT (STDMETHODCALLTYPE *GetIids)( + IIterable *This, + UINT32 *count, + IID **ids); + + HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( + IIterable *This, + HSTRING *className); + + HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( + IIterable *This, + TrustLevel *trustLevel); + + /*** IIterable methods ***/ + HRESULT (STDMETHODCALLTYPE *First)( + IIterable *This, + IIterator **first); + + END_INTERFACE +} IIterableVtbl; + +interface IIterable { + CONST_VTBL IIterableVtbl* lpVtbl; +}; + +/*** IUnknown methods ***/ +#define IIterable_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IIterable_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IIterable_Release(This) (This)->lpVtbl->Release(This) +/*** IInspectable methods ***/ +#define IIterable_GetIids(This,count,ids) (This)->lpVtbl->GetIids(This,count,ids) +#define IIterable_GetRuntimeClassName(This,name) (This)->lpVtbl->GetRuntimeClassName(This,name) +#define IIterable_GetTrustLevel(This,level) (This)->lpVtbl->GetTrustLevel(This,level) +/*** IIterable methods ***/ +#define IIterable_First(This,retval) (This)->lpVtbl->First(This,retval) diff --git a/gio/gwin32api-misc.h b/gio/gwin32api-misc.h new file mode 100755 index 000000000..2b45d9abd --- /dev/null +++ b/gio/gwin32api-misc.h @@ -0,0 +1 @@ +typedef interface IProcessorArchitecture IProcessorArchitecture; diff --git a/gio/gwin32api-package.h b/gio/gwin32api-package.h new file mode 100755 index 000000000..9842a86fa --- /dev/null +++ b/gio/gwin32api-package.h @@ -0,0 +1,264 @@ +typedef interface IPackageManager IPackageManager; +typedef interface IPackage IPackage; +typedef interface IPackageId IPackageId; +typedef interface IPackageVersion IPackageVersion; + +DEFINE_GUID(IID_IPackageManager, 0x9A7D4B65, 0x5E8F, 0x4FC7, 0xA2, 0xE5, 0x7F, 0x69, 0x25, 0xCB, 0x8B, 0x53); +DEFINE_GUID(IID_IPackage, 0x163C792F, 0xBD75, 0x413C, 0xBF, 0x23, 0xB1, 0xFE, 0x7B, 0x95, 0xD8, 0x25); + +/* IPackageManager */ +typedef struct IPackageManagerVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IPackageManager *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IPackageManager *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IPackageManager *This); + + /*** IInspectable methods ***/ + HRESULT (STDMETHODCALLTYPE *GetIids)( + IPackageManager *This, + UINT32 *count, + IID **ids); + + HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( + IPackageManager *This, + HSTRING *className); + + HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( + IPackageManager *This, + TrustLevel *trustLevel); + + /*** IPackageManager methods ***/ + HRESULT (STDMETHODCALLTYPE *stub_AddPackageAsync)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_UpdatePackageAsync)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_RemovePackageAsync)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_StagePackageAsync)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_RegisterPackageAsync)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *FindPackages)( + IPackageManager *This, + IIterable **retval); + + HRESULT (STDMETHODCALLTYPE *FindPackagesByUserSecurityId)( + IPackageManager *This, + HSTRING userSecurityId, + IIterable **retval); + + HRESULT (STDMETHODCALLTYPE *stub_FindPackagesByNamePublisher)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_FindPackagesByUserSecurityIdNamePublisher)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_FindUsers)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_SetPackageState)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_FindPackageByPackageFullName)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_CleanupPackageForUserAsync)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_FindPackagesByPackageFamilyName)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_FindPackagesByUserSecurityIdPackageFamilyName)( + IPackageManager *This); + + HRESULT (STDMETHODCALLTYPE *stub_FindPackageByUserSecurityIdPackageFullName)( + IPackageManager *This); + + END_INTERFACE +} IPackageManagerVtbl; + +interface IPackageManager { + CONST_VTBL IPackageManagerVtbl* lpVtbl; +}; + +/*** IUnknown methods ***/ +#define IPackageManager_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IPackageManager_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IPackageManager_Release(This) (This)->lpVtbl->Release(This) +/*** IInspectable methods ***/ +#define IPackageManager_GetIids(This,count,ids) (This)->lpVtbl->GetIids(This,count,ids) +#define IPackageManager_GetRuntimeClassName(This,name) (This)->lpVtbl->GetRuntimeClassName(This,name) +#define IPackageManager_GetTrustLevel(This,level) (This)->lpVtbl->GetTrustLevel(This,level) +/*** IPackageManager methods ***/ +#define IPackageManager_FindPackages(This,retval) (This)->lpVtbl->FindPackages(This,retval) +#define IPackageManager_FindPackagesByUserSecurityId(This,userSecurityId,retval) (This)->lpVtbl->FindPackagesByUserSecurityId(This,userSecurityId,retval) + +/* IPackageId */ +typedef struct IPackageIdVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IPackageId *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IPackageId *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IPackageId *This); + + /*** IInspectable methods ***/ + HRESULT (STDMETHODCALLTYPE *GetIids)( + IPackageId *This, + UINT32 *count, + IID **ids); + + HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( + IPackageId *This, + HSTRING *className); + + HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( + IPackageId *This, + TrustLevel *trustLevel); + + /*** IPackageId methods ***/ + HRESULT (STDMETHODCALLTYPE *get_Name)( + IPackageId *This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_Version)( + IPackageId *This, + IPackageVersion *value); + + HRESULT (STDMETHODCALLTYPE *get_Architecture)( + IPackageId *This, + IProcessorArchitecture *value); + + HRESULT (STDMETHODCALLTYPE *get_ResourceId)( + IPackageId *This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_Publisher)( + IPackageId *This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_PublisherId)( + IPackageId *This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_FullName)( + IPackageId *This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_FamilyName)( + IPackageId *This, + HSTRING *value); + + END_INTERFACE +} IPackageIdVtbl; + +interface IPackageId { + CONST_VTBL IPackageIdVtbl* lpVtbl; +}; + +/*** IUnknown methods ***/ +#define IPackageId_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IPackageId_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IPackageId_Release(This) (This)->lpVtbl->Release(This) +/*** IInspectable methods ***/ +#define IPackageId_GetIids(This,count,ids) (This)->lpVtbl->GetIids(This,count,ids) +#define IPackageId_GetRuntimeClassName(This,name) (This)->lpVtbl->GetRuntimeClassName(This,name) +#define IPackageId_GetTrustLevel(This,level) (This)->lpVtbl->GetTrustLevel(This,level) +/*** IPackageId methods ***/ +#define IPackageId_get_Name(This,value) (This)->lpVtbl->get_Name(This,value) +#define IPackageId_get_Version(This,value) (This)->lpVtbl->get_Version(This,value) +#define IPackageId_get_Architecture(This,value) (This)->lpVtbl->get_Architecture(This,value) +#define IPackageId_get_ResourceId(This,value) (This)->lpVtbl->get_ResourceId(This,value) +#define IPackageId_get_Publisher(This,value) (This)->lpVtbl->get_Publisher(This,value) +#define IPackageId_get_PublisherId(This,value) (This)->lpVtbl->get_PublisherId(This,value) +#define IPackageId_get_FullName(This,value) (This)->lpVtbl->get_FullName(This,value) +#define IPackageId_get_FamilyName(This,value) (This)->lpVtbl->get_FamilyName(This,value) + +/* IPackage */ +typedef struct IPackageVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IPackage *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IPackage *This); + + ULONG (STDMETHODCALLTYPE *Release)( + IPackage *This); + + /*** IInspectable methods ***/ + HRESULT (STDMETHODCALLTYPE *GetIids)( + IPackage *This, + UINT32 *count, + IID **ids); + + HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( + IPackage *This, + HSTRING *className); + + HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( + IPackage *This, + TrustLevel *trustLevel); + + /*** IPackage methods ***/ + HRESULT (STDMETHODCALLTYPE *get_Id)( + IPackage *This, + IPackageId **value); + + HRESULT (STDMETHODCALLTYPE *get_InstalledLocation)( + IPackage *This, + IUnknown **value); + + HRESULT (STDMETHODCALLTYPE *get_IsFramework)( + IPackage *This, + CHAR *value); + + HRESULT (STDMETHODCALLTYPE *get_Dependencies)( + IPackage *This, + void **value); + + END_INTERFACE +} IPackageVtbl; + +interface IPackage { + CONST_VTBL IPackageVtbl* lpVtbl; +}; + +/*** IUnknown methods ***/ +#define IPackage_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IPackage_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IPackage_Release(This) (This)->lpVtbl->Release(This) +/*** IInspectable methods ***/ +#define IPackage_GetIids(This,count,ids) (This)->lpVtbl->GetIids(This,count,ids) +#define IPackage_GetRuntimeClassName(This,name) (This)->lpVtbl->GetRuntimeClassName(This,name) +#define IPackage_GetTrustLevel(This,level) (This)->lpVtbl->GetTrustLevel(This,level) +/*** IPackage methods ***/ +#define IPackage_get_Id(This,value) (This)->lpVtbl->get_Id(This,value) +#define IPackage_get_InstalledLocation(This,value) (This)->lpVtbl->get_InstalledLocation(This,value) +#define IPackage_get_IsFramework(This,value) (This)->lpVtbl->get_IsFramework(This,value) +#define IPackage_get_Dependencies(This,value) (This)->lpVtbl->get_Dependencies(This,value) diff --git a/gio/gwin32api-storage.h b/gio/gwin32api-storage.h new file mode 100755 index 000000000..716a0a7a1 --- /dev/null +++ b/gio/gwin32api-storage.h @@ -0,0 +1,339 @@ +struct DateTime; + +typedef struct DateTime { + UINT64 UniversalTime; +} DateTime; + +/* The following is copied verbatim from MinGW-w64 windows.storage.h */ +enum StorageItemTypes; +enum FileAttributes; +enum NameCollisionOption; +enum StorageDeleteOption; + +typedef enum NameCollisionoption { + NameCollisionoption_GenerateUniqueName = 0, + NameCollisionoption_ReplaceExisting = 1, + NameCollisionoption_FailIfExists = 2 +} NameCollisionOption; + +typedef enum FileAttributes { + FileAttributes_Normal = 0, + FileAttributes_ReadOnly = 1, + FileAttributes_Directory = 2, + FileAttributes_Archive = 3, + FileAttributes_Temporary = 4 +} FileAttributes; + +typedef enum StorageItemTypes { + StorageItemTypes_None = 0, + StorageItemTypes_File = 1, + StorageItemTypes_Folder = 2 +} StorageItemTypes; + +typedef enum StorageDeleteOption { + StorageDeleteOption_Default = 0, + StorageDeleteOption_PermanentDelete = 1 +} StorageDeleteOption; + +#ifndef __IStorageItem_FWD_DEFINED__ +#define __IStorageItem_FWD_DEFINED__ +typedef interface IStorageItem IStorageItem; +#endif + +/* + * IStorageItem interface + */ +#ifndef __IStorageItem_INTERFACE_DEFINED__ +#define __IStorageItem_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_IStorageItem, 0x4207a996, 0xca2f, 0x42f7, 0xbd,0xe8, 0x8b,0x10,0x45,0x7a,0x7f,0x30); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("4207a996-ca2f-42f7-bde8-8b10457a7f30") +IStorageItem : public IInspectable +{ + virtual HRESULT STDMETHODCALLTYPE RenameAsyncOverloadDefaultOptions( + HSTRING desiredName, + IInspectable **action) = 0; + + virtual HRESULT STDMETHODCALLTYPE RenameAsync( + HSTRING desiredName, + NameCollisionOption option, + IInspectable **action) = 0; + + virtual HRESULT STDMETHODCALLTYPE DeleteAsyncOverloadDefaultOptions( + IInspectable **action) = 0; + + virtual HRESULT STDMETHODCALLTYPE DeleteAsync( + StorageDeleteOption option, + IInspectable **action) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBasicPropertiesAsync( + IInspectable **action) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_Name( + HSTRING *value) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_Path( + HSTRING *value) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_Attributes( + FileAttributes *value) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_DateCreated( + DateTime *value) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsOfType( + StorageItemTypes itemType, + boolean *value) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(IStorageItem, 0x4207a996, 0xca2f, 0x42f7, 0xbd,0xe8, 0x8b,0x10,0x45,0x7a,0x7f,0x30) +#endif +#else +typedef struct IStorageItemVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IStorageItem* This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IStorageItem* This); + + ULONG (STDMETHODCALLTYPE *Release)( + IStorageItem* This); + + /*** IInspectable methods ***/ + HRESULT (STDMETHODCALLTYPE *GetIids)( + IStorageItem* This, + ULONG *iidCount, + IID **iids); + + HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)( + IStorageItem* This, + HSTRING *className); + + HRESULT (STDMETHODCALLTYPE *GetTrustLevel)( + IStorageItem* This, + TrustLevel *trustLevel); + + /*** IStorageItem methods ***/ + HRESULT (STDMETHODCALLTYPE *RenameAsyncOverloadDefaultOptions)( + IStorageItem* This, + HSTRING desiredName, + IInspectable **action); + + HRESULT (STDMETHODCALLTYPE *RenameAsync)( + IStorageItem* This, + HSTRING desiredName, + NameCollisionOption option, + IInspectable **action); + + HRESULT (STDMETHODCALLTYPE *DeleteAsyncOverloadDefaultOptions)( + IStorageItem* This, + IInspectable **action); + + HRESULT (STDMETHODCALLTYPE *DeleteAsync)( + IStorageItem* This, + StorageDeleteOption option, + IInspectable **action); + + HRESULT (STDMETHODCALLTYPE *GetBasicPropertiesAsync)( + IStorageItem* This, + IInspectable **action); + + HRESULT (STDMETHODCALLTYPE *get_Name)( + IStorageItem* This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_Path)( + IStorageItem* This, + HSTRING *value); + + HRESULT (STDMETHODCALLTYPE *get_Attributes)( + IStorageItem* This, + FileAttributes *value); + + HRESULT (STDMETHODCALLTYPE *get_DateCreated)( + IStorageItem* This, + DateTime *value); + + HRESULT (STDMETHODCALLTYPE *IsOfType)( + IStorageItem* This, + StorageItemTypes itemType, + boolean *value); + + END_INTERFACE +} IStorageItemVtbl; +interface IStorageItem { + CONST_VTBL IStorageItemVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define IStorageItem_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define IStorageItem_AddRef(This) (This)->lpVtbl->AddRef(This) +#define IStorageItem_Release(This) (This)->lpVtbl->Release(This) +/*** IInspectable methods ***/ +#define IStorageItem_GetIids(This,iidCount,iids) (This)->lpVtbl->GetIids(This,iidCount,iids) +#define IStorageItem_GetRuntimeClassName(This,className) (This)->lpVtbl->GetRuntimeClassName(This,className) +#define IStorageItem_GetTrustLevel(This,trustLevel) (This)->lpVtbl->GetTrustLevel(This,trustLevel) +/*** IStorageItem methods ***/ +#define IStorageItem_RenameAsyncOverloadDefaultOptions(This,desiredName,action) (This)->lpVtbl->RenameAsyncOverloadDefaultOptions(This,desiredName,action) +#define IStorageItem_RenameAsync(This,desiredName,option,action) (This)->lpVtbl->RenameAsync(This,desiredName,option,action) +#define IStorageItem_DeleteAsyncOverloadDefaultOptions(This,action) (This)->lpVtbl->DeleteAsyncOverloadDefaultOptions(This,action) +#define IStorageItem_DeleteAsync(This,option,action) (This)->lpVtbl->DeleteAsync(This,option,action) +#define IStorageItem_GetBasicPropertiesAsync(This,action) (This)->lpVtbl->GetBasicPropertiesAsync(This,action) +#define IStorageItem_get_Name(This,value) (This)->lpVtbl->get_Name(This,value) +#define IStorageItem_get_Path(This,value) (This)->lpVtbl->get_Path(This,value) +#define IStorageItem_get_Attributes(This,value) (This)->lpVtbl->get_Attributes(This,value) +#define IStorageItem_get_DateCreated(This,value) (This)->lpVtbl->get_DateCreated(This,value) +#define IStorageItem_IsOfType(This,itemType,value) (This)->lpVtbl->IsOfType(This,itemType,value) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT IStorageItem_QueryInterface(IStorageItem* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG IStorageItem_AddRef(IStorageItem* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG IStorageItem_Release(IStorageItem* This) { + return This->lpVtbl->Release(This); +} +/*** IInspectable methods ***/ +static FORCEINLINE HRESULT IStorageItem_GetIids(IStorageItem* This,ULONG *iidCount,IID **iids) { + return This->lpVtbl->GetIids(This,iidCount,iids); +} +static FORCEINLINE HRESULT IStorageItem_GetRuntimeClassName(IStorageItem* This,HSTRING *className) { + return This->lpVtbl->GetRuntimeClassName(This,className); +} +static FORCEINLINE HRESULT IStorageItem_GetTrustLevel(IStorageItem* This,TrustLevel *trustLevel) { + return This->lpVtbl->GetTrustLevel(This,trustLevel); +} +/*** IStorageItem methods ***/ +static FORCEINLINE HRESULT IStorageItem_RenameAsyncOverloadDefaultOptions(IStorageItem* This,HSTRING desiredName,IInspectable **action) { + return This->lpVtbl->RenameAsyncOverloadDefaultOptions(This,desiredName,action); +} +static FORCEINLINE HRESULT IStorageItem_RenameAsync(IStorageItem* This,HSTRING desiredName,NameCollisionOption option,IInspectable **action) { + return This->lpVtbl->RenameAsync(This,desiredName,option,action); +} +static FORCEINLINE HRESULT IStorageItem_DeleteAsyncOverloadDefaultOptions(IStorageItem* This,IInspectable **action) { + return This->lpVtbl->DeleteAsyncOverloadDefaultOptions(This,action); +} +static FORCEINLINE HRESULT IStorageItem_DeleteAsync(IStorageItem* This,StorageDeleteOption option,IInspectable **action) { + return This->lpVtbl->DeleteAsync(This,option,action); +} +static FORCEINLINE HRESULT IStorageItem_GetBasicPropertiesAsync(IStorageItem* This,IInspectable **action) { + return This->lpVtbl->GetBasicPropertiesAsync(This,action); +} +static FORCEINLINE HRESULT IStorageItem_get_Name(IStorageItem* This,HSTRING *value) { + return This->lpVtbl->get_Name(This,value); +} +static FORCEINLINE HRESULT IStorageItem_get_Path(IStorageItem* This,HSTRING *value) { + return This->lpVtbl->get_Path(This,value); +} +static FORCEINLINE HRESULT IStorageItem_get_Attributes(IStorageItem* This,FileAttributes *value) { + return This->lpVtbl->get_Attributes(This,value); +} +static FORCEINLINE HRESULT IStorageItem_get_DateCreated(IStorageItem* This,DateTime *value) { + return This->lpVtbl->get_DateCreated(This,value); +} +static FORCEINLINE HRESULT IStorageItem_IsOfType(IStorageItem* This,StorageItemTypes itemType,boolean *value) { + return This->lpVtbl->IsOfType(This,itemType,value); +} +#endif +#endif + +#endif + +HRESULT STDMETHODCALLTYPE IStorageItem_RenameAsyncOverloadDefaultOptions_Proxy( + IStorageItem* This, + HSTRING desiredName, + IInspectable **action); +void __RPC_STUB IStorageItem_RenameAsyncOverloadDefaultOptions_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_RenameAsync_Proxy( + IStorageItem* This, + HSTRING desiredName, + NameCollisionOption option, + IInspectable **action); +void __RPC_STUB IStorageItem_RenameAsync_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_DeleteAsyncOverloadDefaultOptions_Proxy( + IStorageItem* This, + IInspectable **action); +void __RPC_STUB IStorageItem_DeleteAsyncOverloadDefaultOptions_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_DeleteAsync_Proxy( + IStorageItem* This, + StorageDeleteOption option, + IInspectable **action); +void __RPC_STUB IStorageItem_DeleteAsync_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_GetBasicPropertiesAsync_Proxy( + IStorageItem* This, + IInspectable **action); +void __RPC_STUB IStorageItem_GetBasicPropertiesAsync_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_get_Name_Proxy( + IStorageItem* This, + HSTRING *value); +void __RPC_STUB IStorageItem_get_Name_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_get_Path_Proxy( + IStorageItem* This, + HSTRING *value); +void __RPC_STUB IStorageItem_get_Path_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_get_Attributes_Proxy( + IStorageItem* This, + FileAttributes *value); +void __RPC_STUB IStorageItem_get_Attributes_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_get_DateCreated_Proxy( + IStorageItem* This, + DateTime *value); +void __RPC_STUB IStorageItem_get_DateCreated_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT STDMETHODCALLTYPE IStorageItem_IsOfType_Proxy( + IStorageItem* This, + StorageItemTypes itemType, + boolean *value); +void __RPC_STUB IStorageItem_IsOfType_Stub( + IRpcStubBuffer* This, + IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); + +#endif /* __IStorageItem_INTERFACE_DEFINED__ */