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

  1. /*++
  2.  
  3. Copyright (c) 1998-1999  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     netsetup.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions and prototypes for the Net setup apis, for joining/unjoinging
  12.     domains and promoting/demoting servers
  13.  
  14. Environment:
  15.  
  16.     User Mode - Win32
  17.     Portable to any flat, 32-bit environment.  (Uses Win32 typedefs.)
  18.     Requires ANSI C extensions: slash-slash comments, long external names.
  19.  
  20. Notes:
  21.  
  22. --*/
  23.  
  24. #ifndef __LMJOIN_H__
  25. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  26. #define __LMJOIN_H__
  27.  
  28. #if _MSC_VER > 1000
  29. #pragma once
  30. #endif
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. //
  37. // Types of name that can be validated
  38. //
  39. typedef enum  _NETSETUP_NAME_TYPE {
  40.  
  41.     NetSetupUnknown = 0,
  42.     NetSetupMachine,
  43.     NetSetupWorkgroup,
  44.     NetSetupDomain,
  45.     NetSetupNonExistentDomain,
  46. #if(_WIN32_WINNT >= 0x0500)
  47.     NetSetupDnsMachine
  48. #endif
  49.  
  50. } NETSETUP_NAME_TYPE, *PNETSETUP_NAME_TYPE;
  51.  
  52.  
  53. //
  54. // Status of a workstation
  55. //
  56. typedef enum _NETSETUP_JOIN_STATUS {
  57.  
  58.     NetSetupUnknownStatus = 0,
  59.     NetSetupUnjoined,
  60.     NetSetupWorkgroupName,
  61.     NetSetupDomainName
  62.  
  63. } NETSETUP_JOIN_STATUS, *PNETSETUP_JOIN_STATUS;
  64.  
  65. //
  66. // Flags to determine the behavior of the join/unjoin APIs
  67. //
  68. #define NETSETUP_JOIN_DOMAIN    0x00000001      // If not present, workgroup is joined
  69. #define NETSETUP_ACCT_CREATE    0x00000002      // Do the server side account creation/rename
  70. #define NETSETUP_ACCT_DELETE    0x00000004      // Delete the account when a domain is left
  71. #define NETSETUP_WIN9X_UPGRADE  0x00000010      // Invoked during upgrade of Windows 9x to
  72.                                                 // Windows NT
  73. #define NETSETUP_DOMAIN_JOIN_IF_JOINED  0x00000020  // Allow the client to join a new domain
  74.                                                 // even if it is already joined to a domain
  75. #define NETSETUP_JOIN_UNSECURE  0x00000040      // Performs an unsecure join
  76.  
  77. #define NETSETUP_INSTALL_INVOCATION 0x00040000  // The APIs were invoked during install
  78.  
  79. //
  80. // 0x80000000 is reserved for internal use only
  81. //
  82.  
  83. //
  84. // Joins a machine to the domain.
  85. //
  86. NET_API_STATUS
  87. NET_API_FUNCTION
  88. NetJoinDomain(
  89.     IN  LPCWSTR lpServer OPTIONAL,
  90.     IN  LPCWSTR lpDomain,
  91.     IN  LPCWSTR lpAccountOU, OPTIONAL
  92.     IN  LPCWSTR lpAccount OPTIONAL,
  93.     IN  LPCWSTR lpPassword OPTIONAL,
  94.     IN  DWORD   fJoinOptions
  95.     );
  96.  
  97. NET_API_STATUS
  98. NET_API_FUNCTION
  99. NetUnjoinDomain(
  100.     IN  LPCWSTR lpServer OPTIONAL,
  101.     IN  LPCWSTR lpAccount OPTIONAL,
  102.     IN  LPCWSTR lpPassword OPTIONAL,
  103.     IN  DWORD   fUnjoinOptions
  104.     );
  105.  
  106. NET_API_STATUS
  107. NET_API_FUNCTION
  108. NetRenameMachineInDomain(
  109.     IN  LPCWSTR lpServer OPTIONAL,
  110.     IN  LPCWSTR lpNewMachineName OPTIONAL,
  111.     IN  LPCWSTR lpAccount OPTIONAL,
  112.     IN  LPCWSTR lpPassword OPTIONAL,
  113.     IN  DWORD   fRenameOptions
  114.     );
  115.  
  116.  
  117. //
  118. // Determine the validity of a name
  119. //
  120. NET_API_STATUS
  121. NET_API_FUNCTION
  122. NetValidateName(
  123.     IN  LPCWSTR             lpServer OPTIONAL,
  124.     IN  LPCWSTR             lpName,
  125.     IN  LPCWSTR             lpAccount OPTIONAL,
  126.     IN  LPCWSTR             lpPassword OPTIONAL,
  127.     IN  NETSETUP_NAME_TYPE  NameType
  128.     );
  129.  
  130. //
  131. // Determines whether a workstation is joined to a domain or not
  132. //
  133. NET_API_STATUS
  134. NET_API_FUNCTION
  135. NetGetJoinInformation(
  136.     IN   LPCWSTR                lpServer OPTIONAL,
  137.     OUT  LPWSTR                *lpNameBuffer,
  138.     OUT  PNETSETUP_JOIN_STATUS  BufferType
  139.     );
  140.  
  141.  
  142. //
  143. // Determines the list of OUs that the client can create a machine account in
  144. //
  145. NET_API_STATUS
  146. NET_API_FUNCTION
  147. NetGetJoinableOUs(
  148.     IN  LPCWSTR     lpServer OPTIONAL,
  149.     IN  LPCWSTR     lpDomain,
  150.     IN  LPCWSTR     lpAccount OPTIONAL,
  151.     IN  LPCWSTR     lpPassword OPTIONAL,
  152.     OUT DWORD      *OUCount,
  153.     OUT LPWSTR    **OUs
  154.     );
  155.  
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159.  
  160. #pragma option pop /*P_O_Pop*/
  161. #endif // __LMJOIN_H__
  162.