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.

665 lines
13 KiB

  1. #include "dspch.h"
  2. #pragma hdrstop
  3. #define _DSGETDCAPI_
  4. #include <dsgetdc.h>
  5. #include <lm.h>
  6. #include <icanon.h>
  7. #include <dsrole.h>
  8. #include <nb30.h>
  9. #include <winsock2.h>
  10. #include <netlibnt.h>
  11. static
  12. DWORD
  13. WINAPI
  14. DsEnumerateDomainTrustsW(
  15. LPWSTR ServerName,
  16. ULONG Flags,
  17. PDS_DOMAIN_TRUSTSW *Domains,
  18. PULONG DomainCount
  19. )
  20. {
  21. *Domains = NULL;
  22. *DomainCount = 0;
  23. return ERROR_PROC_NOT_FOUND;
  24. }
  25. static
  26. DWORD
  27. WINAPI
  28. DsGetDcNameW(
  29. IN LPCWSTR ComputerName OPTIONAL,
  30. IN LPCWSTR DomainName OPTIONAL,
  31. IN GUID *DomainGuid OPTIONAL,
  32. IN LPCWSTR SiteName OPTIONAL,
  33. IN ULONG Flags,
  34. OUT PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  35. )
  36. {
  37. return ERROR_PROC_NOT_FOUND;
  38. }
  39. static
  40. DWORD
  41. WINAPI
  42. DsGetDcNameWithAccountW(
  43. IN LPCWSTR ComputerName OPTIONAL,
  44. IN LPCWSTR AccountName OPTIONAL,
  45. IN ULONG AllowableAccountControlBits,
  46. IN LPCWSTR DomainName OPTIONAL,
  47. IN GUID *DomainGuid OPTIONAL,
  48. IN LPCWSTR SiteName OPTIONAL,
  49. IN ULONG Flags,
  50. OUT PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo
  51. )
  52. {
  53. return ERROR_PROC_NOT_FOUND;
  54. }
  55. static
  56. VOID
  57. WINAPI
  58. DsRoleFreeMemory(
  59. IN PVOID Buffer
  60. )
  61. {
  62. return;
  63. }
  64. static
  65. DWORD
  66. WINAPI
  67. DsRoleGetPrimaryDomainInformation(
  68. IN LPCWSTR lpServer OPTIONAL,
  69. IN DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel,
  70. OUT PBYTE *Buffer
  71. )
  72. {
  73. return ERROR_PROC_NOT_FOUND;
  74. }
  75. static
  76. DWORD
  77. WINAPI
  78. DsAddressToSiteNamesW(
  79. IN LPCWSTR ComputerName,
  80. IN DWORD EntryCount,
  81. IN PSOCKET_ADDRESS SocketAddresses,
  82. OUT LPWSTR **SiteNames
  83. )
  84. {
  85. return ERROR_PROC_NOT_FOUND;
  86. }
  87. static
  88. DWORD
  89. WINAPI
  90. DsGetDcSiteCoverageW(
  91. IN LPCWSTR ServerName,
  92. OUT PULONG EntryCount,
  93. OUT LPWSTR **SiteNames
  94. )
  95. {
  96. return ERROR_PROC_NOT_FOUND;
  97. }
  98. static
  99. NET_API_STATUS
  100. NET_API_FUNCTION
  101. I_NetNameCanonicalize(
  102. IN LPTSTR ServerName OPTIONAL,
  103. IN LPTSTR Name,
  104. OUT LPTSTR Outbuf,
  105. IN DWORD OutbufLen,
  106. IN DWORD NameType,
  107. IN DWORD Flags
  108. )
  109. {
  110. return ERROR_PROC_NOT_FOUND;
  111. }
  112. static
  113. NET_API_STATUS
  114. NET_API_FUNCTION
  115. I_NetNameValidate(
  116. IN LPWSTR ServerName OPTIONAL,
  117. IN LPWSTR Name,
  118. IN DWORD NameType,
  119. IN DWORD Flags
  120. )
  121. {
  122. return ERROR_PROC_NOT_FOUND;
  123. }
  124. static
  125. NET_API_STATUS NET_API_FUNCTION
  126. NetAlertRaiseEx(
  127. IN LPCWSTR AlertEventName,
  128. IN LPVOID VariableInfo,
  129. IN DWORD VariableInfoSize,
  130. IN LPCWSTR ServiceName
  131. )
  132. {
  133. return ERROR_PROC_NOT_FOUND;
  134. }
  135. static
  136. NET_API_STATUS
  137. NET_API_FUNCTION
  138. NetApiBufferAllocate (
  139. IN DWORD ByteCount,
  140. OUT LPVOID *Buffer
  141. )
  142. {
  143. return ERROR_PROC_NOT_FOUND;
  144. }
  145. static
  146. NET_API_STATUS
  147. NET_API_FUNCTION
  148. NetApiBufferFree (
  149. IN LPVOID Buffer
  150. )
  151. {
  152. return ERROR_PROC_NOT_FOUND;
  153. }
  154. static
  155. NET_API_STATUS NET_API_FUNCTION
  156. NetDfsGetClientInfo(
  157. IN LPWSTR DfsEntryPath,
  158. IN LPWSTR ServerName OPTIONAL,
  159. IN LPWSTR ShareName OPTIONAL,
  160. IN DWORD Level,
  161. OUT LPBYTE* Buffer)
  162. {
  163. return ERROR_PROC_NOT_FOUND;
  164. }
  165. static
  166. NET_API_STATUS NET_API_FUNCTION
  167. NetDfsGetInfo(
  168. IN LPWSTR DfsEntryPath,
  169. IN LPWSTR ServerName OPTIONAL,
  170. IN LPWSTR ShareName OPTIONAL,
  171. IN DWORD Level,
  172. OUT LPBYTE* Buffer
  173. )
  174. {
  175. return ERROR_PROC_NOT_FOUND;
  176. }
  177. static
  178. NTSTATUS
  179. NET_API_FUNCTION
  180. NetEnumerateTrustedDomains (
  181. IN LPWSTR ServerName OPTIONAL,
  182. OUT LPWSTR *DomainNames
  183. )
  184. {
  185. return STATUS_PROCEDURE_NOT_FOUND;
  186. }
  187. static
  188. NET_API_STATUS NET_API_FUNCTION
  189. NetGetDCName (
  190. IN LPCWSTR servername OPTIONAL,
  191. IN LPCWSTR domainname OPTIONAL,
  192. OUT LPBYTE *bufptr
  193. )
  194. {
  195. return ERROR_PROC_NOT_FOUND;
  196. }
  197. static
  198. NET_API_STATUS
  199. NET_API_FUNCTION
  200. NetGetJoinInformation(
  201. IN LPCWSTR lpServer OPTIONAL,
  202. OUT LPWSTR *lpNameBuffer,
  203. OUT PNETSETUP_JOIN_STATUS BufferType
  204. )
  205. {
  206. return ERROR_PROC_NOT_FOUND;
  207. }
  208. static
  209. NET_API_STATUS
  210. NET_API_FUNCTION
  211. NetJoinDomain(
  212. IN LPCWSTR lpServer OPTIONAL,
  213. IN LPCWSTR lpDomain,
  214. IN LPCWSTR lpAccountOU, OPTIONAL
  215. IN LPCWSTR lpAccount OPTIONAL,
  216. IN LPCWSTR lpPassword OPTIONAL,
  217. IN DWORD fJoinOptions
  218. )
  219. {
  220. return ERROR_PROC_NOT_FOUND;
  221. }
  222. static
  223. NET_API_STATUS
  224. NET_API_FUNCTION
  225. NetLocalGroupGetMembers(
  226. IN LPCWSTR ServerName OPTIONAL,
  227. IN LPCWSTR LocalGroupName,
  228. IN DWORD Level,
  229. OUT LPBYTE *Buffer,
  230. IN DWORD PrefMaxLen,
  231. OUT LPDWORD EntriesRead,
  232. OUT LPDWORD EntriesLeft,
  233. IN OUT PDWORD_PTR ResumeHandle
  234. )
  235. {
  236. return ERROR_PROC_NOT_FOUND;
  237. }
  238. static
  239. NET_API_STATUS NET_API_FUNCTION
  240. NetMessageBufferSend (
  241. IN LPCWSTR servername OPTIONAL,
  242. IN LPCWSTR msgname,
  243. IN LPCWSTR fromname,
  244. IN LPBYTE buf,
  245. IN DWORD buflen
  246. )
  247. {
  248. return ERROR_PROC_NOT_FOUND;
  249. }
  250. static
  251. NET_API_STATUS NET_API_FUNCTION
  252. NetQueryDisplayInformation(
  253. IN LPCWSTR ServerName OPTIONAL,
  254. IN DWORD Level,
  255. IN DWORD Index,
  256. IN DWORD EntriesRequested,
  257. IN DWORD PreferredMaximumLength,
  258. OUT LPDWORD ReturnedEntryCount,
  259. OUT PVOID *SortedBuffer
  260. )
  261. {
  262. return ERROR_PROC_NOT_FOUND;
  263. }
  264. static
  265. NET_API_STATUS
  266. NET_API_FUNCTION
  267. NetRemoteComputerSupports(
  268. IN LPCWSTR UncServerName OPTIONAL,
  269. IN DWORD OptionsWanted,
  270. OUT LPDWORD OptionsSupported
  271. )
  272. {
  273. return ERROR_PROC_NOT_FOUND;
  274. }
  275. static
  276. NET_API_STATUS
  277. NET_API_FUNCTION
  278. NetRenameMachineInDomain(
  279. IN LPCWSTR lpServer OPTIONAL,
  280. IN LPCWSTR lpNewMachineName OPTIONAL,
  281. IN LPCWSTR lpAccount OPTIONAL,
  282. IN LPCWSTR lpPassword OPTIONAL,
  283. IN DWORD fRenameOptions
  284. )
  285. {
  286. return ERROR_PROC_NOT_FOUND;
  287. }
  288. static
  289. NET_API_STATUS
  290. NET_API_FUNCTION
  291. NetServerSetInfo (
  292. IN LPWSTR servername OPTIONAL,
  293. IN DWORD level,
  294. IN LPBYTE buf,
  295. OUT LPDWORD ParmError OPTIONAL
  296. )
  297. {
  298. return ERROR_PROC_NOT_FOUND;
  299. }
  300. static
  301. NET_API_STATUS NET_API_FUNCTION
  302. NetSessionEnum (
  303. IN LPTSTR servername,
  304. IN LPTSTR clientname,
  305. IN LPTSTR username,
  306. IN DWORD level,
  307. OUT LPBYTE *bufptr,
  308. IN DWORD prefmaxlen,
  309. OUT LPDWORD entriesread,
  310. OUT LPDWORD totalentries,
  311. IN OUT LPDWORD resume_handle
  312. )
  313. {
  314. return ERROR_PROC_NOT_FOUND;
  315. }
  316. static
  317. NET_API_STATUS NET_API_FUNCTION
  318. NetShareAdd (
  319. IN LMSTR servername,
  320. IN DWORD level,
  321. IN LPBYTE buf,
  322. OUT LPDWORD parm_err
  323. )
  324. {
  325. return ERROR_PROC_NOT_FOUND;
  326. }
  327. static
  328. NET_API_STATUS NET_API_FUNCTION
  329. NetShareDel (
  330. IN LMSTR servername,
  331. IN LMSTR netname,
  332. IN DWORD reserved
  333. )
  334. {
  335. return ERROR_PROC_NOT_FOUND;
  336. }
  337. static
  338. NET_API_STATUS NET_API_FUNCTION
  339. NetShareGetInfo(
  340. IN LMSTR servername,
  341. IN LMSTR netname,
  342. IN DWORD level,
  343. OUT LPBYTE *bufptr
  344. )
  345. {
  346. return ERROR_PROC_NOT_FOUND;
  347. }
  348. static
  349. NET_API_STATUS NET_API_FUNCTION
  350. NetShareSetInfo (
  351. IN LMSTR servername,
  352. IN LMSTR netname,
  353. IN DWORD level,
  354. IN LPBYTE buf,
  355. OUT LPDWORD parm_err
  356. )
  357. {
  358. return ERROR_PROC_NOT_FOUND;
  359. }
  360. static
  361. NET_API_STATUS
  362. NET_API_FUNCTION
  363. NetUnjoinDomain(
  364. IN LPCWSTR lpServer OPTIONAL,
  365. IN LPCWSTR lpAccount OPTIONAL,
  366. IN LPCWSTR lpPassword OPTIONAL,
  367. IN DWORD fUnjoinOptions
  368. )
  369. {
  370. return ERROR_PROC_NOT_FOUND;
  371. }
  372. static
  373. NET_API_STATUS NET_API_FUNCTION
  374. NetUserAdd(
  375. IN LPCWSTR ServerName OPTIONAL,
  376. IN DWORD Level,
  377. IN LPBYTE Buffer,
  378. OUT LPDWORD ParmError OPTIONAL
  379. )
  380. {
  381. return ERROR_PROC_NOT_FOUND;
  382. }
  383. static
  384. NET_API_STATUS NET_API_FUNCTION
  385. NetUserChangePassword(
  386. IN LPCWSTR DomainName,
  387. IN LPCWSTR UserName,
  388. IN LPCWSTR OldPassword,
  389. IN LPCWSTR NewPassword
  390. )
  391. {
  392. return ERROR_PROC_NOT_FOUND;
  393. }
  394. static
  395. NET_API_STATUS NET_API_FUNCTION
  396. NetUserDel(
  397. IN LPCWSTR ServerName OPTIONAL,
  398. IN LPCWSTR UserName
  399. )
  400. {
  401. return ERROR_PROC_NOT_FOUND;
  402. }
  403. static
  404. NET_API_STATUS
  405. NET_API_FUNCTION
  406. NetUserGetGroups(
  407. IN LPCWSTR ServerName OPTIONAL,
  408. IN LPCWSTR UserName,
  409. IN DWORD Level,
  410. OUT LPBYTE *Buffer,
  411. IN DWORD PrefMaxLen,
  412. OUT LPDWORD EntriesRead,
  413. OUT LPDWORD EntriesLeft
  414. )
  415. {
  416. return ERROR_PROC_NOT_FOUND;
  417. }
  418. static
  419. NET_API_STATUS
  420. NET_API_FUNCTION
  421. NetUserGetInfo (
  422. IN LPCWSTR servername OPTIONAL,
  423. IN LPCWSTR username,
  424. IN DWORD level,
  425. OUT LPBYTE *bufptr
  426. )
  427. {
  428. return ERROR_PROC_NOT_FOUND;
  429. }
  430. static
  431. NET_API_STATUS
  432. NET_API_FUNCTION
  433. NetUserGetLocalGroups(
  434. IN LPCWSTR ServerName OPTIONAL,
  435. IN LPCWSTR UserName,
  436. IN DWORD Level,
  437. IN DWORD Flags,
  438. OUT LPBYTE *Buffer,
  439. IN DWORD PrefMaxLen,
  440. OUT LPDWORD EntriesRead,
  441. OUT LPDWORD EntriesLeft
  442. )
  443. {
  444. return ERROR_PROC_NOT_FOUND;
  445. }
  446. static
  447. NET_API_STATUS NET_API_FUNCTION
  448. NetUserModalsGet(
  449. IN LPCWSTR ServerName OPTIONAL,
  450. IN DWORD Level,
  451. OUT LPBYTE *Buffer
  452. )
  453. {
  454. return ERROR_PROC_NOT_FOUND;
  455. }
  456. static
  457. NET_API_STATUS NET_API_FUNCTION
  458. NetUserSetInfo(
  459. IN LPCWSTR ServerName OPTIONAL,
  460. IN LPCWSTR UserName,
  461. IN DWORD Level,
  462. IN LPBYTE Buffer,
  463. OUT LPDWORD ParmError OPTIONAL
  464. )
  465. {
  466. return ERROR_PROC_NOT_FOUND;
  467. }
  468. static
  469. NET_API_STATUS
  470. NET_API_FUNCTION
  471. NetValidateName(
  472. IN LPCWSTR lpServer OPTIONAL,
  473. IN LPCWSTR lpName,
  474. IN LPCWSTR lpAccount OPTIONAL,
  475. IN LPCWSTR lpPassword OPTIONAL,
  476. IN NETSETUP_NAME_TYPE NameType
  477. )
  478. {
  479. return ERROR_PROC_NOT_FOUND;
  480. }
  481. static
  482. NET_API_STATUS NET_API_FUNCTION
  483. NetWkstaGetInfo(
  484. IN LPTSTR servername OPTIONAL,
  485. IN DWORD level,
  486. OUT LPBYTE *bufptr
  487. )
  488. {
  489. return ERROR_PROC_NOT_FOUND;
  490. }
  491. static
  492. NET_API_STATUS NET_API_FUNCTION
  493. NetWkstaUserGetInfo (
  494. IN LPWSTR reserved,
  495. IN DWORD level,
  496. OUT LPBYTE *bufptr
  497. )
  498. {
  499. return ERROR_PROC_NOT_FOUND;
  500. }
  501. static
  502. UCHAR
  503. APIENTRY
  504. Netbios(
  505. PNCB pncb
  506. )
  507. {
  508. return NRC_SYSTEM;
  509. }
  510. static
  511. NTSTATUS
  512. NetpApiStatusToNtStatus(
  513. NET_API_STATUS NetStatus
  514. )
  515. {
  516. return STATUS_PROCEDURE_NOT_FOUND;
  517. }
  518. static
  519. NET_API_STATUS
  520. NET_API_FUNCTION
  521. NetpIsRemote(
  522. IN LPWSTR ComputerName OPTIONAL,
  523. OUT LPDWORD LocalOrRemote,
  524. OUT LPWSTR CanonicalizedName OPTIONAL,
  525. IN DWORD cchCanonName,
  526. IN DWORD Flags
  527. )
  528. {
  529. return ERROR_PROC_NOT_FOUND;
  530. }
  531. static
  532. NET_API_STATUS
  533. NET_API_FUNCTION
  534. NetpUpgradePreNT5JoinInfo( VOID )
  535. {
  536. return ERROR_PROC_NOT_FOUND;
  537. }
  538. static
  539. NET_API_STATUS
  540. NET_API_FUNCTION
  541. NetServerGetInfo(
  542. IN LMSTR servername OPTIONAL,
  543. IN DWORD level,
  544. OUT LPBYTE *bufptr
  545. )
  546. {
  547. return ERROR_PROC_NOT_FOUND;
  548. }
  549. static
  550. NET_API_STATUS
  551. RxNetUserPasswordSet(
  552. IN LPTSTR ServerName,
  553. IN LPTSTR UserName,
  554. IN LPTSTR OldPassword,
  555. IN LPTSTR NewPassword
  556. )
  557. {
  558. return ERROR_PROC_NOT_FOUND;
  559. }
  560. //
  561. // !! WARNING !! The entries below must be in alphabetical order
  562. // and are CASE SENSITIVE (i.e., lower case comes last!)
  563. //
  564. DEFINE_PROCNAME_ENTRIES(netapi32)
  565. {
  566. DLPENTRY(DsAddressToSiteNamesW)
  567. DLPENTRY(DsEnumerateDomainTrustsW)
  568. DLPENTRY(DsGetDcNameW)
  569. DLPENTRY(DsGetDcNameWithAccountW)
  570. DLPENTRY(DsGetDcSiteCoverageW)
  571. DLPENTRY(DsRoleFreeMemory)
  572. DLPENTRY(DsRoleGetPrimaryDomainInformation)
  573. DLPENTRY(I_NetNameCanonicalize)
  574. DLPENTRY(I_NetNameValidate)
  575. DLPENTRY(NetAlertRaiseEx)
  576. DLPENTRY(NetApiBufferAllocate)
  577. DLPENTRY(NetApiBufferFree)
  578. DLPENTRY(NetDfsGetClientInfo)
  579. DLPENTRY(NetDfsGetInfo)
  580. DLPENTRY(NetEnumerateTrustedDomains)
  581. DLPENTRY(NetGetDCName)
  582. DLPENTRY(NetGetJoinInformation)
  583. DLPENTRY(NetJoinDomain)
  584. DLPENTRY(NetLocalGroupGetMembers)
  585. DLPENTRY(NetMessageBufferSend)
  586. DLPENTRY(NetQueryDisplayInformation)
  587. DLPENTRY(NetRemoteComputerSupports)
  588. DLPENTRY(NetRenameMachineInDomain)
  589. DLPENTRY(NetServerGetInfo)
  590. DLPENTRY(NetServerSetInfo)
  591. DLPENTRY(NetSessionEnum)
  592. DLPENTRY(NetShareAdd)
  593. DLPENTRY(NetShareDel)
  594. DLPENTRY(NetShareGetInfo)
  595. DLPENTRY(NetShareSetInfo)
  596. DLPENTRY(NetUnjoinDomain)
  597. DLPENTRY(NetUserAdd)
  598. DLPENTRY(NetUserChangePassword)
  599. DLPENTRY(NetUserDel)
  600. DLPENTRY(NetUserGetGroups)
  601. DLPENTRY(NetUserGetInfo)
  602. DLPENTRY(NetUserGetLocalGroups)
  603. DLPENTRY(NetUserModalsGet)
  604. DLPENTRY(NetUserSetInfo)
  605. DLPENTRY(NetValidateName)
  606. DLPENTRY(NetWkstaGetInfo)
  607. DLPENTRY(NetWkstaUserGetInfo)
  608. DLPENTRY(Netbios)
  609. DLPENTRY(NetpApiStatusToNtStatus)
  610. DLPENTRY(NetpIsRemote)
  611. DLPENTRY(NetpUpgradePreNT5JoinInfo)
  612. DLPENTRY(RxNetUserPasswordSet)
  613. };
  614. DEFINE_PROCNAME_MAP(netapi32)