1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 DEFINE_GUID(CLSID_GPESnapIn,0x8fc0b734,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 7 DEFINE_GUID(NODEID_Machine,0x8fc0b737,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 8 DEFINE_GUID(NODEID_MachineSWSettings,0x8fc0b73a,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 9 DEFINE_GUID(NODEID_User,0x8fc0b738,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 10 DEFINE_GUID(NODEID_UserSWSettings,0x8fc0b73c,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 11 DEFINE_GUID(IID_IGPEInformation,0x8fc0b735,0xa0e1,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 12 DEFINE_GUID(CLSID_GroupPolicyObject,0xea502722,0xa23d,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 13 DEFINE_GUID(IID_IGroupPolicyObject,0xea502723,0xa23d,0x11d1,0xa7,0xd3,0x0,0x0,0xf8,0x75,0x71,0xe3); 14 #define REGISTRY_EXTENSION_GUID { 0x35378EAC,0x683F,0x11D2,0xA8,0x9A,0x00,0xC0,0x4F,0xBB,0xCF,0xA2 } 15 DEFINE_GUID(CLSID_RSOPSnapIn,0x6dc3804b,0x7212,0x458d,0xad,0xb0,0x9a,0x07,0xe2,0xae,0x1f,0xa2); 16 DEFINE_GUID(NODEID_RSOPMachine,0xbd4c1a2e,0x0b7a,0x4a62,0xa6,0xb0,0xc0,0x57,0x75,0x39,0xc9,0x7e); 17 DEFINE_GUID(NODEID_RSOPMachineSWSettings,0x6a76273e,0xeb8e,0x45db,0x94,0xc5,0x25,0x66,0x3a,0x5f,0x2c,0x1a); 18 DEFINE_GUID(NODEID_RSOPUser,0xab87364f,0x0cec,0x4cd8,0x9b,0xf8,0x89,0x8f,0x34,0x62,0x8f,0xb8); 19 DEFINE_GUID(NODEID_RSOPUserSWSettings,0xe52c5ce3,0xfd27,0x4402,0x84,0xde,0xd9,0xa5,0xf2,0x85,0x89,0x10); 20 DEFINE_GUID(IID_IRSOPInformation,0x9a5a81b5,0xd9c7,0x49ef,0x9d,0x11,0xdd,0xf5,0x09,0x68,0xc4,0x8d); 21 22 #ifndef _GPEDIT_H_ 23 #define _GPEDIT_H_ 24 25 #ifndef _GPEDIT_ 26 #define GPEDITAPI DECLSPEC_IMPORT 27 #else 28 #define GPEDITAPI 29 #endif 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 #include <objbase.h> 36 37 #define GPO_SECTION_ROOT 0 38 #define GPO_SECTION_USER 1 39 #define GPO_SECTION_MACHINE 2 40 41 typedef enum _GROUP_POLICY_OBJECT_TYPE { 42 GPOTypeLocal = 0,GPOTypeRemote,GPOTypeDS 43 } GROUP_POLICY_OBJECT_TYPE,*PGROUP_POLICY_OBJECT_TYPE; 44 45 typedef enum _GROUP_POLICY_HINT_TYPE { 46 GPHintUnknown = 0,GPHintMachine,GPHintSite,GPHintDomain,GPHintOrganizationalUnit 47 } GROUP_POLICY_HINT_TYPE,*PGROUP_POLICY_HINT_TYPE; 48 49 #undef INTERFACE 50 #define INTERFACE IGPEInformation 51 DECLARE_INTERFACE_(IGPEInformation,IUnknown) { 52 STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE; 53 STDMETHOD_(ULONG,AddRef) (THIS) PURE; 54 STDMETHOD_(ULONG,Release) (THIS) PURE; 55 STDMETHOD(GetName) (THIS_ LPOLESTR pszName,int cchMaxLength) PURE; 56 STDMETHOD(GetDisplayName) (THIS_ LPOLESTR pszName,int cchMaxLength) PURE; 57 STDMETHOD(GetRegistryKey) (THIS_ DWORD dwSection,HKEY *hKey) PURE; 58 STDMETHOD(GetDSPath) (THIS_ DWORD dwSection,LPOLESTR pszPath,int cchMaxPath) PURE; 59 STDMETHOD(GetFileSysPath) (THIS_ DWORD dwSection,LPOLESTR pszPath,int cchMaxPath) PURE; 60 STDMETHOD(GetOptions) (THIS_ DWORD *dwOptions) PURE; 61 STDMETHOD(GetType) (THIS_ GROUP_POLICY_OBJECT_TYPE *gpoType) PURE; 62 STDMETHOD(GetHint) (THIS_ GROUP_POLICY_HINT_TYPE *gpHint) PURE; 63 STDMETHOD(PolicyChanged) (THIS_ WINBOOL bMachine,WINBOOL bAdd,GUID *pGuidExtension,GUID *pGuidSnapin) PURE; 64 }; 65 typedef IGPEInformation *LPGPEINFORMATION; 66 67 #define GPO_OPEN_LOAD_REGISTRY 0x00000001 68 #define GPO_OPEN_READ_ONLY 0x00000002 69 70 #define GPO_OPTION_DISABLE_USER 0x00000001 71 #define GPO_OPTION_DISABLE_MACHINE 0x00000002 72 73 #undef INTERFACE 74 #define INTERFACE IGroupPolicyObject 75 DECLARE_INTERFACE_(IGroupPolicyObject,IUnknown) { 76 STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE; 77 STDMETHOD_(ULONG,AddRef) (THIS) PURE; 78 STDMETHOD_(ULONG,Release) (THIS) PURE; 79 STDMETHOD(New) (THIS_ LPOLESTR pszDomainName,LPOLESTR pszDisplayName,DWORD dwFlags) PURE; 80 STDMETHOD(OpenDSGPO) (THIS_ LPOLESTR pszPath,DWORD dwFlags) PURE; 81 STDMETHOD(OpenLocalMachineGPO) (THIS_ DWORD dwFlags) PURE; 82 STDMETHOD(OpenRemoteMachineGPO) (THIS_ LPOLESTR pszComputerName,DWORD dwFlags) PURE; 83 STDMETHOD(Save) (THIS_ WINBOOL bMachine,WINBOOL bAdd,GUID *pGuidExtension,GUID *pGuid) PURE; 84 STDMETHOD(Delete) (THIS) PURE; 85 STDMETHOD(GetName) (THIS_ LPOLESTR pszName,int cchMaxLength) PURE; 86 STDMETHOD(GetDisplayName) (THIS_ LPOLESTR pszName,int cchMaxLength) PURE; 87 STDMETHOD(SetDisplayName) (THIS_ LPOLESTR pszName) PURE; 88 STDMETHOD(GetPath) (THIS_ LPOLESTR pszPath,int cchMaxPath) PURE; 89 STDMETHOD(GetDSPath) (THIS_ DWORD dwSection,LPOLESTR pszPath,int cchMaxPath) PURE; 90 STDMETHOD(GetFileSysPath) (THIS_ DWORD dwSection,LPOLESTR pszPath,int cchMaxPath) PURE; 91 STDMETHOD(GetRegistryKey) (THIS_ DWORD dwSection,HKEY *hKey) PURE; 92 STDMETHOD(GetOptions) (THIS_ DWORD *dwOptions) PURE; 93 STDMETHOD(SetOptions) (THIS_ DWORD dwOptions,DWORD dwMask) PURE; 94 STDMETHOD(GetType) (THIS_ GROUP_POLICY_OBJECT_TYPE *gpoType) PURE; 95 STDMETHOD(GetMachineName) (THIS_ LPOLESTR pszName,int cchMaxLength) PURE; 96 STDMETHOD(GetPropertySheetPages) (THIS_ HPROPSHEETPAGE **hPages,UINT *uPageCount) PURE; 97 }; 98 typedef IGroupPolicyObject *LPGROUPPOLICYOBJECT; 99 100 #define RSOP_INFO_FLAG_DIAGNOSTIC_MODE 0x00000001 101 102 #undef INTERFACE 103 #define INTERFACE IRSOPInformation 104 DECLARE_INTERFACE_(IRSOPInformation,IUnknown) { 105 STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE; 106 STDMETHOD_(ULONG,AddRef) (THIS) PURE; 107 STDMETHOD_(ULONG,Release) (THIS) PURE; 108 STDMETHOD(GetNamespace) (THIS_ DWORD dwSection,LPOLESTR pszName,int cchMaxLength) PURE; 109 STDMETHOD(GetFlags) (THIS_ DWORD *pdwFlags) PURE; 110 STDMETHOD(GetEventLogEntryText) (THIS_ LPOLESTR pszEventSource,LPOLESTR pszEventLogName,LPOLESTR pszEventTime,DWORD dwEventID,LPOLESTR *ppszText) PURE; 111 }; 112 typedef IRSOPInformation *LPRSOPINFORMATION; 113 114 GPEDITAPI HRESULT WINAPI CreateGPOLink(LPOLESTR lpGPO,LPOLESTR lpContainer,WINBOOL fHighPriority); 115 GPEDITAPI HRESULT WINAPI DeleteGPOLink(LPOLESTR lpGPO,LPOLESTR lpContainer); 116 GPEDITAPI HRESULT WINAPI DeleteAllGPOLinks(LPOLESTR lpContainer); 117 118 #define GPO_BROWSE_DISABLENEW 0x00000001 119 #define GPO_BROWSE_NOCOMPUTERS 0x00000002 120 #define GPO_BROWSE_NODSGPOS 0x00000004 121 #define GPO_BROWSE_OPENBUTTON 0x00000008 122 #define GPO_BROWSE_INITTOALL 0x00000010 123 124 typedef struct tag_GPOBROWSEINFO { 125 DWORD dwSize; 126 DWORD dwFlags; 127 HWND hwndOwner; 128 LPOLESTR lpTitle; 129 LPOLESTR lpInitialOU; 130 LPOLESTR lpDSPath; 131 DWORD dwDSPathSize; 132 LPOLESTR lpName; 133 DWORD dwNameSize; 134 GROUP_POLICY_OBJECT_TYPE gpoType; 135 GROUP_POLICY_HINT_TYPE gpoHint; 136 } GPOBROWSEINFO,*LPGPOBROWSEINFO; 137 138 GPEDITAPI HRESULT WINAPI BrowseForGPO(LPGPOBROWSEINFO lpBrowseInfo); 139 GPEDITAPI HRESULT WINAPI ImportRSoPData(LPOLESTR lpNameSpace,LPOLESTR lpFileName); 140 GPEDITAPI HRESULT WINAPI ExportRSoPData(LPOLESTR lpNameSpace,LPOLESTR lpFileName); 141 142 #ifdef __cplusplus 143 } 144 #endif 145 #endif 146