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.

1006 lines
18 KiB

  1. //
  2. // Copyright (c) Microsoft Corporation
  3. //
  4. #include "pch.h"
  5. #include "dloadexcept.h"
  6. #pragma hdrstop
  7. #include "winreg.h"
  8. #include "ntelfapi.h"
  9. #include <wincrypt.h>
  10. #include <winsafer.h>
  11. #include <Aclapi.h>
  12. /*
  13. Elf == Event Log
  14. a notable difference between Elf and the Win32 API is Elf accepts non nul terminated UNICODE_STRINGs.
  15. */
  16. static
  17. NTSTATUS
  18. NTAPI
  19. ElfReportEventW(
  20. IN HANDLE LogHandle,
  21. IN USHORT EventType,
  22. IN USHORT EventCategory OPTIONAL,
  23. IN ULONG EventID,
  24. IN PSID UserSid OPTIONAL,
  25. IN USHORT NumStrings,
  26. IN ULONG DataSize,
  27. IN PUNICODE_STRING* Strings OPTIONAL,
  28. IN PVOID Data OPTIONAL,
  29. IN USHORT Flags,
  30. IN OUT PULONG RecordNumber OPTIONAL,
  31. IN OUT PULONG TimeWritten OPTIONAL
  32. )
  33. {
  34. if (ARGUMENT_PRESENT(RecordNumber))
  35. {
  36. *RecordNumber = 0;
  37. }
  38. if (ARGUMENT_PRESENT(TimeWritten))
  39. {
  40. *TimeWritten = 0;
  41. }
  42. return DelayLoad_GetNtStatus();
  43. }
  44. static
  45. NTSTATUS
  46. NTAPI
  47. ElfRegisterEventSourceW(
  48. IN PUNICODE_STRING UNCServerName,
  49. IN PUNICODE_STRING SourceName,
  50. OUT PHANDLE LogHandle
  51. )
  52. {
  53. if (ARGUMENT_PRESENT(LogHandle))
  54. {
  55. *LogHandle = NULL;
  56. }
  57. return DelayLoad_GetNtStatus();
  58. }
  59. static
  60. NTSTATUS
  61. NTAPI
  62. ElfDeregisterEventSource(
  63. IN HANDLE LogHandle
  64. )
  65. {
  66. return DelayLoad_GetNtStatus();
  67. }
  68. static
  69. LONG
  70. APIENTRY
  71. RegCreateKeyW (
  72. IN HKEY hKey,
  73. IN LPCWSTR lpSubKey,
  74. OUT PHKEY phkResult
  75. )
  76. {
  77. return DelayLoad_GetWin32Error();
  78. }
  79. static
  80. LONG
  81. APIENTRY
  82. RegCreateKeyExW(
  83. IN HKEY hKey,
  84. IN PCWSTR lpSubKey,
  85. IN DWORD Reserved,
  86. IN PWSTR lpClass,
  87. IN DWORD dwOptions,
  88. IN REGSAM samDesired,
  89. IN PSECURITY_ATTRIBUTES lpSecurityAttributes,
  90. OUT PHKEY phkResult,
  91. OUT LPDWORD lpdwDisposition
  92. )
  93. {
  94. if (ARGUMENT_PRESENT(phkResult))
  95. {
  96. *phkResult = INVALID_HANDLE_VALUE;
  97. }
  98. if (ARGUMENT_PRESENT(lpdwDisposition))
  99. {
  100. *lpdwDisposition = 0;
  101. }
  102. return DelayLoad_GetWin32Error();
  103. }
  104. static
  105. LONG
  106. APIENTRY
  107. RegOpenKeyExA (
  108. IN HKEY hKey,
  109. IN LPCSTR lpSubKey,
  110. IN DWORD ulOptions,
  111. IN REGSAM samDesired,
  112. OUT PHKEY phkResult
  113. )
  114. {
  115. return DelayLoad_GetWin32Error();
  116. }
  117. static
  118. LONG
  119. APIENTRY
  120. RegOpenKeyExW(
  121. IN HKEY hKey,
  122. IN PCWSTR lpSubKey,
  123. IN DWORD ulOptions,
  124. IN REGSAM samDesired,
  125. OUT PHKEY phkResult
  126. )
  127. {
  128. if (ARGUMENT_PRESENT(phkResult))
  129. {
  130. *phkResult = INVALID_HANDLE_VALUE;
  131. }
  132. return DelayLoad_GetWin32Error();
  133. }
  134. static
  135. LONG
  136. APIENTRY
  137. RegSetValueExA (
  138. IN HKEY hKey,
  139. IN LPCSTR lpValueName,
  140. IN DWORD Reserved,
  141. IN DWORD dwType,
  142. IN CONST BYTE* lpData,
  143. IN DWORD cbData
  144. )
  145. {
  146. return DelayLoad_GetWin32Error();
  147. }
  148. static
  149. LONG
  150. APIENTRY
  151. RegSetValueExW (
  152. IN HKEY hKey,
  153. IN LPCWSTR lpValueName,
  154. IN DWORD Reserved,
  155. IN DWORD dwType,
  156. IN CONST BYTE* lpData,
  157. IN DWORD cbData
  158. )
  159. {
  160. return DelayLoad_GetWin32Error();
  161. }
  162. static
  163. LONG
  164. APIENTRY
  165. RegQueryValueExA (
  166. IN HKEY hKey,
  167. IN LPCSTR lpValueName,
  168. IN LPDWORD lpReserved,
  169. OUT LPDWORD lpType,
  170. IN OUT LPBYTE lpData,
  171. IN OUT LPDWORD lpcbData
  172. )
  173. {
  174. return DelayLoad_GetWin32Error();
  175. }
  176. static
  177. LONG
  178. APIENTRY
  179. RegQueryValueExW(
  180. IN HKEY hKey,
  181. IN PCWSTR lpValueName,
  182. IN LPDWORD lpReserved,
  183. OUT LPDWORD lpType,
  184. IN OUT LPBYTE lpData,
  185. IN OUT LPDWORD lpcbData
  186. )
  187. {
  188. if (ARGUMENT_PRESENT(lpType))
  189. {
  190. *lpType = 0;
  191. }
  192. if (ARGUMENT_PRESENT(lpcbData))
  193. {
  194. *lpcbData = 0;
  195. }
  196. return DelayLoad_GetWin32Error();
  197. }
  198. static
  199. BOOL
  200. WINAPI
  201. GetUserNameW (
  202. OUT LPWSTR lpBuffer,
  203. IN OUT LPDWORD nSize
  204. )
  205. {
  206. DelayLoad_SetLastNtStatusAndWin32Error();
  207. return FALSE;
  208. }
  209. static
  210. LONG
  211. APIENTRY
  212. RegCloseKey(
  213. IN HKEY hKey
  214. )
  215. {
  216. return DelayLoad_GetWin32Error();
  217. }
  218. static
  219. LONG
  220. APIENTRY
  221. RegDeleteKeyW(
  222. IN HKEY hKey,
  223. IN PCWSTR lpSubKey
  224. )
  225. {
  226. return DelayLoad_GetWin32Error();
  227. }
  228. static
  229. BOOL
  230. WINAPI
  231. QueryServiceStatus(
  232. SC_HANDLE hService,
  233. LPSERVICE_STATUS lpServiceStatus
  234. )
  235. {
  236. DelayLoad_SetLastNtStatusAndWin32Error();
  237. return FALSE;
  238. }
  239. static
  240. LONG
  241. APIENTRY
  242. RegSaveKeyA(
  243. IN HKEY hKey,
  244. IN PCSTR lpFile,
  245. IN LPSECURITY_ATTRIBUTES lpSecurity
  246. )
  247. {
  248. return DelayLoad_GetWin32Error();
  249. }
  250. static
  251. LONG
  252. APIENTRY
  253. RegSaveKeyExW(
  254. IN HKEY hKey,
  255. IN PCWSTR lpFile,
  256. IN LPSECURITY_ATTRIBUTES lpSecurity,
  257. DWORD Flags
  258. )
  259. {
  260. return DelayLoad_GetWin32Error();
  261. }
  262. static
  263. LONG
  264. APIENTRY
  265. RegSaveKeyW(
  266. IN HKEY hKey,
  267. IN PCWSTR lpFile,
  268. IN LPSECURITY_ATTRIBUTES lpSecurity
  269. )
  270. {
  271. return DelayLoad_GetWin32Error();
  272. }
  273. static
  274. LONG
  275. APIENTRY
  276. RegDeleteValueW(
  277. IN HKEY hKey,
  278. IN PCWSTR lpValueName
  279. )
  280. {
  281. return DelayLoad_GetWin32Error();
  282. }
  283. static
  284. LONG
  285. APIENTRY
  286. RegNotifyChangeKeyValue(
  287. IN HKEY hKey,
  288. IN BOOL bWatchSubtree,
  289. IN DWORD dwNotifyFilter,
  290. IN HANDLE hEvent,
  291. IN BOOL fAsynchronus
  292. )
  293. {
  294. return DelayLoad_GetWin32Error();
  295. }
  296. static
  297. LONG
  298. APIENTRY
  299. RegOpenKeyA (
  300. IN HKEY hKey,
  301. IN LPCSTR lpSubKey,
  302. OUT PHKEY phkResult
  303. )
  304. {
  305. return DelayLoad_GetWin32Error();
  306. }
  307. static
  308. LONG
  309. APIENTRY
  310. RegOpenKeyW (
  311. IN HKEY hKey,
  312. IN LPCWSTR lpSubKey,
  313. OUT PHKEY phkResult
  314. )
  315. {
  316. return DelayLoad_GetWin32Error();
  317. }
  318. static
  319. LONG
  320. APIENTRY
  321. RegEnumKeyExW(
  322. IN HKEY hKey,
  323. IN DWORD dwIndex,
  324. OUT LPWSTR lpName,
  325. IN OUT LPDWORD lpcbName,
  326. IN LPDWORD lpReserved,
  327. IN OUT LPWSTR lpClass,
  328. IN OUT LPDWORD lpcbClass,
  329. OUT PFILETIME lpftLastWriteTime
  330. )
  331. {
  332. if (ARGUMENT_PRESENT(lpcbName))
  333. {
  334. *lpcbName = 0;
  335. }
  336. return DelayLoad_GetWin32Error();
  337. }
  338. static
  339. WINADVAPI
  340. LONG
  341. APIENTRY
  342. RegQueryInfoKeyW(
  343. IN HKEY hKey,
  344. OUT LPWSTR lpClass,
  345. IN OUT LPDWORD lpcbClass,
  346. IN LPDWORD lpReserved,
  347. OUT LPDWORD lpcSubKeys,
  348. OUT LPDWORD lpcbMaxSubKeyLen,
  349. OUT LPDWORD lpcbMaxClassLen,
  350. OUT LPDWORD lpcValues,
  351. OUT LPDWORD lpcbMaxValueNameLen,
  352. OUT LPDWORD lpcbMaxValueLen,
  353. OUT LPDWORD lpcbSecurityDescriptor,
  354. OUT PFILETIME lpftLastWriteTime
  355. )
  356. {
  357. return DelayLoad_GetWin32Error();
  358. }
  359. static
  360. LONG
  361. APIENTRY
  362. RegRestoreKeyW(
  363. HKEY hkey,
  364. LPCWSTR lpFile,
  365. DWORD dwFlags
  366. )
  367. {
  368. return DelayLoad_GetWin32Error();
  369. }
  370. static
  371. WINADVAPI
  372. BOOL
  373. WINAPI
  374. DeregisterEventSource(
  375. IN OUT HANDLE hEventLog
  376. )
  377. {
  378. DelayLoad_SetLastNtStatusAndWin32Error();
  379. return FALSE;
  380. }
  381. static
  382. WINADVAPI
  383. HANDLE
  384. WINAPI
  385. RegisterEventSourceW(
  386. IN LPCWSTR lpUNCServerName,
  387. IN LPCWSTR lpSourceName
  388. )
  389. {
  390. DelayLoad_SetLastNtStatusAndWin32Error();
  391. return NULL;
  392. }
  393. static
  394. WINADVAPI
  395. BOOL
  396. WINAPI
  397. ReportEventW(
  398. IN HANDLE hEventLog,
  399. IN WORD wType,
  400. IN WORD wCategory,
  401. IN DWORD dwEventID,
  402. IN PSID lpUserSid,
  403. IN WORD wNumStrings,
  404. IN DWORD dwDataSize,
  405. IN LPCWSTR *lpStrings,
  406. IN LPVOID lpRawData
  407. )
  408. {
  409. DelayLoad_SetLastNtStatusAndWin32Error();
  410. return FALSE;
  411. }
  412. static
  413. BOOL
  414. WINAPI
  415. AdjustTokenPrivileges(
  416. IN HANDLE TokenHandle,
  417. IN BOOL DisableAllPrivileges,
  418. IN PTOKEN_PRIVILEGES NewState,
  419. IN DWORD BufferLength,
  420. OUT PTOKEN_PRIVILEGES PreviousState,
  421. OUT PDWORD ReturnLength
  422. )
  423. {
  424. DelayLoad_SetLastNtStatusAndWin32Error();
  425. return FALSE;
  426. }
  427. static
  428. BOOL
  429. WINAPI
  430. LookupAccountSidW(
  431. IN LPCWSTR lpSystemName,
  432. IN PSID lpSid,
  433. OUT LPWSTR lpName,
  434. IN OUT LPDWORD cbName,
  435. OUT LPWSTR lpReferencedDomainName,
  436. IN OUT LPDWORD cbReferencedDomainName,
  437. OUT PSID_NAME_USE peUse
  438. )
  439. {
  440. if (ARGUMENT_PRESENT(lpName))
  441. {
  442. *lpName = 0;
  443. }
  444. if (ARGUMENT_PRESENT(lpReferencedDomainName))
  445. {
  446. *lpReferencedDomainName = 0;
  447. }
  448. SetLastError(ERROR_PROC_NOT_FOUND);
  449. return FALSE;
  450. }
  451. static
  452. BOOL
  453. WINAPI
  454. LookupPrivilegeValueA(
  455. IN LPCSTR lpSystemName,
  456. IN LPCSTR lpName,
  457. OUT PLUID lpLuid
  458. )
  459. {
  460. DelayLoad_SetLastNtStatusAndWin32Error();
  461. return FALSE;
  462. }
  463. static
  464. BOOL
  465. WINAPI
  466. LookupPrivilegeValueW(
  467. IN LPCWSTR lpSystemName,
  468. IN LPCWSTR lpName,
  469. OUT PLUID lpLuid
  470. )
  471. {
  472. DelayLoad_SetLastNtStatusAndWin32Error();
  473. return FALSE;
  474. }
  475. static
  476. PVOID
  477. WINAPI
  478. FreeSid(
  479. IN PSID pSid
  480. )
  481. {
  482. DelayLoad_SetLastNtStatusAndWin32Error();
  483. return NULL;
  484. }
  485. static
  486. DWORD
  487. WINAPI
  488. GetLengthSid (
  489. PSID pSid
  490. )
  491. {
  492. DelayLoad_SetLastNtStatusAndWin32Error();
  493. return 0;
  494. }
  495. static
  496. BOOL
  497. WINAPI
  498. IsValidSid (
  499. PSID pSid
  500. )
  501. {
  502. DelayLoad_SetLastNtStatusAndWin32Error();
  503. return FALSE;
  504. }
  505. static
  506. BOOL
  507. APIENTRY
  508. CheckTokenMembership(
  509. IN HANDLE TokenHandle OPTIONAL,
  510. IN PSID SidToCheck,
  511. OUT PBOOL IsMember
  512. )
  513. {
  514. DelayLoad_SetLastNtStatusAndWin32Error();
  515. return FALSE;
  516. }
  517. static
  518. BOOL
  519. WINAPI
  520. AllocateAndInitializeSid (
  521. IN PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
  522. IN BYTE nSubAuthorityCount,
  523. IN DWORD nSubAuthority0,
  524. IN DWORD nSubAuthority1,
  525. IN DWORD nSubAuthority2,
  526. IN DWORD nSubAuthority3,
  527. IN DWORD nSubAuthority4,
  528. IN DWORD nSubAuthority5,
  529. IN DWORD nSubAuthority6,
  530. IN DWORD nSubAuthority7,
  531. OUT PSID *pSid
  532. )
  533. {
  534. DelayLoad_SetLastNtStatusAndWin32Error();
  535. return FALSE;
  536. }
  537. static
  538. WINADVAPI
  539. BOOL
  540. WINAPI
  541. OpenProcessToken(
  542. IN HANDLE ProcessHandle,
  543. IN DWORD DesiredAccess,
  544. OUT PHANDLE TokenHandle
  545. )
  546. {
  547. DelayLoad_SetLastNtStatusAndWin32Error();
  548. return FALSE;
  549. }
  550. static
  551. WINADVAPI
  552. BOOL
  553. WINAPI
  554. OpenThreadToken(
  555. IN HANDLE ThreadHandle,
  556. IN DWORD DesiredAccess,
  557. IN BOOL OpenAsSelf,
  558. OUT PHANDLE TokenHandle
  559. )
  560. {
  561. DelayLoad_SetLastNtStatusAndWin32Error();
  562. return FALSE;
  563. }
  564. static
  565. WINADVAPI
  566. BOOL
  567. WINAPI
  568. GetTokenInformation(
  569. IN HANDLE TokenHandle,
  570. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  571. OUT LPVOID TokenInformation,
  572. IN DWORD TokenInformationLength,
  573. OUT PDWORD ReturnLength
  574. )
  575. {
  576. DelayLoad_SetLastNtStatusAndWin32Error();
  577. return FALSE;
  578. }
  579. static
  580. LONG
  581. APIENTRY
  582. RegEnumKeyW (
  583. IN HKEY hKey,
  584. IN DWORD dwIndex,
  585. OUT LPWSTR lpName,
  586. IN DWORD cbName
  587. )
  588. {
  589. return DelayLoad_GetWin32Error();
  590. }
  591. static
  592. WINADVAPI
  593. LONG
  594. APIENTRY
  595. RegEnumValueW (
  596. IN HKEY hKey,
  597. IN DWORD dwIndex,
  598. OUT LPWSTR lpValueName,
  599. IN OUT LPDWORD lpcbValueName,
  600. IN LPDWORD lpReserved,
  601. OUT LPDWORD lpType,
  602. OUT LPBYTE lpData,
  603. IN OUT LPDWORD lpcbData
  604. )
  605. {
  606. return DelayLoad_GetWin32Error();
  607. }
  608. static
  609. WINADVAPI
  610. BOOL
  611. WINAPI
  612. CryptHashData(
  613. HCRYPTHASH hHash,
  614. CONST BYTE *pbData,
  615. DWORD dwDataLen,
  616. DWORD dwFlags
  617. )
  618. {
  619. DelayLoad_SetLastNtStatusAndWin32Error();
  620. return FALSE;
  621. }
  622. static
  623. WINADVAPI
  624. BOOL
  625. WINAPI
  626. CryptReleaseContext(
  627. HCRYPTPROV hProv,
  628. DWORD dwFlags
  629. )
  630. {
  631. DelayLoad_SetLastNtStatusAndWin32Error();
  632. return FALSE;
  633. }
  634. static
  635. WINADVAPI
  636. BOOL
  637. WINAPI
  638. CryptAcquireContextW(
  639. HCRYPTPROV *phProv,
  640. LPCWSTR szContainer,
  641. LPCWSTR szProvider,
  642. DWORD dwProvType,
  643. DWORD dwFlags
  644. )
  645. {
  646. DelayLoad_SetLastNtStatusAndWin32Error();
  647. return FALSE;
  648. }
  649. static
  650. WINADVAPI
  651. BOOL
  652. WINAPI
  653. CryptDestroyHash(
  654. HCRYPTHASH hHash
  655. )
  656. {
  657. DelayLoad_SetLastNtStatusAndWin32Error();
  658. return FALSE;
  659. }
  660. static
  661. WINADVAPI
  662. BOOL
  663. WINAPI
  664. CryptDestroyKey(
  665. HCRYPTKEY hKey
  666. )
  667. {
  668. DelayLoad_SetLastNtStatusAndWin32Error();
  669. return FALSE;
  670. }
  671. static
  672. WINADVAPI
  673. BOOL
  674. WINAPI
  675. CryptExportKey(
  676. HCRYPTKEY hKey,
  677. HCRYPTKEY hExpKey,
  678. DWORD dwBlobType,
  679. DWORD dwFlags,
  680. BYTE *pbData,
  681. DWORD *pdwDataLen
  682. )
  683. {
  684. DelayLoad_SetLastNtStatusAndWin32Error();
  685. return FALSE;
  686. }
  687. static
  688. WINADVAPI
  689. BOOL
  690. WINAPI
  691. CryptGetHashParam(
  692. HCRYPTHASH hHash,
  693. DWORD dwParam,
  694. BYTE *pbData,
  695. DWORD *pdwDataLen,
  696. DWORD dwFlags
  697. )
  698. {
  699. if (ARGUMENT_PRESENT(pdwDataLen))
  700. {
  701. *pdwDataLen = 0;
  702. }
  703. DelayLoad_SetLastNtStatusAndWin32Error();
  704. return FALSE;
  705. }
  706. static
  707. WINADVAPI
  708. BOOL
  709. WINAPI
  710. CryptCreateHash(
  711. HCRYPTPROV hProv,
  712. ALG_ID Algid,
  713. HCRYPTKEY hKey,
  714. DWORD dwFlags,
  715. HCRYPTHASH *phHash
  716. )
  717. {
  718. DelayLoad_SetLastNtStatusAndWin32Error();
  719. return FALSE;
  720. }
  721. static
  722. WINADVAPI
  723. BOOL WINAPI
  724. SaferGetPolicyInformation (
  725. IN DWORD dwScopeId,
  726. IN SAFER_POLICY_INFO_CLASS CodeAuthzPolicyInfoClass,
  727. IN DWORD InfoBufferSize,
  728. IN OUT PVOID InfoBuffer,
  729. IN OUT PDWORD InfoBufferRetSize,
  730. IN LPVOID lpReserved
  731. )
  732. {
  733. DelayLoad_SetLastNtStatusAndWin32Error();
  734. return FALSE;
  735. }
  736. static
  737. WINADVAPI
  738. BOOL WINAPI
  739. SaferSetPolicyInformation (
  740. IN DWORD dwScopeId,
  741. IN SAFER_POLICY_INFO_CLASS CodeAuthzPolicyInfoClass,
  742. IN DWORD InfoBufferSize,
  743. IN PVOID InfoBuffer,
  744. IN LPVOID lpReserved
  745. )
  746. {
  747. DelayLoad_SetLastNtStatusAndWin32Error();
  748. return FALSE;
  749. }
  750. static
  751. WINADVAPI
  752. BOOL WINAPI
  753. SaferCreateLevel(
  754. IN DWORD dwScopeId,
  755. IN DWORD dwLevelId,
  756. IN DWORD OpenFlags,
  757. OUT SAFER_LEVEL_HANDLE *pLevelHandle,
  758. IN LPVOID lpReserved)
  759. {
  760. DelayLoad_SetLastNtStatusAndWin32Error();
  761. return FALSE;
  762. }
  763. static
  764. WINADVAPI
  765. BOOL WINAPI
  766. SaferCloseLevel(
  767. IN SAFER_LEVEL_HANDLE hLevelHandle)
  768. {
  769. DelayLoad_SetLastNtStatusAndWin32Error();
  770. return FALSE;
  771. }
  772. static
  773. WINADVAPI
  774. BOOL WINAPI
  775. SaferIdentifyLevel (
  776. IN DWORD dwNumProperties,
  777. IN PSAFER_CODE_PROPERTIES pCodeProperties,
  778. OUT SAFER_LEVEL_HANDLE *pLevelHandle,
  779. IN LPVOID lpReserved
  780. )
  781. {
  782. DelayLoad_SetLastNtStatusAndWin32Error();
  783. return FALSE;
  784. }
  785. static
  786. WINADVAPI
  787. BOOL WINAPI
  788. SaferComputeTokenFromLevel (
  789. IN SAFER_LEVEL_HANDLE LevelHandle,
  790. IN HANDLE InAccessToken OPTIONAL,
  791. OUT PHANDLE OutAccessToken,
  792. IN DWORD dwFlags,
  793. IN LPVOID lpReserved
  794. )
  795. {
  796. DelayLoad_SetLastNtStatusAndWin32Error();
  797. return FALSE;
  798. }
  799. static
  800. WINADVAPI
  801. BOOL WINAPI
  802. SaferGetLevelInformation (
  803. IN SAFER_LEVEL_HANDLE LevelHandle,
  804. IN SAFER_OBJECT_INFO_CLASS dwInfoType,
  805. OUT LPVOID lpQueryBuffer OPTIONAL,
  806. IN DWORD dwInBufferSize,
  807. OUT LPDWORD lpdwOutBufferSize
  808. )
  809. {
  810. DelayLoad_SetLastNtStatusAndWin32Error();
  811. return FALSE;
  812. }
  813. static
  814. WINADVAPI
  815. BOOL WINAPI
  816. SaferSetLevelInformation (
  817. IN SAFER_LEVEL_HANDLE LevelHandle,
  818. IN SAFER_OBJECT_INFO_CLASS dwInfoType,
  819. IN LPVOID pQueryBuffer,
  820. IN DWORD dwInBufferSize
  821. )
  822. {
  823. DelayLoad_SetLastNtStatusAndWin32Error();
  824. return FALSE;
  825. }
  826. static
  827. WINADVAPI
  828. BOOL WINAPI
  829. SetSecurityDescriptorDacl (
  830. IN OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  831. IN BOOL bDaclPresent,
  832. IN PACL pDacl,
  833. IN BOOL bDaclDefaulted
  834. )
  835. {
  836. DelayLoad_SetLastNtStatusAndWin32Error();
  837. return FALSE;
  838. }
  839. static
  840. WINADVAPI
  841. BOOL WINAPI
  842. InitializeSecurityDescriptor (
  843. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  844. IN DWORD dwRevision
  845. )
  846. {
  847. DelayLoad_SetLastNtStatusAndWin32Error();
  848. return FALSE;
  849. }
  850. static
  851. WINADVAPI
  852. DWORD WINAPI
  853. SetEntriesInAclW(
  854. IN ULONG cCountOfExplicitEntries,
  855. IN PEXPLICIT_ACCESS_W pListOfExplicitEntries,
  856. IN PACL OldAcl,
  857. OUT PACL * NewAcl
  858. )
  859. {
  860. DelayLoad_SetLastNtStatusAndWin32Error();
  861. return ERROR_DELAY_LOAD_FAILED;
  862. }
  863. //
  864. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  865. //
  866. DEFINE_PROCNAME_ENTRIES(advapi32)
  867. {
  868. DLPENTRY(AdjustTokenPrivileges)
  869. DLPENTRY(AllocateAndInitializeSid)
  870. DLPENTRY(CheckTokenMembership)
  871. DLPENTRY(CryptAcquireContextW)
  872. DLPENTRY(CryptCreateHash)
  873. DLPENTRY(CryptDestroyHash)
  874. DLPENTRY(CryptDestroyKey)
  875. DLPENTRY(CryptExportKey)
  876. DLPENTRY(CryptGetHashParam)
  877. DLPENTRY(CryptHashData)
  878. DLPENTRY(CryptReleaseContext)
  879. DLPENTRY(DeregisterEventSource)
  880. DLPENTRY(ElfDeregisterEventSource)
  881. DLPENTRY(ElfRegisterEventSourceW)
  882. DLPENTRY(ElfReportEventW)
  883. DLPENTRY(FreeSid)
  884. DLPENTRY(GetLengthSid)
  885. DLPENTRY(GetTokenInformation)
  886. DLPENTRY(GetUserNameW)
  887. DLPENTRY(InitializeSecurityDescriptor)
  888. DLPENTRY(IsValidSid)
  889. DLPENTRY(LookupAccountSidW)
  890. DLPENTRY(LookupPrivilegeValueA)
  891. DLPENTRY(LookupPrivilegeValueW)
  892. DLPENTRY(OpenProcessToken)
  893. DLPENTRY(OpenThreadToken)
  894. DLPENTRY(QueryServiceStatus)
  895. DLPENTRY(RegCloseKey)
  896. DLPENTRY(RegCreateKeyExW)
  897. DLPENTRY(RegCreateKeyW)
  898. DLPENTRY(RegDeleteKeyW)
  899. DLPENTRY(RegDeleteValueW)
  900. DLPENTRY(RegEnumKeyExW)
  901. DLPENTRY(RegEnumKeyW)
  902. DLPENTRY(RegEnumValueW)
  903. DLPENTRY(RegNotifyChangeKeyValue)
  904. DLPENTRY(RegOpenKeyA)
  905. DLPENTRY(RegOpenKeyExA)
  906. DLPENTRY(RegOpenKeyExW)
  907. DLPENTRY(RegOpenKeyW)
  908. DLPENTRY(RegQueryInfoKeyW)
  909. DLPENTRY(RegQueryValueExA)
  910. DLPENTRY(RegQueryValueExW)
  911. DLPENTRY(RegRestoreKeyW)
  912. DLPENTRY(RegSaveKeyA)
  913. DLPENTRY(RegSaveKeyExW)
  914. DLPENTRY(RegSaveKeyW)
  915. DLPENTRY(RegSetValueExA)
  916. DLPENTRY(RegSetValueExW)
  917. DLPENTRY(RegisterEventSourceW)
  918. DLPENTRY(ReportEventW)
  919. DLPENTRY(SaferCloseLevel)
  920. DLPENTRY(SaferComputeTokenFromLevel)
  921. DLPENTRY(SaferCreateLevel)
  922. DLPENTRY(SaferGetLevelInformation)
  923. DLPENTRY(SaferGetPolicyInformation)
  924. DLPENTRY(SaferIdentifyLevel)
  925. DLPENTRY(SaferSetLevelInformation)
  926. DLPENTRY(SaferSetPolicyInformation)
  927. DLPENTRY(SetEntriesInAclW)
  928. DLPENTRY(SetSecurityDescriptorDacl)
  929. };
  930. DEFINE_PROCNAME_MAP(advapi32)