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

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1997-1999 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     dsrole.h
  8.  
  9. Abstract:
  10.  
  11.     This module contains the public interfaces to query the network roles of 
  12.     workstations, servers, and DCs
  13.  
  14. --*/
  15.  
  16. #ifndef __DSROLE_H__
  17. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  18. #define __DSROLE_H__
  19.  
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif
  23.  
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. //
  30. // Domain information
  31. //
  32. typedef enum _DSROLE_MACHINE_ROLE {
  33.  
  34.     DsRole_RoleStandaloneWorkstation,
  35.     DsRole_RoleMemberWorkstation,
  36.     DsRole_RoleStandaloneServer,
  37.     DsRole_RoleMemberServer,
  38.     DsRole_RoleBackupDomainController,
  39.     DsRole_RolePrimaryDomainController
  40.  
  41. } DSROLE_MACHINE_ROLE;
  42.  
  43. //
  44. // Previous server state
  45. //
  46. typedef enum _DSROLE_SERVER_STATE {
  47.  
  48.     DsRoleServerUnknown = 0,
  49.     DsRoleServerPrimary,
  50.     DsRoleServerBackup
  51.  
  52. } DSROLE_SERVER_STATE, *PDSROLE_SERVER_STATE;
  53.  
  54. typedef enum _DSROLE_PRIMARY_DOMAIN_INFO_LEVEL {
  55.  
  56.     DsRolePrimaryDomainInfoBasic = 1,
  57.     DsRoleUpgradeStatus,
  58.     DsRoleOperationState
  59.  
  60. } DSROLE_PRIMARY_DOMAIN_INFO_LEVEL;
  61.  
  62. //
  63. // Flags to be used with the PRIMARY_DOMAIN_INFO_LEVEL structures below
  64. //
  65. #define DSROLE_PRIMARY_DS_RUNNING           0x00000001
  66. #define DSROLE_PRIMARY_DS_MIXED_MODE        0x00000002
  67. #define DSROLE_UPGRADE_IN_PROGRESS          0x00000004
  68. #define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT  0x01000000
  69.  
  70. //
  71. // Structure that correspond to the DSROLE_PRIMARY_DOMAIN_INFO_LEVEL
  72. //
  73. typedef struct _DSROLE_PRIMARY_DOMAIN_INFO_BASIC {
  74.  
  75.     DSROLE_MACHINE_ROLE MachineRole;
  76.     ULONG Flags;
  77.     LPWSTR DomainNameFlat;
  78.     LPWSTR DomainNameDns;
  79.     LPWSTR DomainForestName;
  80.     GUID DomainGuid;
  81.  
  82. } DSROLE_PRIMARY_DOMAIN_INFO_BASIC, *PDSROLE_PRIMARY_DOMAIN_INFO_BASIC;
  83.  
  84. typedef struct _DSROLE_UPGRADE_STATUS_INFO {
  85.  
  86.     ULONG OperationState;
  87.     DSROLE_SERVER_STATE PreviousServerState;
  88.  
  89. } DSROLE_UPGRADE_STATUS_INFO, *PDSROLE_UPGRADE_STATUS_INFO;
  90.  
  91. typedef enum _DSROLE_OPERATION_STATE {
  92.  
  93.     DsRoleOperationIdle = 0,
  94.     DsRoleOperationActive,
  95.     DsRoleOperationNeedReboot
  96.  
  97. } DSROLE_OPERATION_STATE;
  98.  
  99. typedef struct _DSROLE_OPERATION_STATE_INFO {
  100.  
  101.     DSROLE_OPERATION_STATE OperationState;
  102.  
  103. } DSROLE_OPERATION_STATE_INFO, *PDSROLE_OPERATION_STATE_INFO;
  104.  
  105. DWORD
  106. WINAPI
  107. DsRoleGetPrimaryDomainInformation(
  108.     IN  LPCWSTR lpServer OPTIONAL,
  109.     IN  DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
  110.     OUT PBYTE *Buffer 
  111.     );
  112.  
  113. VOID
  114. WINAPI
  115. DsRoleFreeMemory(
  116.     IN PVOID    Buffer
  117.     );
  118.  
  119.  
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123.  
  124. #pragma option pop /*P_O_Pop*/
  125. #endif // __DSROLE_H__
  126.  
  127.  
  128.