Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

840 lines
25 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // GPEDIT.H - Definitions and prototypes for Group Policy
  4. //
  5. // Copyright 1997-2000, Microsoft Corporation
  6. //
  7. //-----------------------------------------------------------------------------
  8. //
  9. // Terminology
  10. //
  11. // Group Policy Editor - The tool to view a Group Policy Object.
  12. //
  13. // Group Policy Object - A collection of administrator defined policies.
  14. // Each Group Policy Object (GPO) has both file system
  15. // and Active Directory storage available to it.
  16. //
  17. // IGPEInformation - The interface MMC Snapin Extensions use to
  18. // talk to the Group Policy Editor.
  19. //
  20. // IGroupPolicyObject - The interface used to create/edit a GPO directly
  21. // without going through the Group Policy Editor
  22. //
  23. //
  24. // Group Policy Editor MMC SnapIn GUID
  25. //
  26. // {8FC0B734-A0E1-11d1-A7D3-0000F87571E3}
  27. DEFINE_GUID(CLSID_GPESnapIn, 0x8fc0b734, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  28. //
  29. // Group Policy Editor node ids
  30. //
  31. //
  32. // Computer Configuration\Windows Settings
  33. // {8FC0B737-A0E1-11d1-A7D3-0000F87571E3}
  34. //
  35. DEFINE_GUID(NODEID_Machine, 0x8fc0b737, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  36. //
  37. // Computer Configuration\Software Settings
  38. // {8FC0B73A-A0E1-11d1-A7D3-0000F87571E3}
  39. //
  40. DEFINE_GUID(NODEID_MachineSWSettings, 0x8fc0b73a, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  41. //
  42. // User Configuration\Windows Settings
  43. // {8FC0B738-A0E1-11d1-A7D3-0000F87571E3}
  44. //
  45. DEFINE_GUID(NODEID_User, 0x8fc0b738, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  46. //
  47. // User Configuration\Software Settings
  48. // {8FC0B73C-A0E1-11d1-A7D3-0000F87571E3}
  49. //
  50. DEFINE_GUID(NODEID_UserSWSettings, 0x8fc0b73c, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  51. //
  52. // IGPEInformation interface id
  53. //
  54. // {8FC0B735-A0E1-11d1-A7D3-0000F87571E3}
  55. DEFINE_GUID(IID_IGPEInformation, 0x8fc0b735, 0xa0e1, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  56. //
  57. // Group Policy Object class id
  58. //
  59. // {EA502722-A23D-11d1-A7D3-0000F87571E3}
  60. DEFINE_GUID(CLSID_GroupPolicyObject, 0xea502722, 0xa23d, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  61. //
  62. // Group Policy Object interface id
  63. //
  64. // {EA502723-A23D-11d1-A7D3-0000F87571E3}
  65. DEFINE_GUID(IID_IGroupPolicyObject, 0xea502723, 0xa23d, 0x11d1, 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3);
  66. //
  67. // GUID that identifies the registry extension
  68. //
  69. #define REGISTRY_EXTENSION_GUID { 0x35378EAC, 0x683F, 0x11D2, 0xA8, 0x9A, 0x00, 0xC0, 0x4F, 0xBB, 0xCF, 0xA2 }
  70. //========================================================================================
  71. //
  72. // Resultant Set of Policy node ids
  73. //
  74. //========================================================================================
  75. //
  76. // Resultant Set of Policy MMC SnapIn GUID
  77. //
  78. // {6DC3804B-7212-458D-ADB0-9A07E2AE1FA2}
  79. DEFINE_GUID(CLSID_RSOPSnapIn, 0x6dc3804b, 0x7212, 0x458d, 0xad, 0xb0, 0x9a, 0x07, 0xe2, 0xae, 0x1f, 0xa2);
  80. //
  81. // Computer Configuration\Windows Settings
  82. // {BD4C1A2E-0B7A-4A62-A6B0-C0577539C97E}
  83. //
  84. DEFINE_GUID(NODEID_RSOPMachine, 0xbd4c1a2e, 0x0b7a, 0x4a62, 0xa6, 0xb0, 0xc0, 0x57, 0x75, 0x39, 0xc9, 0x7e);
  85. //
  86. // Computer Configuration\Software Settings
  87. // {6A76273E-EB8E-45DB-94C5-25663A5f2C1A}
  88. //
  89. DEFINE_GUID(NODEID_RSOPMachineSWSettings, 0x6a76273e, 0xeb8e, 0x45db, 0x94, 0xc5, 0x25, 0x66, 0x3a, 0x5f, 0x2c, 0x1a);
  90. //
  91. // User Configuration\Windows Settings
  92. // {AB87364F-0CEC-4CD8-9BF8-898F34628FB8}
  93. //
  94. DEFINE_GUID(NODEID_RSOPUser, 0xab87364f, 0x0cec, 0x4cd8, 0x9b, 0xf8, 0x89, 0x8f, 0x34, 0x62, 0x8f, 0xb8);
  95. //
  96. // User Configuration\Software Settings
  97. // {E52C5CE3-FD27-4402-84DE-D9A5F2858910}
  98. //
  99. DEFINE_GUID(NODEID_RSOPUserSWSettings, 0xe52c5ce3, 0xfd27, 0x4402, 0x84, 0xde, 0xd9, 0xa5, 0xf2, 0x85, 0x89, 0x10);
  100. //
  101. // IRSOPInformation interface id
  102. //
  103. // {9A5A81B5-D9C7-49EF-9D11-DDF50968C48D}
  104. DEFINE_GUID(IID_IRSOPInformation, 0x9a5a81b5, 0xd9c7, 0x49ef, 0x9d, 0x11, 0xdd, 0xf5, 0x09, 0x68, 0xc4, 0x8d);
  105. #ifndef _GPEDIT_H_
  106. #define _GPEDIT_H_
  107. //
  108. // Define API decoration for direct importing of DLL references.
  109. //
  110. #if !defined(_GPEDIT_)
  111. #define GPEDITAPI DECLSPEC_IMPORT
  112. #else
  113. #define GPEDITAPI
  114. #endif
  115. #ifdef __cplusplus
  116. extern "C" {
  117. #endif
  118. #include <objbase.h>
  119. //
  120. // Group Policy Object Section flags
  121. //
  122. #define GPO_SECTION_ROOT 0 // Root
  123. #define GPO_SECTION_USER 1 // User
  124. #define GPO_SECTION_MACHINE 2 // Machine
  125. //
  126. // Group Policy Object types
  127. //
  128. typedef enum _GROUP_POLICY_OBJECT_TYPE {
  129. GPOTypeLocal = 0, // GPO on the local machine
  130. GPOTypeRemote, // GPO on a remote machine
  131. GPOTypeDS // GPO in the Active Directory
  132. } GROUP_POLICY_OBJECT_TYPE, *PGROUP_POLICY_OBJECT_TYPE;
  133. //
  134. // Group Policy Hint types
  135. //
  136. typedef enum _GROUP_POLICY_HINT_TYPE {
  137. GPHintUnknown = 0, // No link information available
  138. GPHintMachine, // GPO linked to a machine (local or remote)
  139. GPHintSite, // GPO linked to a site
  140. GPHintDomain, // GPO linked to a domain
  141. GPHintOrganizationalUnit, // GPO linked to a organizational unit
  142. } GROUP_POLICY_HINT_TYPE, *PGROUP_POLICY_HINT_TYPE;
  143. #undef INTERFACE
  144. #define INTERFACE IGPEInformation
  145. DECLARE_INTERFACE_(IGPEInformation, IUnknown)
  146. {
  147. // *** IUnknown methods ***
  148. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  149. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  150. STDMETHOD_(ULONG,Release) (THIS) PURE;
  151. // *** IGPEInformation methods ***
  152. //
  153. // Returns the unique Group Policy Object name (a GUID)
  154. //
  155. // pszName contains the name on return
  156. // cchMaxLength is the max number of characters that can be stored in pszName
  157. //
  158. STDMETHOD(GetName) (THIS_ LPOLESTR pszName, int cchMaxLength) PURE;
  159. //
  160. // Returns the friendly display name for this Group Policy Object
  161. //
  162. // pszName contains the name on return
  163. // cchMaxLength is the max number of characters that can be stored in pszName
  164. //
  165. STDMETHOD(GetDisplayName) (THIS_ LPOLESTR pszName, int cchMaxLength) PURE;
  166. //
  167. // Returns a registry key handle for the requested section. The returned
  168. // key is the root of the registry, not the Policies subkey. To set / read
  169. // a value in the Policies subkey, you will need to call RegOpenKeyEx to
  170. // open Software\Policies subkey first.
  171. //
  172. // The handle has been opened with ALL ACCESS rights. Call RegCloseKey
  173. // on the handle when finished.
  174. //
  175. // dwSection is either GPO_SECTION_USER or GPO_SECTION_MACHINE
  176. // hKey contains the registry key on return
  177. //
  178. STDMETHOD(GetRegistryKey) (THIS_ DWORD dwSection, HKEY *hKey) PURE;
  179. //
  180. // Returns the Active Directory path to the root of the request section.
  181. // The path is in ADSI name format.
  182. //
  183. // dwSection is one of the GPO_SECTION_* flags
  184. // pszPath contains the path on return
  185. // cchMaxPath is the max number of characters that can be stored in pszPath
  186. //
  187. STDMETHOD(GetDSPath) (THIS_ DWORD dwSection, LPOLESTR pszPath, int cchMaxPath) PURE;
  188. //
  189. // Returns the UNC path to the root of the requested section.
  190. //
  191. // dwSection is one of the GPO_SECTION_* flags
  192. // pszPath contains the path on return
  193. // cchMaxPath is the number of characters that can be stored in pszPath.
  194. //
  195. STDMETHOD(GetFileSysPath) (THIS_ DWORD dwSection, LPOLESTR pszPath, int cchMaxPath) PURE;
  196. //
  197. // Returns the user preferences (options)
  198. //
  199. // Currently, there are no options defined. This is reserved for future use.
  200. //
  201. // dwOptions receives a bitmask value
  202. //
  203. STDMETHOD(GetOptions) (THIS_ DWORD *dwOptions) PURE;
  204. //
  205. // Returns the type of GPO being edited.
  206. //
  207. // The three types are: a GPO in the Active Directory, the GPO on the local machine,
  208. // and the GPO on a remote machine.
  209. //
  210. // Machine GPOs only have file system storage (no Active Directory storage available).
  211. // If GetDSPath is called for a machine GPO, the function will succeed
  212. // and the returned buffer will be the empty string ""
  213. //
  214. // Active Directory GPOs have both file system and Active Directory storage available to them.
  215. //
  216. // gpoType receives one of the type flags listed above.
  217. //
  218. STDMETHOD(GetType) (THIS_ GROUP_POLICY_OBJECT_TYPE *gpoType) PURE;
  219. //
  220. // Returns the type of Active Directory object (or machine) that could be linked to
  221. // this GPO
  222. //
  223. // This is a hint api only. The GPE does not know which Active Directory objects are
  224. // linked to a particular GPO, but it can offer a hint based upon how the
  225. // user started the GPE.
  226. //
  227. // Use this method with great caution. Some extensions might want to
  228. // customize their user interface based upon the scoping for this GPO,
  229. // but it is easy to offer the wrong namespace. Best advice is to
  230. // always offer your full user interface, but if you choose to use this
  231. // method, always offer your full user interface if you recieve the
  232. // unknown hint back.
  233. //
  234. // gpHint receives one of the hint flags listed above.
  235. //
  236. STDMETHOD(GetHint) (THIS_ GROUP_POLICY_HINT_TYPE *gpHint) PURE;
  237. //
  238. // Informs the Group Policy Editor that policy settings have changed.
  239. // Extensions MUST call this methold every time a change is made
  240. // to a Group Policy Object.
  241. //
  242. // bMachine specifies if machine or user policy has changed.
  243. // bAdd specifies whether this is an add or delete.
  244. // pGuidExtension is the guid or unique name of extension that
  245. // will process this GPO.
  246. // pGuidSnapin is the guid or unique name of snapin that is making
  247. // this call
  248. //
  249. STDMETHOD(PolicyChanged) (THIS_ BOOL bMachine, BOOL bAdd, GUID *pGuidExtension, GUID *pGuidSnapin ) PURE;
  250. };
  251. typedef IGPEInformation *LPGPEINFORMATION;
  252. //
  253. // Group Policy Object open / creation flags
  254. //
  255. #define GPO_OPEN_LOAD_REGISTRY 0x00000001 // Load the registry files
  256. #define GPO_OPEN_READ_ONLY 0x00000002 // Open the GPO as read only
  257. //
  258. // Group Policy Object option flags
  259. //
  260. #define GPO_OPTION_DISABLE_USER 0x00000001 // The user portion of this GPO is disabled
  261. #define GPO_OPTION_DISABLE_MACHINE 0x00000002 // The machine portion of this GPO is disabled
  262. #undef INTERFACE
  263. #define INTERFACE IGroupPolicyObject
  264. DECLARE_INTERFACE_(IGroupPolicyObject, IUnknown)
  265. {
  266. // *** IUnknown methods ***
  267. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  268. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  269. STDMETHOD_(ULONG,Release) (THIS) PURE;
  270. // *** IGroupPolicyObject methods ***
  271. //
  272. // Creates a new GPO in the Active Directory with the given friendly name
  273. // and opens it via OpenDSGPO(). If pszDomainName contains a domain
  274. // controller name, the GPO will be created on that DC. If it does not
  275. // specify a domain controller name, the method will select a DC on
  276. // the callers behalf.
  277. //
  278. // pszDomainName contains the ADSI path of the domain root
  279. // pszDisplayName contains the friendly display name
  280. // dwFlags is a bitmask of GPO open / creation flags listed above
  281. //
  282. STDMETHOD(New) (THIS_ LPOLESTR pszDomainName, LPOLESTR pszDisplayName,
  283. DWORD dwFlags) PURE;
  284. //
  285. // Opens the specified Group Policy Object in the Active Directory
  286. // based upon the passed in flags. If pszPath contains a domain
  287. // controller name, the GPO will be opened on that DC. If it does
  288. // not contain a domain controller name, the method will select a
  289. // DC on the callers behalf. If the registry is not loaded,
  290. // GetRegistryKey() will return E_FAIL.
  291. //
  292. // pszPath contains the ADSI path to the GPO to open
  293. // dwFlags is a bitmask of GPO open / creation flags listed above
  294. //
  295. STDMETHOD(OpenDSGPO) (THIS_ LPOLESTR pszPath, DWORD dwFlags) PURE;
  296. //
  297. // Opens the default Group Policy Object on this machine with the
  298. // dwFlags options listed above. If the registry is not loaded,
  299. // GetRegistryKey() will return E_FAIL.
  300. //
  301. // dwFlags is a bitmask of GPO open / creation flags listed above
  302. //
  303. STDMETHOD(OpenLocalMachineGPO) (THIS_ DWORD dwFlags) PURE;
  304. //
  305. // Opens the default Group Policy Object on a remote machine with the
  306. // dwFlags options listed above. If the registry is not loaded,
  307. // GetRegistryKey() will return E_FAIL.
  308. //
  309. // pszComputerName contains the machine name in \\machine format
  310. // dwFlags is a bitmask of GPO open / creation flags listed above
  311. //
  312. STDMETHOD(OpenRemoteMachineGPO) (THIS_ LPOLESTR pszComputerName, DWORD dwFlags) PURE;
  313. //
  314. // Flushes the registry settings to disk and updates the revision
  315. // number of the GPO.
  316. //
  317. // bMachine specifies if machine or user should be saved.
  318. // bAdd specifies whether this is an add or delete.
  319. // pGuidExtension is the guid or unique name of extension that
  320. // will process this GPO.
  321. // pGuid is a guid
  322. //
  323. STDMETHOD(Save) (THIS_ BOOL bMachine, BOOL bAdd, GUID *pGuidExtension, GUID *pGuid ) PURE;
  324. //
  325. // Deletes this Group Policy Object.
  326. //
  327. // After calling this method, no other methods are valid to call
  328. // since the data will have been deleted.
  329. //
  330. STDMETHOD(Delete) (THIS) PURE;
  331. //
  332. // Returns the unique Group Policy Object name
  333. //
  334. // For Active Directory policy objects, this is a GUID
  335. // For the local policy object, it is the string "Local"
  336. // For remote policy objects, it is the computername
  337. //
  338. // pszName contains the name on return
  339. // cchMaxLength is the max number of characters that can be stored in pszName
  340. //
  341. STDMETHOD(GetName) (THIS_ LPOLESTR pszName, int cchMaxLength) PURE;
  342. //
  343. // Returns the friendly display name for this Group Policy Object
  344. //
  345. // pszName contains the name on return
  346. // cchMaxLength is the max number of characters that can be stored in pszName
  347. //
  348. STDMETHOD(GetDisplayName) (THIS_ LPOLESTR pszName, int cchMaxLength) PURE;
  349. //
  350. // Sets the friendly display name for this Group Policy Object
  351. //
  352. // pszName is the new display name
  353. //
  354. STDMETHOD(SetDisplayName) (THIS_ LPOLESTR pszName) PURE;
  355. //
  356. // Returns the path to the Group Policy Object
  357. //
  358. //
  359. // If the GPO is an Active Directory object, the path is in ADSI name format.
  360. // If the GPO is a machine object, it is a file system path
  361. //
  362. // pszPath contains the path on return
  363. // cchMaxPath is the max number of characters that can be stored in pszPath
  364. //
  365. STDMETHOD(GetPath) (THIS_ LPOLESTR pszPath, int cchMaxPath) PURE;
  366. //
  367. // Returns the Active Directory path to the root of the request section.
  368. // The path is in DN name format.
  369. //
  370. // dwSection is one of the GPO_SECTION_* flags
  371. // pszPath contains the path on return
  372. // cchMaxPath is the max number of characters that can be stored in pszPath
  373. //
  374. STDMETHOD(GetDSPath) (THIS_ DWORD dwSection, LPOLESTR pszPath, int cchMaxPath) PURE;
  375. //
  376. // Returns the UNC path to the root of the requested section.
  377. //
  378. // dwSection is one of the GPO_SECTION_* flags
  379. // pszPath contains the path on return
  380. // cchMaxPath is the number of characters that can be stored in pszPath.
  381. //
  382. STDMETHOD(GetFileSysPath) (THIS_ DWORD dwSection, LPOLESTR pszPath, int cchMaxPath) PURE;
  383. //
  384. // Returns a registry key handle for the requested section. The returned
  385. // key is the root of the registry, not the Policies subkey. To set / read
  386. // a value in the Policies subkey, you will need to call RegOpenKeyEx to
  387. // open Software\Policies subkey first.
  388. //
  389. // The handle has been opened with ALL ACCESS rights. Call RegCloseKey
  390. // on the handle when finished.
  391. //
  392. // If the GPO was loaded / created without the registry being loaded
  393. // this method will return E_FAIL.
  394. //
  395. // dwSection is either GPO_SECTION_USER or GPO_SECTION_MACHINE
  396. // hKey contains the registry key on return
  397. //
  398. STDMETHOD(GetRegistryKey) (THIS_ DWORD dwSection, HKEY *hKey) PURE;
  399. //
  400. // Returns any options for this Group Policy Object
  401. //
  402. // dwOptions receives the GPO_OPTION_* flags
  403. //
  404. STDMETHOD(GetOptions) (THIS_ DWORD *dwOptions) PURE;
  405. //
  406. // Sets any options for this Group Policy Object
  407. //
  408. // This method sets any options for this GPO. To change
  409. // an option, that flag must be set in the mask field.
  410. // If the flag is in the mask field, then the dwOptions
  411. // field is read for the current state.
  412. //
  413. // For example: to disable the GPO, make this call
  414. //
  415. // SetOptions (GPO_OPTION_DISABLED, GPO_OPTION_DISABLED);
  416. //
  417. // dwOptions specifies one or more GPO_OPTION_* flags
  418. // dwMask specificies which of the dwOptions to change
  419. //
  420. STDMETHOD(SetOptions) (THIS_ DWORD dwOptions, DWORD dwMask) PURE;
  421. //
  422. // Returns the type of GPO being edited.
  423. //
  424. // The three types are: a GPO in the Active Directory, the GPO on the local machine,
  425. // and the GPO on a remote machine.
  426. //
  427. // Machine GPOs only have file system storage (no Active Directory storage available).
  428. // If GetDSPath is called for a machine GPO, the function will succeed
  429. // and the returned buffer will be the empty string ""
  430. //
  431. // Active Directory GPOs have both file system and Active Directory storage available to them.
  432. //
  433. // gpoType receives one of the type flags
  434. //
  435. STDMETHOD(GetType) (THIS_ GROUP_POLICY_OBJECT_TYPE *gpoType) PURE;
  436. //
  437. // Returns the machine name of the remote GPO
  438. //
  439. // This method returns the name passed to OpenRemoteMachineGPO.
  440. //
  441. // pszName contains the name on return
  442. // cchMaxLength is the max number of characters that can be stored in pszName
  443. //
  444. STDMETHOD(GetMachineName) (THIS_ LPOLESTR pszName, int cchMaxLength) PURE;
  445. //
  446. // Returns an array of property sheet pages and the number of pages
  447. // in the array
  448. //
  449. // Note, this method will allocate memory for the array with
  450. // LocalAlloc. When finished, the caller should free the array
  451. // with LocalFree
  452. //
  453. // hPages address of the pointer for the array of property sheet pages
  454. // uPageCount receives the number of pages in the array
  455. //
  456. STDMETHOD(GetPropertySheetPages) (THIS_ HPROPSHEETPAGE **hPages, UINT *uPageCount) PURE;
  457. };
  458. typedef IGroupPolicyObject *LPGROUPPOLICYOBJECT;
  459. //
  460. // RSOP flags
  461. //
  462. #define RSOP_INFO_FLAG_DIAGNOSTIC_MODE 0x00000001 // Running in diagnostic mode vs planning mode
  463. #undef INTERFACE
  464. #define INTERFACE IRSOPInformation
  465. DECLARE_INTERFACE_(IRSOPInformation, IUnknown)
  466. {
  467. // *** IUnknown methods ***
  468. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  469. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  470. STDMETHOD_(ULONG,Release) (THIS) PURE;
  471. // *** IRSOPInformation methods ***
  472. //
  473. // Returns the namespace for the RSOP data
  474. //
  475. // dwSection is either GPO_SECTION_USER or GPO_SECTION_MACHINE
  476. // pszName contains the namespace on return
  477. // cchMaxLength is the max number of characters that can be stored in pszName
  478. //
  479. STDMETHOD(GetNamespace) (THIS_ DWORD dwSection, LPOLESTR pszName, int cchMaxLength) PURE;
  480. //
  481. // Returns information about the RSOP session
  482. //
  483. // pdwFlags points to a DWORD which contains the flags on return
  484. //
  485. STDMETHOD(GetFlags) (THIS_ DWORD * pdwFlags) PURE;
  486. //
  487. // Returns the event log text for a specific entry
  488. //
  489. // lpEventSource - event log source name
  490. // lpEventLogName - event log name
  491. // lpEventTime - event log time in WMI datetime format
  492. // dwEventID - event ID
  493. // lpText - Receives a pointer to a buffer containing the text.
  494. // The caller should free this buffer with CoTaskMemFree.
  495. //
  496. STDMETHOD(GetEventLogEntryText) (THIS_ LPOLESTR pszEventSource, LPOLESTR pszEventLogName,
  497. LPOLESTR pszEventTime, DWORD dwEventID, LPOLESTR *ppszText) PURE;
  498. };
  499. typedef IRSOPInformation *LPRSOPINFORMATION;
  500. //=============================================================================
  501. //
  502. // CreateGPOLink
  503. //
  504. // Creates a link to a GPO for the specified Site, Domain, or Organizational Unit
  505. //
  506. // lpGPO - ADSI path to the GPO
  507. // lpContainer - ADSI path to the Site, Domain, or Organizational Unit
  508. // fHighPriority - Create the link as the highest or lowest priority
  509. //
  510. // Returns: S_OK if successful
  511. //
  512. //=============================================================================
  513. GPEDITAPI
  514. HRESULT
  515. WINAPI
  516. CreateGPOLink(
  517. LPOLESTR lpGPO,
  518. LPOLESTR lpContainer,
  519. BOOL fHighPriority);
  520. //=============================================================================
  521. //
  522. // DeleteGPOLink
  523. //
  524. // Deletes a link to a GPO for the specified Site, Domain, or Organizational Unit
  525. //
  526. // lpGPO - ADSI path to the GPO
  527. // lpContainer - ADSI path to the Site, Domain, or Organizational Unit
  528. //
  529. // Returns: S_OK if successful
  530. //
  531. //=============================================================================
  532. GPEDITAPI
  533. HRESULT
  534. WINAPI
  535. DeleteGPOLink(
  536. LPOLESTR lpGPO,
  537. LPOLESTR lpContainer);
  538. //=============================================================================
  539. //
  540. // DeleteAllGPOLinks
  541. //
  542. // Deletes all GPO links for the specified Site, Domain, or Organizational Unit
  543. //
  544. // lpContainer - ADSI path to the Site, Domain, or Organizational Unit
  545. //
  546. // Returns: S_OK if successful
  547. //
  548. //=============================================================================
  549. GPEDITAPI
  550. HRESULT
  551. WINAPI
  552. DeleteAllGPOLinks(
  553. LPOLESTR lpContainer);
  554. //=============================================================================
  555. //
  556. // BrowseForGPO
  557. //
  558. // Displays the GPO browser dialog
  559. //
  560. // lpBrowseInfo - Address of a GPOBROWSEINFO structure
  561. //
  562. // Returns: S_OK if successful
  563. //
  564. //=============================================================================
  565. //
  566. // Flags passed in the dwFlags field of the GPOBROWSEINFO structure
  567. //
  568. #define GPO_BROWSE_DISABLENEW 0x00000001 // Disables the New GPO functionality on all pages except "All"
  569. #define GPO_BROWSE_NOCOMPUTERS 0x00000002 // Removes the Computers tab
  570. #define GPO_BROWSE_NODSGPOS 0x00000004 // Removes the Domain/OU and Sites tabs
  571. #define GPO_BROWSE_OPENBUTTON 0x00000008 // Change the Ok button to say Open
  572. #define GPO_BROWSE_INITTOALL 0x00000010 // Initialize the dialog focused on the All pane
  573. typedef struct tag_GPOBROWSEINFO
  574. {
  575. DWORD dwSize; // [in] Initialized to the size of this structure
  576. DWORD dwFlags; // [in] Flags defined above
  577. HWND hwndOwner; // [in] Parent window handle (can be NULL)
  578. LPOLESTR lpTitle; // [in] Title bar text. If NULL, "Browse for a Group Policy Object" will be the default text
  579. LPOLESTR lpInitialOU; // [in] Initial Domain/Organizational Unit to open focus on
  580. LPOLESTR lpDSPath; // [in/out] Pointer to the buffer that receives the Active Directory GPO path
  581. DWORD dwDSPathSize; // [in] Size in characters of buffer given in lpDSPath
  582. LPOLESTR lpName; // [in/out] Pointer to a buffer that receives either the computer name or
  583. // the friendly name of the GPO (can be NULL)
  584. DWORD dwNameSize; // [in] Size in characters of buffer given in lpName
  585. GROUP_POLICY_OBJECT_TYPE gpoType; // [out] Specifies the type of GPO
  586. GROUP_POLICY_HINT_TYPE gpoHint; // [out] Specifies a hint of the GPO association
  587. } GPOBROWSEINFO, *LPGPOBROWSEINFO;
  588. GPEDITAPI
  589. HRESULT
  590. WINAPI
  591. BrowseForGPO(
  592. LPGPOBROWSEINFO lpBrowseInfo);
  593. //=============================================================================
  594. //
  595. // ImportRSoPData
  596. //
  597. // Imports a data file generated by ExportRSoPData
  598. //
  599. // lpNameSpace - Namespace to place the data in
  600. // lpFileName - Filename containing the data
  601. //
  602. // Returns: S_OK if successful
  603. //
  604. // Notes: The namespace specified in lpNameSpace must exist prior to calling
  605. // this function.
  606. //
  607. //=============================================================================
  608. GPEDITAPI
  609. HRESULT
  610. WINAPI
  611. ImportRSoPData(
  612. LPOLESTR lpNameSpace,
  613. LPOLESTR lpFileName);
  614. //=============================================================================
  615. //
  616. // ExportRSoPData
  617. //
  618. // Exports a WBEM namespace containing RSoP information to a data file.
  619. // This data file can be imported to a WBEM namespace using ImportRSoPData.
  620. //
  621. // lpNameSpace - Namespace to read the data from
  622. // lpFileName - Filename to receive the data
  623. //
  624. // Returns: S_OK if successful
  625. //
  626. // Notes: This function should be called twice. Once for the user data
  627. // and once for the computer data.
  628. //
  629. //=============================================================================
  630. GPEDITAPI
  631. HRESULT
  632. WINAPI
  633. ExportRSoPData(
  634. LPOLESTR lpNameSpace,
  635. LPOLESTR lpFileName);
  636. #ifdef __cplusplus
  637. }
  638. #endif
  639. #endif /* _GPEDIT_H_ */