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.

330 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. lmadtool.h
  5. Abstract:
  6. Contains constants and function prototypes for the Remotable Network
  7. Administration tools.
  8. Author:
  9. Dan Lafferty (danl) 27-Sept-1991
  10. Environment:
  11. User Mode -Win32 and Win16
  12. Revision History:
  13. 27-Sept-1991 danl
  14. created
  15. --*/
  16. //
  17. // Defines
  18. //
  19. #define TYPE_USER 1L
  20. #define TYPE_GROUP 2L
  21. #define TYPE_INVALID 3L
  22. #define TYPE_UNKNOWN 4L
  23. //
  24. // File Security API.
  25. //
  26. // (must #include \nt\public\sdk\inc\seapi.h)
  27. // (must #include \nt\private\inc\seopaque.h)
  28. //
  29. DWORD
  30. NetpSetFileSecurityA (
  31. IN LPSTR ServerName OPTIONAL,
  32. IN LPSTR lpFileName,
  33. IN PSECURITY_INFORMATION pSecurityInformation,
  34. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  35. );
  36. DWORD
  37. NetpSetFileSecurityW (
  38. IN LPWSTR ServerName OPTIONAL,
  39. IN LPWSTR lpFileName,
  40. IN PSECURITY_INFORMATION pSecurityInformation,
  41. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  42. );
  43. DWORD
  44. NetpGetFileSecurityA(
  45. IN LPSTR ServerName OPTIONAL,
  46. IN LPSTR lpFileName,
  47. IN PSECURITY_INFORMATION pRequestedInformation,
  48. OUT PSECURITY_DESCRIPTOR *pSecurityDescriptor,
  49. OUT LPDWORD pnLength
  50. );
  51. DWORD
  52. NetpGetFileSecurityW(
  53. IN LPWSTR ServerName OPTIONAL,
  54. IN LPWSTR lpFileName,
  55. IN PSECURITY_INFORMATION pRequestedInformation,
  56. OUT PSECURITY_DESCRIPTOR *pSecurityDescriptor,
  57. OUT LPDWORD pnLength
  58. );
  59. //
  60. // Name From Sid API
  61. //
  62. typedef struct _NAME_INFOA {
  63. LPSTR Name;
  64. DWORD NameUse;
  65. } NAME_INFOA, *PNAME_INFOA, *LPNAME_INFOA;
  66. typedef struct _NAME_INFOW {
  67. LPWSTR Name;
  68. DWORD NameUse;
  69. } NAME_INFOW, *PNAME_INFOW, *LPNAME_INFOW;
  70. #ifdef UNICODE
  71. #define NAME_INFO NAME_INFOW
  72. #define PNAME_INFO PNAME_INFOW
  73. #define LPNAME_INFO LPNAME_INFOW
  74. #else
  75. #define NAME_INFO NAME_INFOA
  76. #define PNAME_INFO PNAME_INFOA
  77. #define LPNAME_INFO LPNAME_INFOA
  78. #endif // UNICODE
  79. DWORD
  80. NetpGetNameFromSidA (
  81. IN LPSTR ServerName,
  82. IN DWORD SidCount,
  83. IN PSID SidPtr,
  84. OUT LPDWORD NameCount,
  85. OUT LPNAME_INFOA *NameInfo
  86. );
  87. DWORD
  88. NetpGetNameFromSidW (
  89. IN LPWSTR ServerName,
  90. IN DWORD SidCount,
  91. IN PSID SidPtr,
  92. OUT LPDWORD NameCount,
  93. OUT LPNAME_INFOW *NameInfo
  94. );
  95. #ifdef UNICODE
  96. #define NetpGetNameFromSid NetpGetNameFromSidW
  97. #else
  98. #define NetpGetNameFromSid NetpGetNameFromSidA
  99. #endif // UNICODE
  100. //
  101. // User, Group, UserModals API
  102. //
  103. // (This includes the ability to get a SID from a NAME)
  104. //
  105. //
  106. //
  107. // USER INFO
  108. //
  109. //
  110. DWORD
  111. NetpUserGetInfoA (
  112. IN LPSTR servername OPTIONAL,
  113. IN LPSTR username,
  114. IN DWORD level,
  115. OUT LPBYTE *bufptr
  116. );
  117. DWORD
  118. NetpUserGetInfoW (
  119. IN LPWSTR servername OPTIONAL,
  120. IN LPWSTR username,
  121. IN DWORD level,
  122. OUT LPBYTE *bufptr
  123. );
  124. DWORD
  125. NetpUserSetInfoA (
  126. IN LPSTR servername OPTIONAL,
  127. IN LPSTR username,
  128. IN DWORD level,
  129. IN LPBYTE buf,
  130. OUT LPDWORD parm_err OPTIONAL
  131. );
  132. DWORD
  133. NetpUserSetInfoW (
  134. IN LPWSTR servername OPTIONAL,
  135. IN LPWSTR username,
  136. IN DWORD level,
  137. IN LPBYTE buf,
  138. OUT LPDWORD parm_err OPTIONAL
  139. );
  140. //
  141. //
  142. // GROUP INFO
  143. //
  144. //
  145. DWORD
  146. NetpGroupGetInfoA (
  147. IN LPSTR servername OPTIONAL,
  148. IN LPSTR groupname,
  149. IN DWORD level,
  150. OUT LPBYTE *bufptr
  151. );
  152. DWORD
  153. NetpGroupGetInfoW (
  154. IN LPWSTR servername OPTIONAL,
  155. IN LPWSTR groupname,
  156. IN DWORD level,
  157. OUT LPBYTE *bufptr
  158. );
  159. DWORD
  160. NetpGroupSetInfoA (
  161. IN LPSTR servername OPTIONAL,
  162. IN LPSTR groupname,
  163. IN DWORD level,
  164. IN LPBYTE buf,
  165. OUT LPDWORD parm_err OPTIONAL
  166. );
  167. DWORD
  168. NetpGroupSetInfoW (
  169. IN LPWSTR servername OPTIONAL,
  170. IN LPWSTR groupname,
  171. IN DWORD level,
  172. IN LPBYTE buf,
  173. OUT LPDWORD parm_err OPTIONAL
  174. );
  175. //
  176. //
  177. // USER_MODALS INFO
  178. //
  179. //
  180. DWORD
  181. NetpUserModalsGetA (
  182. IN LPSTR servername OPTIONAL,
  183. IN DWORD level,
  184. OUT LPBYTE *bufptr
  185. );
  186. DWORD
  187. NetpUserModalsGetW (
  188. IN LPWSTR servername OPTIONAL,
  189. IN DWORD level,
  190. OUT LPBYTE *bufptr
  191. );
  192. DWORD
  193. NetpUserModalsSetA (
  194. IN LPSTR servername OPTIONAL,
  195. IN DWORD level,
  196. IN LPBYTE buf,
  197. OUT LPDWORD parm_err OPTIONAL
  198. );
  199. DWORD
  200. NetpUserModalsSetW (
  201. IN LPWSTR servername OPTIONAL,
  202. IN DWORD level,
  203. IN LPBYTE buf,
  204. OUT LPDWORD parm_err OPTIONAL
  205. );
  206. #ifdef UNICODE
  207. #define NetpUserGetInfo NetpUserGetInfoW
  208. #define NetpUserSetInfo NetpUserSetInfoW
  209. #define NetpGroupGetInfo NetpGroupGetInfoW
  210. #define NetpGroupSetInfo NetpGroupSetInfoW
  211. #define NetpUserModalsGet NetpUserModalsGetW
  212. #define NetpUserModalsSet NetpUserModalsSetW
  213. #else
  214. #define NetpUserGetInfo NetpUserGetInfoA
  215. #define NetpUserSetInfo NetpUserSetInfoA
  216. #define NetpGroupGetInfo NetpGroupGetInfoA
  217. #define NetpGroupSetInfo NetpGroupSetInfoA
  218. #define NetpUserModalsGet NetpUserModalsGetA
  219. #define NetpUserModalsSet NetpUserModalsSetA
  220. #endif //UNICODE
  221. //
  222. // EventLog
  223. //
  224. typedef LPBYTE ADT_HANDLE, *PADT_HANDLE;
  225. DWORD
  226. NetpCloseEventLog (
  227. IN ADT_HANDLE hEventLog
  228. );
  229. DWORD
  230. NetpClearEventLogA (
  231. IN ADT_HANDLE hEventLog,
  232. IN LPSTR lpBackupFileName
  233. );
  234. DWORD
  235. NetpOpenEventLogA (
  236. IN LPSTR lpUNCServerName,
  237. IN LPSTR lpModuleName,
  238. OUT PADT_HANDLE lpEventHandle
  239. );
  240. DWORD
  241. NetpReadEventLogA (
  242. IN ADT_HANDLE hEventLog,
  243. IN DWORD dwReadFlags,
  244. IN DWORD dwRecordOffset,
  245. OUT LPVOID lpBuffer,
  246. IN DWORD nNumberOfBytesToRead,
  247. OUT DWORD *pnBytesRead,
  248. OUT DWORD *pnMinNumberOfBytesNeeded
  249. );
  250. DWORD
  251. NetpWriteEventLogEntryA (
  252. IN ADT_HANDLE hEventLog,
  253. IN WORD wType,
  254. IN DWORD dwEventID,
  255. IN PSID lpUserSid OPTIONAL,
  256. IN WORD wNumStrings,
  257. IN DWORD dwDataSize,
  258. IN LPSTR *lpStrings OPTIONAL,
  259. IN LPVOID lpRawData OPTIONAL
  260. );