DSRole.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:3k
源码类别:

模拟服务器

开发平台:

C/C++

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