Source code of Windows XP (NT5)
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.

420 lines
8.8 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. nds95.h
  5. Abstract:
  6. Originally nds.h in WIN95 redirector's source, renamed to nds95.h due to
  7. name conflict.
  8. Win95 header for nds services.
  9. Author:
  10. Felix Wong (t-felixw) 27-Sep-1996
  11. Environment:
  12. Revision History:
  13. --*/
  14. /*
  15. * Netware Directory Services structures
  16. */
  17. #define DUMMY_ITER_HANDLE ((unsigned long) 0xffffffff)
  18. #define ENTRY_INFO_NAME_ONLY 0
  19. #define ENTRY_INFO_NAME_VALUE 1
  20. #define ENTRY_INFO_EFF_RIGHTS 2
  21. #define MAX_NDS_NAME_CHARS 256
  22. #define MAX_NDS_NAME_SIZE (MAX_NDS_NAME_CHARS*2)
  23. typedef DWORD DS_ENTRY_ID;
  24. typedef DWORD NDS_TIME;
  25. /*
  26. typedef struct {
  27. DWORD length;
  28. WORD text[];
  29. } NDS_STRING;
  30. typedef struct {
  31. DWORD syntaxId;
  32. NDS_STRING attribName;
  33. DWORD numValues;
  34. BYTE attribData[];
  35. } ATTRIB;
  36. */
  37. typedef struct {
  38. BYTE subFunction;
  39. DWORD fragHandle;
  40. DWORD maxFragSize;
  41. DWORD messageSize;
  42. DWORD fragFlags;
  43. DWORD verb;
  44. DWORD replyBufSize;
  45. } FRAG_REQ_HEADER;
  46. typedef struct {
  47. DWORD fragSize;
  48. DWORD fragHandle;
  49. } FRAG_REPLY_HEADER;
  50. #define NDSV_RESOLVE_NAME 1
  51. typedef struct {
  52. DWORD version;
  53. DWORD flags; // see below
  54. DWORD scope;
  55. //NDS_STRING targetName;
  56. // struct {
  57. // DWORD length = 1;
  58. // DWORD value = 0;
  59. // } transportType;
  60. // struct {
  61. // DWORD length = 1;
  62. // DWORD value = 0;
  63. //} treeWalkerType;
  64. } REQ_RESOLVE_NAME;
  65. // values for RESOLVE_NAME request flags
  66. //
  67. #define RSLV_DEREF_ALIASES 0x40
  68. #define RSLV_READABLE 0x02
  69. #define RSLV_WRITABLE 0x04
  70. #define RSLV_WALK_TREE 0x20
  71. #define RSLV_CREATE_ID 0x10
  72. #define RSLV_ENTRY_ID 0x1
  73. typedef struct {
  74. DWORD ccode;
  75. DWORD remoteEntry;
  76. DS_ENTRY_ID entryId;
  77. DWORD cServers;
  78. DWORD addrType;
  79. DWORD addrLength;
  80. //BYTE addr[addrLength];
  81. } REPLY_RESOLVE_NAME;
  82. #define NDSV_READ_ENTRY_INFO 2
  83. typedef struct {
  84. DWORD version;
  85. DWORD entryId;
  86. } REQ_READ_ENTRY_INFO;
  87. typedef struct {
  88. DWORD ccode;
  89. DWORD flags;
  90. DWORD subCount;
  91. DWORD modTime;
  92. //NDS_STRING BaseClass;
  93. //NDS_STRING EntryName;
  94. } REPLY_READ_ENTRY_INFO;
  95. #define NDSV_READ 3
  96. typedef struct {
  97. DWORD version;
  98. DWORD iterationHandle;
  99. DWORD entryId;
  100. DWORD infoType;
  101. DWORD allAttribs;
  102. DWORD numAttribs;
  103. //NDS_STRING attribNames[];
  104. } REQ_READ;
  105. typedef struct {
  106. DWORD ccode;
  107. DWORD iterationHandle;
  108. DWORD infoType;
  109. DWORD numAttribs;
  110. //ATTRIB attribs[];
  111. } REPLY_READ;
  112. #define NDSV_LIST 5
  113. typedef struct {
  114. DWORD version;
  115. DWORD flags;
  116. DWORD iterationHandle;
  117. DWORD parentEntryId;
  118. } REQ_LIST;
  119. typedef struct {
  120. DWORD ccode;
  121. DWORD iterationHandle;
  122. DWORD numEntries;
  123. // struct {
  124. // DWORD entryId;
  125. // DWORD flags;
  126. // DWORD subCount;
  127. // DWORD modTime;
  128. // NDS_STRING BaseClass;
  129. // NDS_STRING entryName;
  130. // } [];
  131. } REPLY_LIST;
  132. #define NDSV_SEARCH 6
  133. typedef struct {
  134. DWORD version; // 2
  135. DWORD flags; // 0x10000
  136. DWORD iterationHandle;
  137. DWORD baseEntryId;
  138. DWORD scope;
  139. DWORD numNodes;
  140. DWORD infoType;
  141. DWORD allAttribs;
  142. DWORD numAttribs;
  143. // Search clause
  144. } REQ_SEARCH;
  145. typedef struct {
  146. DWORD ccode;
  147. DWORD iterationHandle;
  148. DWORD nodesSearched;
  149. DWORD infoType;
  150. DWORD searchLength;
  151. DWORD numEntries;
  152. } REPLY_SEARCH;
  153. #define NDSV_MODIFY_ATTRIB 9
  154. typedef struct {
  155. DWORD version; // = 0
  156. DWORD flags;
  157. DWORD entryId; // object
  158. DWORD Count; // of changes
  159. // struct {
  160. // DWORD modifyType;
  161. // NDS_STRING attribName;
  162. // DWORD numValues;
  163. // ATTRIB attribValues[];
  164. // } Changes[];
  165. } REQ_MODIFY_ATTRIB;
  166. #define NDSV_DEFINE_ATTRIB 11
  167. typedef struct {
  168. DWORD version; // = 0
  169. DWORD AttribFlags;
  170. // NDS_STRING AttribName;
  171. // DWORD syntaxId;
  172. // DWORD lower;
  173. // DWORD upper;
  174. // DWORD asn1IdLength;
  175. // BYTE asn1Id[asn1IdLength];
  176. } REQ_DEFINE_ATTRIB;
  177. #define NDSV_MODIFY_CLASS 16
  178. #define NDSV_GET_EFF_RIGHTS 19
  179. #define NDSV_OPEN_STREAM 27
  180. typedef struct {
  181. DWORD version;
  182. DWORD flags;
  183. DWORD entryId;
  184. // NDS_STRING AttribName;
  185. } REQ_OPEN_STREAM;
  186. typedef struct {
  187. DWORD ccode;
  188. DWORD hNWFile;
  189. DWORD fileLength;
  190. } REPLY_OPEN_STREAM;
  191. #define NDSV_GET_SERVER_ADDRESS 53
  192. typedef struct {
  193. DWORD syntaxId; // = 9 (OCTET STRING)
  194. struct {
  195. DWORD nameLength;
  196. WORD name[11]; // "Public Key"
  197. WORD filler;
  198. } attribName;
  199. DWORD entries; // = 1
  200. DWORD totalLength; // of attribute value OCTET STRING
  201. DWORD unknown1; // =1
  202. DWORD unknown2; // = 4
  203. WORD _issuerDNLength;
  204. WORD totalDNLength;
  205. WORD length2;
  206. WORD length3;
  207. WORD issuerDNLength;
  208. WORD userDNLength;
  209. WORD bsafeSectionLength;
  210. DWORD length4;
  211. //WORD issuerDN[];
  212. //WORD userDN[];
  213. //DWORD unknown3;
  214. //DWORD unknown4;
  215. // WORD bsafePubKeyLength;
  216. } PUBLIC_KEY_ATTRIB;
  217. typedef struct {
  218. DWORD blockLength; // cipherLength + size of following hdr fields
  219. DWORD version; // = 1
  220. DWORD encType; // 0x060001 for RC2; 0x090001 and 0x0A0001 for RSA
  221. WORD cipherLength; // of ciphertext
  222. WORD dataLength; // of plaintext
  223. } ENC_BLOCK_HDR;
  224. typedef struct {
  225. DWORD version;
  226. WORD tag;
  227. } TAG_DATA_HEADER;
  228. #define TAG_PRIVATE_KEY 2
  229. #define TAG_PUBLIC_KEY 4
  230. #define TAG_CREDENTIAL 6
  231. #define TAG_SIGNATURE 7
  232. #define TAG_PROOF 8
  233. typedef struct {
  234. TAG_DATA_HEADER tdh;
  235. NDS_TIME validityBegin;
  236. NDS_TIME validityEnd;
  237. DWORD random;
  238. WORD optDataSize;
  239. WORD userNameLength;
  240. // BYTE optData[optDataSize];
  241. // BYTE userName[userNameLength];
  242. } NDS_CREDENTIAL;
  243. typedef struct {
  244. TAG_DATA_HEADER tdh;
  245. WORD signDataLength;
  246. //BYTE signData[signLength];
  247. } NDS_SIGNATURE;
  248. typedef struct {
  249. TAG_DATA_HEADER tdh;
  250. WORD keyDataLength;
  251. //BYTE BsafeKeyData[keyDataLength];
  252. } NDS_PRIVATE_KEY;
  253. typedef struct {
  254. DWORD challenge;
  255. DWORD oldPwLength; // 16
  256. BYTE oldPwHash[16];
  257. DWORD newPwStrLength; //password length
  258. DWORD newPwLength; // 16
  259. BYTE newPwHash[16];
  260. ENC_BLOCK_HDR encPrivKeyHdr;
  261. // BYTE encPrivKey[];
  262. } NDS_CHPW_MSG;
  263. #define NDSV_CHANGE_PASSWORD 55
  264. typedef struct {
  265. DWORD version; // = 0
  266. DWORD entryId;
  267. DWORD totalLength;
  268. DWORD secVersion; // = 1
  269. DWORD envelopId1; // 0x00020009
  270. DWORD envelopLength1;
  271. //ENC_BLOCK_HDR rsaHeader; // secret key data encrypted with RSA
  272. //BYTE rsaCipher[53]; // 53 + 3 pad bytes
  273. //BYTE pad[3];
  274. //ENC_BLOCK_HDR rc2Header;
  275. //BYTE rc2Cipher[];
  276. } REQ_CHANGE_PASSWORD;
  277. #define NDSV_BEGIN_LOGIN 57
  278. typedef struct {
  279. DWORD version;
  280. DWORD entryId;
  281. } REQ_BEGIN_LOGIN;
  282. typedef struct {
  283. DWORD ccode;
  284. DWORD entryId; // need not be same as in request
  285. DWORD challenge;
  286. } REPLY_BEGIN_LOGIN;
  287. #define NDSV_FINISH_LOGIN 58
  288. typedef struct {
  289. DWORD version;
  290. DWORD flags; // = 0
  291. DWORD entryId;
  292. DWORD totalLength; // = 0x494
  293. DWORD secVersion; // = 1
  294. DWORD envelopId1; // 0x00020009
  295. DWORD envelopLength1; // 0x488
  296. //ENC_BLOCK_HDR rsaHeader; // secret key data encrypted with RSA
  297. //BYTE rsaCipher[53]; // 53 + 3 pad bytes
  298. //BYTE pad[3];
  299. //ENC_BLOCK_HDR rc2Header;
  300. //BYTE rc2Cipher[0x430];
  301. } REQ_FINISH_LOGIN;
  302. typedef struct {
  303. DWORD ccode;
  304. DWORD valStart;
  305. DWORD valEnd;
  306. //ENC_BLOCK_HDR rc2Header;
  307. //BYTE rc2Cipher[0x140];
  308. } REPLY_FINISH_LOGIN;
  309. #define NDSV_BEGIN_AUTHENTICATE 59
  310. typedef struct {
  311. DWORD version;
  312. DWORD entryId;
  313. DWORD clientRand;
  314. } REQ_BEGIN_AUTHENTICATE;
  315. typedef struct {
  316. DWORD svrRand;
  317. DWORD totalLength;
  318. TAG_DATA_HEADER tdh;
  319. WORD unknown; // = 2
  320. DWORD encClientRandLength;
  321. //CIPHER_BLOCK_HEADER keyCipherHdr;
  322. //BYTE keyCipher[];
  323. //CIPHER_BLOCK_HEADER encClientRandHdr;
  324. //BYTE encClientRand[];
  325. } REPLY_BEGIN_AUTHENTICATE;
  326. #define NDSV_FINISH_AUTHENTICATE 60
  327. //typedef struct {
  328. // DWORD sessionKeyLength;
  329. // BYTE encSessionKey[sessionKeyLength];
  330. // DWORD credentialLength;
  331. // BYTE credential[credentialLength];
  332. // WORD unknown = 0;
  333. // DWORD proofLength;
  334. // TAG_DATA_HEADER proofTDH;
  335. // WORD log2DigestBase; //=16
  336. // WORD proofOrder; //=3;
  337. // totalXLength;
  338. // BYTE x1[];
  339. // BYTE x2[];
  340. // BYTE x3[];
  341. // BYTE y1[];
  342. // BYTE y2[];
  343. // BYTE y3[];
  344. // } REQ_FINISH_AUTHENTICATE;
  345. #define NDSV_LOGOUT 61
  346. #define ROUNDUP4(x) (((x)+3)&(~3))
  347. // Transport type
  348. // referral scope
  349. #define ANY_SCOPE 0
  350. #define COUNTRY_SCOPE 1
  351. #define ORGANIZATION_SCOPE 2
  352. #define LOCAL_SCOPE 3