Leaked source code of windows server 2003
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.

1319 lines
48 KiB

  1. //=============================================================================
  2. // userenv.h - Header file for user environment API.
  3. // User Profiles, environment variables, and Group Policy
  4. //
  5. // Copyright (c) Microsoft Corporation 1995-2002
  6. // All rights reserved
  7. //
  8. //=============================================================================
  9. #ifndef _INC_USERENV
  10. #define _INC_USERENV
  11. #include <wbemcli.h>
  12. #include <profinfo.h>
  13. //
  14. // Define API decoration for direct importing of DLL references.
  15. //
  16. #if !defined(_USERENV_)
  17. #define USERENVAPI DECLSPEC_IMPORT
  18. #else
  19. #define USERENVAPI
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. //=============================================================================
  25. //
  26. // LoadUserProfile
  27. //
  28. // Loads the specified user's profile.
  29. //
  30. // Most applications should not need to use this function. It's used
  31. // when a user has logged onto the system or a service starts in a named
  32. // user account.
  33. //
  34. // hToken - Token for the user, returned from LogonUser()
  35. // lpProfileInfo - Address of a PROFILEINFO structure
  36. //
  37. // Returns: TRUE if successful
  38. // FALSE if not. Call GetLastError() for more details
  39. //
  40. // Note: The caller of this function must have admin privileges on the machine.
  41. //
  42. // Upon successful return, the hProfile member of the PROFILEINFO
  43. // structure is a registry key handle opened to the root
  44. // of the user's hive. It has been opened with full access. If
  45. // you need to read or write to the user's registry file, use
  46. // this key instead of HKEY_CURRENT_USER. Do not close this
  47. // handle. Instead pass it to UnloadUserProfile to close
  48. // the handle.
  49. //
  50. //=============================================================================
  51. //
  52. // Flags that can be set in the dwFlags field
  53. //
  54. #define PI_NOUI 0x00000001 // Prevents displaying of messages
  55. #define PI_APPLYPOLICY 0x00000002 // Apply NT4 style policy
  56. USERENVAPI
  57. BOOL
  58. WINAPI
  59. LoadUserProfileA(
  60. IN HANDLE hToken,
  61. IN OUT LPPROFILEINFOA lpProfileInfo);
  62. USERENVAPI
  63. BOOL
  64. WINAPI
  65. LoadUserProfileW(
  66. IN HANDLE hToken,
  67. IN OUT LPPROFILEINFOW lpProfileInfo);
  68. #ifdef UNICODE
  69. #define LoadUserProfile LoadUserProfileW
  70. #else
  71. #define LoadUserProfile LoadUserProfileA
  72. #endif // !UNICODE
  73. //=============================================================================
  74. //
  75. // UnloadUserProfile
  76. //
  77. // Unloads a user's profile that was loaded by LoadUserProfile()
  78. //
  79. // hToken - Token for the user, returned from LogonUser()
  80. // hProfile - hProfile member of the PROFILEINFO structure
  81. //
  82. // Returns: TRUE if successful
  83. // FALSE if not. Call GetLastError() for more details
  84. //
  85. // Note: The caller of this function must have admin privileges on the machine.
  86. //
  87. //=============================================================================
  88. USERENVAPI
  89. BOOL
  90. WINAPI
  91. UnloadUserProfile(
  92. IN HANDLE hToken,
  93. IN HANDLE hProfile);
  94. //=============================================================================
  95. //
  96. // GetProfilesDirectory
  97. //
  98. // Returns the path to the root of where all user profiles are stored.
  99. //
  100. // lpProfilesDir - Receives the path
  101. // lpcchSize - Size of lpProfilesDir
  102. //
  103. // Returns: TRUE if successful
  104. // FALSE if not. Call GetLastError() for more details
  105. //
  106. // Note: If lpProfilesDir is not large enough, the function will fail,
  107. // and lpcchSize will contain the necessary buffer size.
  108. //
  109. // Example return value: C:\Documents and Settings
  110. //
  111. //=============================================================================
  112. USERENVAPI
  113. BOOL
  114. WINAPI
  115. GetProfilesDirectoryA(
  116. OUT LPSTR lpProfilesDir,
  117. IN OUT LPDWORD lpcchSize);
  118. USERENVAPI
  119. BOOL
  120. WINAPI
  121. GetProfilesDirectoryW(
  122. OUT LPWSTR lpProfilesDir,
  123. IN OUT LPDWORD lpcchSize);
  124. #ifdef UNICODE
  125. #define GetProfilesDirectory GetProfilesDirectoryW
  126. #else
  127. #define GetProfilesDirectory GetProfilesDirectoryA
  128. #endif // !UNICODE
  129. //=============================================================================
  130. //
  131. // GetProfileType()
  132. //
  133. // Returns the type of the profile that is loaded for a user.
  134. //
  135. // dwFlags - Returns the profile flags
  136. //
  137. // Return: TRUE if successful
  138. // FALSE if an error occurs. Call GetLastError for more details
  139. //
  140. // Comments: if profile is not already loaded the function will return an error.
  141. // The caller needs to have access to HKLM part of the registry.
  142. // (exists by default)
  143. //
  144. //=============================================================================
  145. #if(WINVER >= 0x0500)
  146. //
  147. // Flags that can be set in the dwFlags field
  148. //
  149. #define PT_TEMPORARY 0x00000001 // A profile has been allocated that will be deleted at logoff.
  150. #define PT_ROAMING 0x00000002 // The loaded profile is a roaming profile.
  151. #define PT_MANDATORY 0x00000004 // The loaded profile is mandatory.
  152. USERENVAPI
  153. BOOL
  154. WINAPI
  155. GetProfileType(
  156. OUT DWORD *dwFlags);
  157. #endif /* WINVER >= 0x0500 */
  158. //=============================================================================
  159. //
  160. // DeleteProfile()
  161. //
  162. // Deletes the profile and all other user related settings from the machine
  163. //
  164. // lpSidString - String form of the user sid.
  165. // lpProfilePath - ProfilePath (if Null, lookup in the registry)
  166. // lpComputerName - Computer Name from which profile has to be deleted
  167. //
  168. // Return: TRUE if successful
  169. // FALSE if an error occurs. Call GetLastError for more details
  170. //
  171. // Comments: Deletes the profile directory, registry and appmgmt stuff
  172. //=============================================================================
  173. #if(WINVER >= 0x0500)
  174. USERENVAPI
  175. BOOL
  176. WINAPI
  177. DeleteProfileA (
  178. IN LPCSTR lpSidString,
  179. IN LPCSTR lpProfilePath,
  180. IN LPCSTR lpComputerName);
  181. USERENVAPI
  182. BOOL
  183. WINAPI
  184. DeleteProfileW (
  185. IN LPCWSTR lpSidString,
  186. IN LPCWSTR lpProfilePath,
  187. IN LPCWSTR lpComputerName);
  188. #ifdef UNICODE
  189. #define DeleteProfile DeleteProfileW
  190. #else
  191. #define DeleteProfile DeleteProfileA
  192. #endif // !UNICODE
  193. #endif /* WINVER >= 0x0500 */
  194. //=============================================================================
  195. //
  196. // GetDefaultUserProfilesDirectory
  197. //
  198. // Returns the path to the root of the default user profile
  199. //
  200. // lpProfileDir - Receives the path
  201. // lpcchSize - Size of lpProfileDir
  202. //
  203. // Returns: TRUE if successful
  204. // FALSE if not. Call GetLastError() for more details
  205. //
  206. // Note: If lpProfileDir is not large enough, the function will fail,
  207. // and lpcchSize will contain the necessary buffer size.
  208. //
  209. // Example return value: C:\Documents and Settings\Default User
  210. //
  211. //=============================================================================
  212. #if(WINVER >= 0x0500)
  213. USERENVAPI
  214. BOOL
  215. WINAPI
  216. GetDefaultUserProfileDirectoryA(
  217. OUT LPSTR lpProfileDir,
  218. IN OUT LPDWORD lpcchSize);
  219. USERENVAPI
  220. BOOL
  221. WINAPI
  222. GetDefaultUserProfileDirectoryW(
  223. OUT LPWSTR lpProfileDir,
  224. IN OUT LPDWORD lpcchSize);
  225. #ifdef UNICODE
  226. #define GetDefaultUserProfileDirectory GetDefaultUserProfileDirectoryW
  227. #else
  228. #define GetDefaultUserProfileDirectory GetDefaultUserProfileDirectoryA
  229. #endif // !UNICODE
  230. #endif /* WINVER >= 0x0500 */
  231. //=============================================================================
  232. //
  233. // GetAllUsersProfilesDirectory
  234. //
  235. // Returns the path to the root of the All Users profile
  236. //
  237. // lpProfileDir - Receives the path
  238. // lpcchSize - Size of lpProfileDir
  239. //
  240. // Returns: TRUE if successful
  241. // FALSE if not. Call GetLastError() for more details
  242. //
  243. // Note: If lpProfileDir is not large enough, the function will fail,
  244. // and lpcchSize will contain the necessary buffer size.
  245. //
  246. // Example return value: C:\Documents and Settings\All Users
  247. //
  248. //=============================================================================
  249. #if(WINVER >= 0x0500)
  250. USERENVAPI
  251. BOOL
  252. WINAPI
  253. GetAllUsersProfileDirectoryA(
  254. OUT LPSTR lpProfileDir,
  255. IN OUT LPDWORD lpcchSize);
  256. USERENVAPI
  257. BOOL
  258. WINAPI
  259. GetAllUsersProfileDirectoryW(
  260. OUT LPWSTR lpProfileDir,
  261. IN OUT LPDWORD lpcchSize);
  262. #ifdef UNICODE
  263. #define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
  264. #else
  265. #define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA
  266. #endif // !UNICODE
  267. #endif /* WINVER >= 0x0500 */
  268. //=============================================================================
  269. //
  270. // GetUserProfileDirectory
  271. //
  272. // Returns the path to the root of the requested user's profile
  273. //
  274. // hToken - User's token returned from LogonUser()
  275. // lpProfileDir - Receives the path
  276. // lpcchSize - Size of lpProfileDir
  277. //
  278. // Returns: TRUE if successful
  279. // FALSE if not. Call GetLastError() for more details
  280. //
  281. // Note: If lpProfileDir is not large enough, the function will fail,
  282. // and lpcchSize will contain the necessary buffer size.
  283. //
  284. // Example return value: C:\Documents and Settings\Joe
  285. //
  286. //=============================================================================
  287. USERENVAPI
  288. BOOL
  289. WINAPI
  290. GetUserProfileDirectoryA(
  291. IN HANDLE hToken,
  292. OUT LPSTR lpProfileDir,
  293. IN OUT LPDWORD lpcchSize);
  294. USERENVAPI
  295. BOOL
  296. WINAPI
  297. GetUserProfileDirectoryW(
  298. IN HANDLE hToken,
  299. OUT LPWSTR lpProfileDir,
  300. IN OUT LPDWORD lpcchSize);
  301. #ifdef UNICODE
  302. #define GetUserProfileDirectory GetUserProfileDirectoryW
  303. #else
  304. #define GetUserProfileDirectory GetUserProfileDirectoryA
  305. #endif // !UNICODE
  306. //=============================================================================
  307. //
  308. // CreateEnvironmentBlock
  309. //
  310. // Returns the environment variables for the specified user. This block
  311. // can then be passed to CreateProcessAsUser().
  312. //
  313. // lpEnvironment - Receives a pointer to the new environment block
  314. // hToken - User's token returned from LogonUser() (optional, can be NULL)
  315. // bInherit - Inherit from the current process's environment block
  316. // or start from a clean state.
  317. //
  318. // Returns: TRUE if successful
  319. // FALSE if not. Call GetLastError() for more details
  320. //
  321. // Note: If hToken is NULL, the returned environment block will contain
  322. // system variables only.
  323. //
  324. // Call DestroyEnvironmentBlock to free the buffer when finished.
  325. //
  326. // If this block is passed to CreateProcessAsUser, the
  327. // CREATE_UNICODE_ENVIRONMENT flag must also be set.
  328. //
  329. //=============================================================================
  330. USERENVAPI
  331. BOOL
  332. WINAPI
  333. CreateEnvironmentBlock(
  334. OUT LPVOID *lpEnvironment,
  335. IN HANDLE hToken,
  336. IN BOOL bInherit);
  337. //=============================================================================
  338. //
  339. // DestroyEnvironmentBlock
  340. //
  341. // Frees environment variables created by CreateEnvironmentBlock
  342. //
  343. // lpEnvironment - A pointer to the environment block
  344. //
  345. // Returns: TRUE if successful
  346. // FALSE if not. Call GetLastError() for more details
  347. //
  348. //=============================================================================
  349. USERENVAPI
  350. BOOL
  351. WINAPI
  352. DestroyEnvironmentBlock(
  353. IN LPVOID lpEnvironment);
  354. //=============================================================================
  355. //
  356. // ExpandEnvironmentStringsForUser
  357. //
  358. // Expands the source string using the environment block for the
  359. // specified user. If hToken is null, the system environment block
  360. // will be used (no user environment variables).
  361. //
  362. // hToken - User's token returned from LogonUser() (optional, can be NULL)
  363. // lpSrc - Pointer to the string with environment variables
  364. // lpDest - Buffer that receives the expanded string
  365. // dwSize - Size of lpDest in characters (max chars)
  366. //
  367. // Returns: TRUE if successful
  368. // FALSE if not. Call GetLastError() for more details
  369. //
  370. // Note: If the user profile for hToken is not loaded, this api will fail.
  371. //
  372. //=============================================================================
  373. #if(WINVER >= 0x0500)
  374. USERENVAPI
  375. BOOL
  376. WINAPI
  377. ExpandEnvironmentStringsForUserA(
  378. IN HANDLE hToken,
  379. IN LPCSTR lpSrc,
  380. OUT LPSTR lpDest,
  381. IN DWORD dwSize);
  382. USERENVAPI
  383. BOOL
  384. WINAPI
  385. ExpandEnvironmentStringsForUserW(
  386. IN HANDLE hToken,
  387. IN LPCWSTR lpSrc,
  388. OUT LPWSTR lpDest,
  389. IN DWORD dwSize);
  390. #ifdef UNICODE
  391. #define ExpandEnvironmentStringsForUser ExpandEnvironmentStringsForUserW
  392. #else
  393. #define ExpandEnvironmentStringsForUser ExpandEnvironmentStringsForUserA
  394. #endif // !UNICODE
  395. #endif /* WINVER >= 0x0500 */
  396. //=============================================================================
  397. //
  398. // RefreshPolicy()
  399. //
  400. // Causes group policy to be applied immediately on the client machine
  401. //
  402. // bMachine - Refresh machine or user policy
  403. //
  404. // Returns: TRUE if successful
  405. // FALSE if not. Call GetLastError() for more details
  406. //
  407. //=============================================================================
  408. #if(WINVER >= 0x0500)
  409. USERENVAPI
  410. BOOL
  411. WINAPI
  412. RefreshPolicy(
  413. IN BOOL bMachine);
  414. #endif /* WINVER >= 0x0500 */
  415. //=============================================================================
  416. //
  417. // RefreshPolicyEx()
  418. //
  419. // Causes group policy to be applied immediately on the client machine.
  420. //
  421. // bMachine - Refresh machine or user policy
  422. // dwOptions - Option specifying the kind of refresh that needs to be done.
  423. //
  424. // Returns: TRUE if successful
  425. // FALSE if not. Call GetLastError() for more details
  426. //
  427. //=============================================================================
  428. #if(WINVER >= 0x0500)
  429. #define RP_FORCE 1 // Refresh policies without any optimisations.
  430. USERENVAPI
  431. BOOL
  432. WINAPI
  433. RefreshPolicyEx(
  434. IN BOOL bMachine, IN DWORD dwOptions);
  435. #endif /* WINVER >= 0x0500 */
  436. //=============================================================================
  437. //
  438. // EnterCriticalPolicySection
  439. //
  440. // Pauses the background application of group policy to allow safe
  441. // reading of the registry. Applications that need to read multiple
  442. // policy entries and ensure that the values are not changed while reading
  443. // them should use this function.
  444. //
  445. // The maximum amount of time an application can hold a critical section
  446. // is 10 minutes. After 10 minutes, policy can be applied again.
  447. //
  448. // bMachine - Pause machine or user policy
  449. //
  450. // Returns: Handle if successful
  451. // NULL if not. Call GetLastError() for more details
  452. //
  453. // Note 1: The handle returned should be passed to LeaveCriticalPolicySection
  454. // when finished. Do not close this handle, LeaveCriticalPolicySection
  455. // will do that.
  456. //
  457. // Note 2: If both user and machine critical sections need to be acquired then
  458. // they should be done in this order: first acquire user critical section and
  459. // then acquire machine critical section.
  460. //
  461. //=============================================================================
  462. #if(WINVER >= 0x0500)
  463. USERENVAPI
  464. HANDLE
  465. WINAPI
  466. EnterCriticalPolicySection(
  467. IN BOOL bMachine);
  468. #endif /* WINVER >= 0x0500 */
  469. //=============================================================================
  470. //
  471. // LeaveCriticalPolicySection
  472. //
  473. // Resumes the background application of group policy. See
  474. // EnterCriticalPolicySection for more details.
  475. //
  476. // hSection - Handle returned from EnterCriticalPolicySection
  477. //
  478. // Returns: TRUE if successful
  479. // FALSE if not. Call GetLastError() for more details
  480. //
  481. // Note: This function will close the handle.
  482. //
  483. //=============================================================================
  484. #if(WINVER >= 0x0500)
  485. USERENVAPI
  486. BOOL
  487. WINAPI
  488. LeaveCriticalPolicySection(
  489. IN HANDLE hSection);
  490. #endif /* WINVER >= 0x0500 */
  491. //=============================================================================
  492. //
  493. // RegisterGPNotification
  494. //
  495. // Entry point for registering for Group Policy change notification.
  496. //
  497. // Parameters: hEvent - Event to be notified, by calling SetEvent(hEvent)
  498. // bMachine - If true, then register machine policy notification
  499. // else register user policy notification
  500. //
  501. // Returns: True if successful
  502. // False if error occurs
  503. //
  504. // Notes: Group Policy Notifications. There are 2 ways an application can
  505. // be notify when Group Policy is finished being applied.
  506. //
  507. // 1) Using the RegisterGPNotifcation function and waiting for the
  508. // event to be signalled.
  509. //
  510. // 2) A WM_SETTINGCHANGE message is broadcast to all desktops.
  511. // wParam - 1 if machine policy was applied, 0 if user policy was applied.
  512. // lParam - Points to the string "Policy"
  513. //
  514. //=============================================================================
  515. #if(WINVER >= 0x0500)
  516. USERENVAPI
  517. BOOL
  518. WINAPI
  519. RegisterGPNotification(
  520. IN HANDLE hEvent,
  521. IN BOOL bMachine );
  522. #endif /* WINVER >= 0x0500 */
  523. //=============================================================================
  524. //
  525. // UnregisterGPNotification
  526. //
  527. // Removes registration for a Group Policy change notification.
  528. //
  529. // Parameters: hEvent - Event to be removed
  530. //
  531. // Returns: True if successful
  532. // False if error occurs
  533. //
  534. //=============================================================================
  535. #if(WINVER >= 0x0500)
  536. USERENVAPI
  537. BOOL
  538. WINAPI
  539. UnregisterGPNotification(
  540. IN HANDLE hEvent );
  541. #endif /* WINVER >= 0x0500 */
  542. //=============================================================================
  543. //
  544. // GPOptions flags
  545. //
  546. // These are the flags found in the GPOptions property of a DS object
  547. //
  548. // For a given DS object (Site, Domain, OU), the GPOptions property
  549. // contains options that effect all the GPOs link to this SDOU.
  550. //
  551. // This is a DWORD type
  552. //
  553. //=============================================================================
  554. #if(WINVER >= 0x0500)
  555. #define GPC_BLOCK_POLICY 0x00000001 // Block all non-forced policy from above
  556. #endif /* WINVER >= 0x0500 */
  557. //=============================================================================
  558. //
  559. // GPLink flags
  560. //
  561. // These are the flags found on the GPLink property of a DS object after
  562. // the GPO path.
  563. //
  564. // For a given DS object (Site, Domain, OU), the GPLink property will
  565. // be in this text format
  566. //
  567. // [LDAP://CN={E615A0E3-C4F1-11D1-A3A7-00AA00615092},CN=Policies,CN=System,DC=mydomain,DC=Microsoft,DC=Com;1]
  568. //
  569. // The GUID is the GPO name, and the number following the LDAP path are the options
  570. // for that link from this DS object. Note, there can be multiple GPOs
  571. // each in their own square brackets in a prioritized list.
  572. //
  573. //=============================================================================
  574. #if(WINVER >= 0x0500)
  575. //
  576. // Options for a GPO link
  577. //
  578. #define GPO_FLAG_DISABLE 0x00000001 // This GPO is disabled
  579. #define GPO_FLAG_FORCE 0x00000002 // Don't override the settings in
  580. // this GPO with settings from
  581. // a GPO below it.
  582. #endif /* WINVER >= 0x0500 */
  583. //=============================================================================
  584. //
  585. // GetGPOList
  586. //
  587. //
  588. // Queries for the list of Group Policy Objects for the specified
  589. // user or machine. This function will return a link list
  590. // of Group Policy Objects. Call FreeGPOList to free the list.
  591. //
  592. // Note, most applications will not need to call this function.
  593. // This will primarily be used by services acting on behalf of
  594. // another user or machine. The caller of this function will
  595. // need to look in each GPO for their specific policy
  596. //
  597. // This function can be called in two different ways. Either the hToken for
  598. // a user or machine can be supplied and the correct name and domain
  599. // controller name will be generated, or hToken is NULL and the caller
  600. // must supply the name and the domain controller name.
  601. //
  602. // Calling this function with an hToken ensures the list of Group Policy
  603. // Objects is correct for the user or machine since security access checking
  604. // can be perfomed. If hToken is not supplied, the security of the caller
  605. // is used instead which means that list may or may not be 100% correct
  606. // for the intended user / machine. However, this is the fastest way
  607. // to call this function.
  608. //
  609. // hToken - User or machine token, if NULL, lpName and lpHostName must be supplied
  610. // lpName - User or machine name in DN format, if hToken is supplied, this must be NULL
  611. // lpHostName - Domain DN name or domain controller name. If hToken is supplied, this must be NULL
  612. // lpComputerName - Computer name to use to determine site location. If NULL,
  613. // the local computer is used as the reference. Format: \\machinename
  614. // dwFlags - Flags field. See flags definition below
  615. // pGPOList - Address of a pointer which receives the link list of GPOs
  616. //
  617. //
  618. // Returns: TRUE if successful
  619. // FALSE if not. Use GetLastError() for more details.
  620. //
  621. // Examples:
  622. //
  623. // Here's how this function will typically be called for
  624. // looking up the list of GPOs for a user:
  625. //
  626. // LPGROUP_POLICY_OBJECT pGPOList;
  627. //
  628. // if (GetGPOList (hToken, NULL, NULL, NULL, 0, &pGPOList))
  629. // {
  630. // // do processing here...
  631. // FreeGPOList (pGPOList);
  632. // }
  633. //
  634. //
  635. // Here's how this function will typically be called for
  636. // looking up the list of GPOs for a machine:
  637. //
  638. // LPGROUP_POLICY_OBJECT pGPOList;
  639. //
  640. // if (GetGPOList (NULL, lpMachineName, lpHostName, lpMachineName,
  641. // GPO_LIST_FLAG_MACHINE, &pGPOList))
  642. // {
  643. // // do processing here...
  644. // FreeGPOList (pGPOList);
  645. // }
  646. //
  647. //=============================================================================
  648. #if(WINVER >= 0x0500)
  649. //
  650. // Each Group Policy Object is associated (linked) with a site, domain,
  651. // organizational unit, or machine.
  652. //
  653. typedef enum _GPO_LINK {
  654. GPLinkUnknown = 0, // No link information available
  655. GPLinkMachine, // GPO linked to a machine (local or remote)
  656. GPLinkSite, // GPO linked to a site
  657. GPLinkDomain, // GPO linked to a domain
  658. GPLinkOrganizationalUnit // GPO linked to a organizational unit
  659. } GPO_LINK, *PGPO_LINK;
  660. typedef struct _GROUP_POLICY_OBJECTA {
  661. DWORD dwOptions; // See GPLink option flags above
  662. DWORD dwVersion; // Revision number of the GPO
  663. LPSTR lpDSPath; // Path to the Active Directory portion of the GPO
  664. LPSTR lpFileSysPath; // Path to the file system portion of the GPO
  665. LPSTR lpDisplayName; // Friendly display name
  666. CHAR szGPOName[50]; // Unique name
  667. GPO_LINK GPOLink; // Link information
  668. LPARAM lParam; // Free space for the caller to store GPO specific information
  669. struct _GROUP_POLICY_OBJECTA * pNext; // Next GPO in the list
  670. struct _GROUP_POLICY_OBJECTA * pPrev; // Previous GPO in the list
  671. LPSTR lpExtensions; // Extensions that are relevant for this GPO
  672. LPARAM lParam2; // Free space for the caller to store GPO specific information
  673. LPSTR lpLink; // Path to the Active Directory site, domain, or organizational unit this GPO is linked to
  674. // If this is the local GPO, this points to the word "Local"
  675. } GROUP_POLICY_OBJECTA, *PGROUP_POLICY_OBJECTA;
  676. typedef struct _GROUP_POLICY_OBJECTW {
  677. DWORD dwOptions; // See GPLink option flags above
  678. DWORD dwVersion; // Revision number of the GPO
  679. LPWSTR lpDSPath; // Path to the Active Directory portion of the GPO
  680. LPWSTR lpFileSysPath; // Path to the file system portion of the GPO
  681. LPWSTR lpDisplayName; // Friendly display name
  682. WCHAR szGPOName[50]; // Unique name
  683. GPO_LINK GPOLink; // Link information
  684. LPARAM lParam; // Free space for the caller to store GPO specific information
  685. struct _GROUP_POLICY_OBJECTW * pNext; // Next GPO in the list
  686. struct _GROUP_POLICY_OBJECTW * pPrev; // Previous GPO in the list
  687. LPWSTR lpExtensions; // Extensions that are relevant for this GPO
  688. LPARAM lParam2; // Free space for the caller to store GPO specific information
  689. LPWSTR lpLink; // Path to the Active Directory site, domain, or organizational unit this GPO is linked to
  690. // If this is the local GPO, this points to the word "Local"
  691. } GROUP_POLICY_OBJECTW, *PGROUP_POLICY_OBJECTW;
  692. #ifdef UNICODE
  693. typedef GROUP_POLICY_OBJECTW GROUP_POLICY_OBJECT;
  694. typedef PGROUP_POLICY_OBJECTW PGROUP_POLICY_OBJECT;
  695. #else
  696. typedef GROUP_POLICY_OBJECTA GROUP_POLICY_OBJECT;
  697. typedef PGROUP_POLICY_OBJECTA PGROUP_POLICY_OBJECT;
  698. #endif // UNICODE
  699. //
  700. // dwFlags for GetGPOList()
  701. //
  702. #define GPO_LIST_FLAG_MACHINE 0x00000001 // Return machine policy information
  703. #define GPO_LIST_FLAG_SITEONLY 0x00000002 // Return site policy information only
  704. USERENVAPI
  705. BOOL
  706. WINAPI
  707. GetGPOListA (
  708. IN HANDLE hToken,
  709. IN LPCSTR lpName,
  710. IN LPCSTR lpHostName,
  711. IN LPCSTR lpComputerName,
  712. IN DWORD dwFlags,
  713. OUT PGROUP_POLICY_OBJECTA *pGPOList);
  714. USERENVAPI
  715. BOOL
  716. WINAPI
  717. GetGPOListW (
  718. IN HANDLE hToken,
  719. IN LPCWSTR lpName,
  720. IN LPCWSTR lpHostName,
  721. IN LPCWSTR lpComputerName,
  722. IN DWORD dwFlags,
  723. OUT PGROUP_POLICY_OBJECTW *pGPOList);
  724. #ifdef UNICODE
  725. #define GetGPOList GetGPOListW
  726. #else
  727. #define GetGPOList GetGPOListA
  728. #endif // !UNICODE
  729. #endif /* WINVER >= 0x0500 */
  730. //=============================================================================
  731. //
  732. // FreeGPOList
  733. //
  734. //
  735. // Frees the linked list returned from GetGPOList
  736. //
  737. // pGPOList - Pointer to the linked list of GPOs
  738. //
  739. //
  740. // Returns: TRUE if successful
  741. // FALSE if not
  742. //
  743. //=============================================================================
  744. #if(WINVER >= 0x0500)
  745. USERENVAPI
  746. BOOL
  747. WINAPI
  748. FreeGPOListA (
  749. IN PGROUP_POLICY_OBJECTA pGPOList);
  750. USERENVAPI
  751. BOOL
  752. WINAPI
  753. FreeGPOListW (
  754. IN PGROUP_POLICY_OBJECTW pGPOList);
  755. #ifdef UNICODE
  756. #define FreeGPOList FreeGPOListW
  757. #else
  758. #define FreeGPOList FreeGPOListA
  759. #endif // !UNICODE
  760. #endif /* WINVER >= 0x0500 */
  761. //=============================================================================
  762. //
  763. // GetAppliedGPOList
  764. //
  765. // Queries for the list of applied Group Policy Objects for the specified
  766. // user or machine and specified client side extension. This function will return
  767. // a linked list of Group Policy Objects. Call FreeGPOList to free the list.
  768. //
  769. // dwFlags - User or machine policy, if it is GPO_LIST_FLAG_MACHINE then
  770. // return machine policy information
  771. // pMachineName - Name of remote computer in the form \\computername. If null
  772. // then local computer is used.
  773. // pSidUser - Security id of user (relevant for user policy). If pMachineName is
  774. // null and pSidUser is null then it means current logged on user.
  775. // If pMachine is null and pSidUser is non-null then it means user
  776. // represented by pSidUser on local machine. If pMachineName is non-null
  777. // then and if dwFlags specifies user policy, then pSidUser must be
  778. // non-null.
  779. // pGuidExtension - Guid of the specified extension
  780. // ppGPOList - Address of a pointer which receives the link list of GPOs
  781. //
  782. // The return value is a Win32 error code. ERROR_SUCCESS means the GetAppliedGPOList
  783. // function completed successfully. Otherwise it indicates that the function failed.
  784. //
  785. //=============================================================================
  786. #if(WINVER >= 0x0500)
  787. USERENVAPI
  788. DWORD
  789. WINAPI
  790. GetAppliedGPOListA (
  791. IN DWORD dwFlags,
  792. IN LPCSTR pMachineName,
  793. IN PSID pSidUser,
  794. IN GUID *pGuidExtension,
  795. OUT PGROUP_POLICY_OBJECTA *ppGPOList);
  796. USERENVAPI
  797. DWORD
  798. WINAPI
  799. GetAppliedGPOListW (
  800. IN DWORD dwFlags,
  801. IN LPCWSTR pMachineName,
  802. IN PSID pSidUser,
  803. IN GUID *pGuidExtension,
  804. OUT PGROUP_POLICY_OBJECTW *ppGPOList);
  805. #ifdef UNICODE
  806. #define GetAppliedGPOList GetAppliedGPOListW
  807. #else
  808. #define GetAppliedGPOList GetAppliedGPOListA
  809. #endif // !UNICODE
  810. #endif /* WINVER >= 0x0500 */
  811. //=============================================================================
  812. //
  813. // Group Policy Object client side extension support
  814. //
  815. // Flags, data structures and function prototype
  816. //
  817. // To register your extension, create a subkey under this key
  818. //
  819. // Software\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions
  820. //
  821. // The subkey needs to be a guid so that it is unique. The noname value of the subkey
  822. // can be the friendly name of the extension. Then add these values:
  823. //
  824. // DllName REG_EXPAND_SZ Path to your DLL
  825. // ProcessGroupPolicy REG_SZ Function name (see PFNPROCESSGROUPPOLICY prototype). This
  826. // is obsolete, it has been superseded by ProcessGroupPolicyEx.
  827. // It's here for backward compatibility reasons only.
  828. // ProcessGroupPolicyEx REG_SZ Function name (see PFNPROCESSGROUPPOLICYEX prototype)
  829. // GenerateGroupPolicy REG_SZ Function name for Rsop (see PFNGENERATEGROUPPOLICY prototype)
  830. // NoMachinePolicy REG_DWORD True, if extension does not have to be called when
  831. // machine policies are being processed.
  832. // NoUserPolicy REG_DWORD True, if extension does not have to be called when
  833. // user policies are being processed.
  834. // NoSlowLink REG_DWORD True, if extension does not have to be called on a slow link
  835. // NoBackgroundPolicy REG_DWORD True, if extension does not have to be called
  836. // for background policy processing.
  837. // NoGPOListChanges REG_DWORD True, if extension does not have to be called when
  838. // there are no changes between cached and current GPO lists.
  839. // PerUserLocalSettings REG_DWORD True, if user policies have to be cached on a per user and
  840. // per machine basis.
  841. // RequiresSuccessfulRegistry REG_DWORD True, if extension should be called only if registry extension
  842. // was successfully processed.
  843. // EnableAsynchronousProcessing REG_DWORD True, if registry extension will complete its processing
  844. // asynchronously.
  845. // NotifyLinkTransition REG_DWORD True, if extension should be called when a change in link
  846. // speed is detected between previous policy application and
  847. // current policy application.
  848. //
  849. // The return value is a Win32 error code. ERROR_SUCCESS means the ProcessGroupPolicy
  850. // function completed successfully. If return value is ERROR_OVERRIDE_NOCHANGES then it
  851. // means that the extension will be called the next time even if NoGPOListChanges is set
  852. // and there are no changes to the GPO list. Any other return value indicates that the
  853. // ProcessGroupPolicy or ProcessGroupPolicyEx function failed.
  854. //
  855. //=============================================================================
  856. #if(WINVER >= 0x0500)
  857. #define GP_DLLNAME TEXT("DllName")
  858. #define GP_ENABLEASYNCHRONOUSPROCESSING TEXT("EnableAsynchronousProcessing")
  859. #define GP_MAXNOGPOLISTCHANGESINTERVAL TEXT("MaxNoGPOListChangesInterval")
  860. #define GP_NOBACKGROUNDPOLICY TEXT("NoBackgroundPolicy")
  861. #define GP_NOGPOLISTCHANGES TEXT("NoGPOListChanges")
  862. #define GP_NOMACHINEPOLICY TEXT("NoMachinePolicy")
  863. #define GP_NOSLOWLINK TEXT("NoSlowLink")
  864. #define GP_NOTIFYLINKTRANSITION TEXT("NotifyLinkTransition")
  865. #define GP_NOUSERPOLICY TEXT("NoUserPolicy")
  866. #define GP_PERUSERLOCALSETTINGS TEXT("PerUserLocalSettings")
  867. #define GP_PROCESSGROUPPOLICY TEXT("ProcessGroupPolicy")
  868. #define GP_REQUIRESSUCCESSFULREGISTRY TEXT("RequiresSuccessfulRegistry")
  869. #define GPO_INFO_FLAG_MACHINE 0x00000001 // Apply machine policy rather than user policy
  870. #define GPO_INFO_FLAG_BACKGROUND 0x00000010 // Background refresh of policy (ok to do slow stuff)
  871. #define GPO_INFO_FLAG_SLOWLINK 0x00000020 // Policy is being applied across a slow link
  872. #define GPO_INFO_FLAG_VERBOSE 0x00000040 // Verbose output to the eventlog
  873. #define GPO_INFO_FLAG_NOCHANGES 0x00000080 // No changes were detected to the Group Policy Objects
  874. #define GPO_INFO_FLAG_LINKTRANSITION 0x00000100 // A change in link speed was detected between previous policy
  875. // application and current policy application
  876. #define GPO_INFO_FLAG_LOGRSOP_TRANSITION 0x00000200 // A Change in Rsop Logging was detected between previous policy
  877. // application and current policy application, (new intf only)
  878. #define GPO_INFO_FLAG_FORCED_REFRESH 0x00000400 // Forced Refresh is being applied. redo policies.
  879. #define GPO_INFO_FLAG_SAFEMODE_BOOT 0x00000800 // windows safe mode boot flag
  880. #define GPO_INFO_FLAG_ASYNC_FOREGROUND 0x00001000 // Asynchronous foreground refresh of policy
  881. #define GPO_INFO_FLAG_REPORT 0x00002000 // Report all settings for one GPO rather than the resultant settings across multiple GPOs
  882. typedef UINT_PTR ASYNCCOMPLETIONHANDLE;
  883. typedef DWORD (*PFNSTATUSMESSAGECALLBACK)(BOOL bVerbose, LPWSTR lpMessage);
  884. typedef DWORD(*PFNPROCESSGROUPPOLICY)(
  885. IN DWORD dwFlags, // GPO_INFO_FLAGS
  886. IN HANDLE hToken, // User or machine token
  887. IN HKEY hKeyRoot, // Root of registry
  888. IN PGROUP_POLICY_OBJECT pDeletedGPOList, // Linked list of deleted GPOs
  889. IN PGROUP_POLICY_OBJECT pChangedGPOList, // Linked list of changed GPOs
  890. IN ASYNCCOMPLETIONHANDLE pHandle, // For asynchronous completion
  891. IN BOOL *pbAbort, // If true, then abort GPO processing
  892. IN PFNSTATUSMESSAGECALLBACK pStatusCallback); // Callback function for displaying status messages
  893. // Note, this can be NULL
  894. typedef DWORD(*PFNPROCESSGROUPPOLICYEX)(
  895. IN DWORD dwFlags, // GPO_INFO_FLAGS
  896. IN HANDLE hToken, // User or machine token
  897. IN HKEY hKeyRoot, // Root of registry
  898. IN PGROUP_POLICY_OBJECT pDeletedGPOList, // Linked list of deleted GPOs
  899. IN PGROUP_POLICY_OBJECT pChangedGPOList, // Linked list of changed GPOs
  900. IN ASYNCCOMPLETIONHANDLE pHandle, // For asynchronous completion
  901. IN BOOL *pbAbort, // If true, then abort GPO processing
  902. IN PFNSTATUSMESSAGECALLBACK pStatusCallback, // Callback function for displaying status messages
  903. // Note, this can be NULL
  904. IN IWbemServices *pWbemServices, // Pointer to namespace to log diagnostic mode data
  905. // Note, this will be NULL when Rsop logging is disabled
  906. OUT HRESULT *pRsopStatus); // RSOP Logging succeeded or not.
  907. typedef PVOID PRSOPTOKEN;
  908. typedef struct _RSOP_TARGET {
  909. WCHAR * pwszAccountName; // Account name
  910. WCHAR * pwszNewSOM; // New domain or OU location for account
  911. SAFEARRAY * psaSecurityGroups; // New security groups
  912. PRSOPTOKEN pRsopToken; // Rsop token for use with Rsop security Api's
  913. PGROUP_POLICY_OBJECT pGPOList; // Linked list of GPOs
  914. IWbemServices * pWbemServices; // Pointer to namespace to log planning mode data
  915. } RSOP_TARGET, *PRSOP_TARGET;
  916. typedef DWORD(*PFNGENERATEGROUPPOLICY)(
  917. IN DWORD dwFlags, // GPO_INFO_FLAGS
  918. IN BOOL *pbAbort, // If true, then abort GPO processing
  919. IN WCHAR *pwszSite, // Site the target computer is in
  920. IN PRSOP_TARGET pComputerTarget, // Computer target info, can be null
  921. IN PRSOP_TARGET pUserTarget ); // User target info, can be null
  922. //
  923. // GUID that identifies the registry extension
  924. //
  925. #define REGISTRY_EXTENSION_GUID { 0x35378EAC, 0x683F, 0x11D2, 0xA8, 0x9A, 0x00, 0xC0, 0x4F, 0xBB, 0xCF, 0xA2 }
  926. #endif /* WINVER >= 0x0500 */
  927. //=============================================================================
  928. //
  929. // Group Policy Object client side asynchronous extension processing
  930. //
  931. // extensionId - Unique guid identifying the extension
  932. // pAsyncHandle - Asynchronous completion handle that was passed to extension in
  933. // ProcessGroupPolicy call
  934. // dwStatus - Completion status of asynchronous processing
  935. //
  936. // The return value is a Win32 error code. ERROR_SUCCESS means the ProcessGroupPolicyCompleted
  937. // function completed successfully. Otherwise it indicates that the function failed.
  938. //
  939. //=============================================================================
  940. #if(WINVER >= 0x0500)
  941. typedef GUID *REFGPEXTENSIONID;
  942. USERENVAPI
  943. DWORD
  944. WINAPI
  945. ProcessGroupPolicyCompleted(
  946. IN REFGPEXTENSIONID extensionId,
  947. IN ASYNCCOMPLETIONHANDLE pAsyncHandle,
  948. IN DWORD dwStatus);
  949. #endif /* WINVER >= 0x0500 */
  950. //=============================================================================
  951. //
  952. // Group Policy Object client side asynchronous extension processing
  953. //
  954. // extensionId - Unique guid identifying the extension
  955. // pAsyncHandle - Asynchronous completion handle that was passed to extension in
  956. // ProcessGroupPolicy call
  957. // dwStatus - Completion status of asynchronous processing
  958. // RsopStatus - RSoP Logging status
  959. //
  960. // The return value is a Win32 error code. ERROR_SUCCESS means the ProcessGroupPolicyCompleted
  961. // function completed successfully. Otherwise it indicates that the function failed.
  962. //
  963. //=============================================================================
  964. #if(WINVER >= 0x0500)
  965. USERENVAPI
  966. DWORD
  967. WINAPI
  968. ProcessGroupPolicyCompletedEx(
  969. IN REFGPEXTENSIONID extensionId,
  970. IN ASYNCCOMPLETIONHANDLE pAsyncHandle,
  971. IN DWORD dwStatus,
  972. IN HRESULT RsopStatus);
  973. #endif /* WINVER >= 0x0500 */
  974. //=============================================================================
  975. //
  976. // Function: RsopAccessCheckByType
  977. //
  978. // Description: Determines whether the security descriptor pointed to by pSecurityDescriptor
  979. // grants the set of access rights specified in dwDesiredAccessMask
  980. // to the client identified by the RSOPTOKEN pointed to by pRsopToken.
  981. //
  982. // pSecurityDescriptor - Security Descriptor on the object
  983. // pPrincipalSelfSid - Principal Sid
  984. // pRsopToken - Pointer to a valid RSOPTOKEN against which access needs to be checked
  985. // dwDesiredAccessMask - Mask of requested generic and/or standard and or specific access rights
  986. // pObjectTypeList - Object Type List
  987. // ObjectTypeListLength - Object Type List Length
  988. // pGenericMapping - Generic Mapping
  989. // pPrivilegeSet - privilege set
  990. // pdwPrivilegeSetLength- privilege set length
  991. // pdwGrantedAccessMask - On success, if pbAccessStatus is true, it contains
  992. // the mask of standard and specific rights granted.
  993. // If pbAccessStatus is false, it is set to 0.
  994. // On failure, it is not modified.
  995. // pbAccessStatus - On success, indicates wether the requested set
  996. // of access rights was granted.
  997. // On failure, it is not modified
  998. //
  999. // Returns S_OK on success or appropriate error code.
  1000. // For additional details, look at the documentation of AccessCheckByType
  1001. //=============================================================================
  1002. #if(WINVER >= 0x0500)
  1003. USERENVAPI
  1004. HRESULT
  1005. WINAPI
  1006. RsopAccessCheckByType(
  1007. IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1008. IN PSID pPrincipalSelfSid,
  1009. IN PRSOPTOKEN pRsopToken,
  1010. IN DWORD dwDesiredAccessMask,
  1011. IN POBJECT_TYPE_LIST pObjectTypeList,
  1012. IN DWORD ObjectTypeListLength,
  1013. IN PGENERIC_MAPPING pGenericMapping,
  1014. IN PPRIVILEGE_SET pPrivilegeSet,
  1015. IN LPDWORD pdwPrivilegeSetLength,
  1016. OUT LPDWORD pdwGrantedAccessMask,
  1017. OUT LPBOOL pbAccessStatus);
  1018. #endif /* WINVER >= 0x0500 */
  1019. //=============================================================================
  1020. //
  1021. // Function: RsopFileAccessCheck
  1022. //
  1023. // Description: Determines whether the security descriptor on the file grants the set of file access
  1024. // rights specified in dwDesiredAccessMask
  1025. // to the client identified by the RSOPTOKEN pointed to by pRsopToken.
  1026. //
  1027. // pszFileName - Name of an existing filename
  1028. // pRsopToken - Pointer to a valid RSOPTOKEN against which access needs to be checked
  1029. // dwDesiredAccessMask - Mask of requested generic and/or standard and or specific access rights
  1030. // pdwGrantedAccessMask - On success, if pbAccessStatus is true, it contains
  1031. // the mask of standard and specific rights granted.
  1032. // If pbAccessStatus is false, it is set to 0.
  1033. // On failure, it is not modified.
  1034. // pbAccessStatus - On success, indicates wether the requested set
  1035. // of access rights was granted.
  1036. // On failure, it is not modified
  1037. //
  1038. // Returns S_OK on success or appropriate error code
  1039. //=============================================================================
  1040. #if(WINVER >= 0x0500)
  1041. USERENVAPI
  1042. HRESULT
  1043. WINAPI
  1044. RsopFileAccessCheck(
  1045. IN LPWSTR pszFileName,
  1046. IN PRSOPTOKEN pRsopToken,
  1047. IN DWORD dwDesiredAccessMask,
  1048. OUT LPDWORD pdwGrantedAccessMask,
  1049. OUT LPBOOL pbAccessStatus);
  1050. #endif /* WINVER >= 0x0500 */
  1051. typedef enum _SETTINGSTATUS
  1052. {
  1053. RSOPUnspecified = 0,
  1054. RSOPApplied,
  1055. RSOPIgnored,
  1056. RSOPFailed,
  1057. RSOPSubsettingFailed
  1058. } SETTINGSTATUS;
  1059. //=============================================================================
  1060. //
  1061. // POLICYSETTINGSTATUSINFO
  1062. //
  1063. // Describes the instance of RSOP_PolicySettingStatus
  1064. //
  1065. // szKey - OPTIONAL, if NULL, the key is generated on the fly
  1066. // szEventSource - name of the source generation event log messages
  1067. // szEventLogName - name of the event log database where the messages are logged
  1068. // dwEventID - event log message ID
  1069. // status - status of the policy setting
  1070. // timeLogged - time at which the event log message was logged
  1071. //
  1072. //=============================================================================
  1073. typedef struct _POLICYSETTINGSTATUSINFO
  1074. {
  1075. LPWSTR szKey;
  1076. LPWSTR szEventSource;
  1077. LPWSTR szEventLogName;
  1078. DWORD dwEventID;
  1079. DWORD dwErrorCode;
  1080. SETTINGSTATUS status;
  1081. SYSTEMTIME timeLogged;
  1082. } POLICYSETTINGSTATUSINFO, *LPPOLICYSETTINGSTATUSINFO;
  1083. //=============================================================================
  1084. //
  1085. // RsopSetPolicySettingStatus
  1086. //
  1087. // Creates an instance of RSOP_PolicySettingStatus and RSOP_PolicySettingLink
  1088. // and links RSOP_PolicySettingStatus to RSOP_PolicySetting
  1089. //
  1090. // dwFlags - flags
  1091. // pServices - RSOP namespace
  1092. // pSettingInstance - instance of RSOP_PolicySetting or its children
  1093. // nInfo - number of PolicySettingStatusInfo
  1094. // pStatus - array of PolicySettingStatusInfo
  1095. //
  1096. // Return: S_OK if successful, HRESULT otherwise
  1097. //
  1098. //=============================================================================
  1099. USERENVAPI
  1100. HRESULT
  1101. WINAPI
  1102. RsopSetPolicySettingStatus( DWORD dwFlags,
  1103. IWbemServices* pServices,
  1104. IWbemClassObject* pSettingInstance,
  1105. DWORD nInfo,
  1106. POLICYSETTINGSTATUSINFO* pStatus );
  1107. //=============================================================================
  1108. //
  1109. // RsopResetPolicySettingStatus
  1110. //
  1111. // Unlinks RSOP_PolicySettingStatus from RSOP_PolicySetting,
  1112. // deletes the instance of RSOP_PolicySettingStatus and RSOP_PolicySettingLink
  1113. // and optionally deletes the instance of RSOP_PolicySetting
  1114. //
  1115. // dwFlags - flags
  1116. // pServices - RSOP namespace
  1117. // pSettingInstance - instance of RSOP_PolicySetting or its children
  1118. //
  1119. // Return: S_OK if successful, HRESULT otherwise
  1120. //
  1121. //=============================================================================
  1122. USERENVAPI
  1123. HRESULT
  1124. WINAPI
  1125. RsopResetPolicySettingStatus( DWORD dwFlags,
  1126. IWbemServices* pServices,
  1127. IWbemClassObject* pSettingInstance );
  1128. //=============================================================================
  1129. //
  1130. // Flags for RSoP WMI providers
  1131. //
  1132. //=============================================================================
  1133. // planning mode provider flags
  1134. #define FLAG_NO_GPO_FILTER 0x80000000 // GPOs are not filtered, implies FLAG_NO_CSE_INVOKE
  1135. #define FLAG_NO_CSE_INVOKE 0x40000000 // only GP processing done for planning mode
  1136. #define FLAG_ASSUME_SLOW_LINK 0x20000000 // planning mode RSoP assumes slow link
  1137. #define FLAG_LOOPBACK_MERGE 0x10000000 // planning mode RSoP assumes merge loop back
  1138. #define FLAG_LOOPBACK_REPLACE 0x08000000 // planning mode RSoP assumes replace loop back
  1139. #define FLAG_ASSUME_USER_WQLFILTER_TRUE 0x04000000 // planning mode RSoP assumes all comp filters to be true
  1140. #define FLAG_ASSUME_COMP_WQLFILTER_TRUE 0x02000000 // planning mode RSoP assumes all user filters to be true
  1141. #define FLAG_PLANNING_MODE 0x01000000 // flag that indicates that a given namespace was created
  1142. // for planning mode. This flag cannot be passed in but the
  1143. // relevant subnamespace will be marked with this flag
  1144. // diagnostic mode provider flags
  1145. #define FLAG_NO_USER 0x00000001 // Don't get any user data
  1146. #define FLAG_NO_COMPUTER 0x00000002 // Don't get any machine data
  1147. #define FLAG_FORCE_CREATENAMESPACE 0x00000004
  1148. // Delete and recreate the namespace for this snapshot.
  1149. //=============================================================================
  1150. //
  1151. // Extended Errors returned by RSoP WMI Providers
  1152. //
  1153. //=============================================================================
  1154. // User accessing the rsop provider doesn't have access to user data.
  1155. #define RSOP_USER_ACCESS_DENIED 0x00000001
  1156. // User accessing the rsop provider doesn't have access to computer data.
  1157. #define RSOP_COMPUTER_ACCESS_DENIED 0x00000002
  1158. // This user is an interactive non admin user, the temp snapshot namespace already exists
  1159. // and the FLAG_FORCE_CREATENAMESPACE was not passed in
  1160. #define RSOP_TEMPNAMESPACE_EXISTS 0x00000004
  1161. #ifdef __cplusplus
  1162. }
  1163. #endif
  1164. #endif // _INC_USERENV