home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / gpedit.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  21.4 KB  |  681 lines

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