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.

948 lines
19 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Header Name:
  4. verifier.h
  5. Abstract:
  6. Internal interfaces for the standard application verifier provider.
  7. Author:
  8. Silviu Calinoiu (SilviuC) 2-Feb-2001
  9. Revision History:
  10. --*/
  11. #ifndef _VERIFIER_H_
  12. #define _VERIFIER_H_
  13. //
  14. // Some global things.
  15. //
  16. extern RTL_VERIFIER_THUNK_DESCRIPTOR AVrfpNtdllThunks[];
  17. extern RTL_VERIFIER_THUNK_DESCRIPTOR AVrfpKernel32Thunks[];
  18. extern RTL_VERIFIER_THUNK_DESCRIPTOR AVrfpAdvapi32Thunks[];
  19. extern RTL_VERIFIER_THUNK_DESCRIPTOR AVrfpMsvcrtThunks[];
  20. extern RTL_VERIFIER_THUNK_DESCRIPTOR AVrfpOleaut32Thunks[];
  21. PRTL_VERIFIER_THUNK_DESCRIPTOR
  22. AVrfpGetThunkDescriptor (
  23. PRTL_VERIFIER_THUNK_DESCRIPTOR DllThunks,
  24. ULONG Index);
  25. #define AVRFP_GET_ORIGINAL_EXPORT(DllThunks, Index) \
  26. (FUNCTION_TYPE)(AVrfpGetThunkDescriptor(DllThunks, Index)->ThunkOldAddress)
  27. extern RTL_VERIFIER_PROVIDER_DESCRIPTOR AVrfpProvider;
  28. /////////////////////////////////////////////////////////////////////
  29. ////////////////////////////////////////// ntdll.dll verified exports
  30. /////////////////////////////////////////////////////////////////////
  31. //NTSYSCALLAPI
  32. NTSTATUS
  33. NTAPI
  34. AVrfpNtAllocateVirtualMemory(
  35. IN HANDLE ProcessHandle,
  36. IN OUT PVOID *BaseAddress,
  37. IN ULONG_PTR ZeroBits,
  38. IN OUT PSIZE_T RegionSize,
  39. IN ULONG AllocationType,
  40. IN ULONG Protect
  41. );
  42. //NTSYSCALLAPI
  43. NTSTATUS
  44. NTAPI
  45. AVrfpNtFreeVirtualMemory(
  46. IN HANDLE ProcessHandle,
  47. IN OUT PVOID *BaseAddress,
  48. IN OUT PSIZE_T RegionSize,
  49. IN ULONG FreeType
  50. );
  51. //NTSYSCALLAPI
  52. NTSTATUS
  53. NTAPI
  54. AVrfpNtMapViewOfSection(
  55. IN HANDLE SectionHandle,
  56. IN HANDLE ProcessHandle,
  57. IN OUT PVOID *BaseAddress,
  58. IN ULONG_PTR ZeroBits,
  59. IN SIZE_T CommitSize,
  60. IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
  61. IN OUT PSIZE_T ViewSize,
  62. IN SECTION_INHERIT InheritDisposition,
  63. IN ULONG AllocationType,
  64. IN ULONG Protect
  65. );
  66. //NTSYSCALLAPI
  67. NTSTATUS
  68. NTAPI
  69. AVrfpNtUnmapViewOfSection(
  70. IN HANDLE ProcessHandle,
  71. IN PVOID BaseAddress
  72. );
  73. //NTSYSCALLAPI
  74. NTSTATUS
  75. NTAPI
  76. AVrfpNtCreateSection (
  77. OUT PHANDLE SectionHandle,
  78. IN ACCESS_MASK DesiredAccess,
  79. IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
  80. IN PLARGE_INTEGER MaximumSize OPTIONAL,
  81. IN ULONG SectionPageProtection,
  82. IN ULONG AllocationAttributes,
  83. IN HANDLE FileHandle OPTIONAL
  84. );
  85. //NTSYSCALLAPI
  86. NTSTATUS
  87. NTAPI
  88. AVrfpNtOpenSection(
  89. OUT PHANDLE SectionHandle,
  90. IN ACCESS_MASK DesiredAccess,
  91. IN POBJECT_ATTRIBUTES ObjectAttributes
  92. );
  93. //NTSYSCALLAPI
  94. NTSTATUS
  95. NTAPI
  96. AVrfpNtCreateFile(
  97. OUT PHANDLE FileHandle,
  98. IN ACCESS_MASK DesiredAccess,
  99. IN POBJECT_ATTRIBUTES ObjectAttributes,
  100. OUT PIO_STATUS_BLOCK IoStatusBlock,
  101. IN PLARGE_INTEGER AllocationSize OPTIONAL,
  102. IN ULONG FileAttributes,
  103. IN ULONG ShareAccess,
  104. IN ULONG CreateDisposition,
  105. IN ULONG CreateOptions,
  106. IN PVOID EaBuffer OPTIONAL,
  107. IN ULONG EaLength
  108. );
  109. //NTSYSCALLAPI
  110. NTSTATUS
  111. NTAPI
  112. AVrfpNtOpenFile(
  113. OUT PHANDLE FileHandle,
  114. IN ACCESS_MASK DesiredAccess,
  115. IN POBJECT_ATTRIBUTES ObjectAttributes,
  116. OUT PIO_STATUS_BLOCK IoStatusBlock,
  117. IN ULONG ShareAccess,
  118. IN ULONG OpenOptions
  119. );
  120. //NTSYSAPI
  121. BOOL
  122. NTAPI
  123. AVrfpRtlTryEnterCriticalSection(
  124. PRTL_CRITICAL_SECTION CriticalSection
  125. );
  126. //NTSYSAPI
  127. NTSTATUS
  128. NTAPI
  129. AVrfpRtlEnterCriticalSection(
  130. volatile RTL_CRITICAL_SECTION *CriticalSection
  131. );
  132. //NTSYSAPI
  133. NTSTATUS
  134. NTAPI
  135. AVrfpRtlLeaveCriticalSection(
  136. volatile RTL_CRITICAL_SECTION *CriticalSection
  137. );
  138. //NTSYSAPI
  139. NTSTATUS
  140. NTAPI
  141. AVrfpRtlInitializeCriticalSection(
  142. PRTL_CRITICAL_SECTION CriticalSection
  143. );
  144. //NTSYSAPI
  145. NTSTATUS
  146. NTAPI
  147. AVrfpRtlInitializeCriticalSectionAndSpinCount(
  148. PRTL_CRITICAL_SECTION CriticalSection,
  149. ULONG SpinCount
  150. );
  151. //NTSYSAPI
  152. NTSTATUS
  153. NTAPI
  154. AVrfpRtlDeleteCriticalSection(
  155. PRTL_CRITICAL_SECTION CriticalSection
  156. );
  157. VOID
  158. AVrfpRtlInitializeResource(
  159. IN PRTL_RESOURCE Resource
  160. );
  161. VOID
  162. AVrfpRtlDeleteResource (
  163. IN PRTL_RESOURCE Resource
  164. );
  165. BOOLEAN
  166. AVrfpRtlAcquireResourceShared (
  167. IN PRTL_RESOURCE Resource,
  168. IN BOOLEAN Wait
  169. );
  170. BOOLEAN
  171. AVrfpRtlAcquireResourceExclusive (
  172. IN PRTL_RESOURCE Resource,
  173. IN BOOLEAN Wait
  174. );
  175. VOID
  176. AVrfpRtlReleaseResource (
  177. IN PRTL_RESOURCE Resource
  178. );
  179. VOID
  180. AVrfpRtlConvertSharedToExclusive(
  181. IN PRTL_RESOURCE Resource
  182. );
  183. VOID
  184. AVrfpRtlConvertExclusiveToShared (
  185. IN PRTL_RESOURCE Resource
  186. );
  187. //NTSYSCALLAPI
  188. NTSTATUS
  189. NTAPI
  190. AVrfpNtClose(
  191. IN HANDLE Handle
  192. );
  193. //NTSYSCALLAPI
  194. NTSTATUS
  195. NTAPI
  196. AVrfpNtCreateEvent (
  197. OUT PHANDLE EventHandle,
  198. IN ACCESS_MASK DesiredAccess,
  199. IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
  200. IN EVENT_TYPE EventType,
  201. IN BOOLEAN InitialState
  202. );
  203. //NTSYSAPI
  204. PVOID
  205. NTAPI
  206. AVrfpRtlAllocateHeap(
  207. IN PVOID HeapHandle,
  208. IN ULONG Flags,
  209. IN SIZE_T Size
  210. );
  211. //NTSYSAPI
  212. BOOLEAN
  213. NTAPI
  214. AVrfpRtlFreeHeap(
  215. IN PVOID HeapHandle,
  216. IN ULONG Flags,
  217. IN PVOID BaseAddress
  218. );
  219. //NTSYSAPI
  220. PVOID
  221. NTAPI
  222. AVrfpRtlReAllocateHeap(
  223. IN PVOID HeapHandle,
  224. IN ULONG Flags,
  225. IN PVOID BaseAddress,
  226. IN SIZE_T Size
  227. );
  228. //NTSYSAPI
  229. NTSTATUS
  230. NTAPI
  231. AVrfpRtlQueueWorkItem(
  232. IN WORKERCALLBACKFUNC Function,
  233. IN PVOID Context,
  234. IN ULONG Flags
  235. );
  236. //NTSYSAPI
  237. NTSTATUS
  238. NTAPI
  239. AVrfpRtlRegisterWait (
  240. OUT PHANDLE WaitHandle,
  241. IN HANDLE Handle,
  242. IN WAITORTIMERCALLBACKFUNC Function,
  243. IN PVOID Context,
  244. IN ULONG Milliseconds,
  245. IN ULONG Flags
  246. );
  247. //NTSYSAPI
  248. NTSTATUS
  249. NTAPI
  250. AVrfpRtlCreateTimer(
  251. IN HANDLE TimerQueueHandle,
  252. OUT HANDLE *Handle,
  253. IN WAITORTIMERCALLBACKFUNC Function,
  254. IN PVOID Context,
  255. IN ULONG DueTime,
  256. IN ULONG Period,
  257. IN ULONG Flags
  258. );
  259. NTSTATUS
  260. NTAPI
  261. AVrfpLdrGetProcedureAddress(
  262. IN PVOID DllHandle,
  263. IN CONST ANSI_STRING* ProcedureName OPTIONAL,
  264. IN ULONG ProcedureNumber OPTIONAL,
  265. OUT PVOID *ProcedureAddress
  266. );
  267. //NTSYSCALLAPI
  268. NTSTATUS
  269. NTAPI
  270. AVrfpNtCreateKey(
  271. OUT PHANDLE KeyHandle,
  272. IN ACCESS_MASK DesiredAccess,
  273. IN POBJECT_ATTRIBUTES ObjectAttributes,
  274. IN ULONG TitleIndex,
  275. IN PUNICODE_STRING Class OPTIONAL,
  276. IN ULONG CreateOptions,
  277. OUT PULONG Disposition OPTIONAL
  278. );
  279. //NTSYSCALLAPI
  280. NTSTATUS
  281. NTAPI
  282. AVrfpNtOpenKey(
  283. OUT PHANDLE KeyHandle,
  284. IN ACCESS_MASK DesiredAccess,
  285. IN POBJECT_ATTRIBUTES ObjectAttributes
  286. );
  287. //NTSYSCALLAPI
  288. NTSTATUS
  289. NTAPI
  290. AVrfpNtReadFile(
  291. IN HANDLE FileHandle,
  292. IN HANDLE Event OPTIONAL,
  293. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  294. IN PVOID ApcContext OPTIONAL,
  295. OUT PIO_STATUS_BLOCK IoStatusBlock,
  296. OUT PVOID Buffer,
  297. IN ULONG Length,
  298. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  299. IN PULONG Key OPTIONAL
  300. );
  301. //NTSYSCALLAPI
  302. NTSTATUS
  303. NTAPI
  304. AVrfpNtReadFileScatter(
  305. IN HANDLE FileHandle,
  306. IN HANDLE Event OPTIONAL,
  307. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  308. IN PVOID ApcContext OPTIONAL,
  309. OUT PIO_STATUS_BLOCK IoStatusBlock,
  310. IN PFILE_SEGMENT_ELEMENT SegmentArray,
  311. IN ULONG Length,
  312. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  313. IN PULONG Key OPTIONAL
  314. );
  315. //NTSYSCALLAPI
  316. NTSTATUS
  317. NTAPI
  318. AVrfpNtWriteFile(
  319. IN HANDLE FileHandle,
  320. IN HANDLE Event OPTIONAL,
  321. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  322. IN PVOID ApcContext OPTIONAL,
  323. OUT PIO_STATUS_BLOCK IoStatusBlock,
  324. IN PVOID Buffer,
  325. IN ULONG Length,
  326. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  327. IN PULONG Key OPTIONAL
  328. );
  329. //NTSYSCALLAPI
  330. NTSTATUS
  331. NTAPI
  332. AVrfpNtWriteFileGather(
  333. IN HANDLE FileHandle,
  334. IN HANDLE Event OPTIONAL,
  335. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  336. IN PVOID ApcContext OPTIONAL,
  337. OUT PIO_STATUS_BLOCK IoStatusBlock,
  338. IN PFILE_SEGMENT_ELEMENT SegmentArray,
  339. IN ULONG Length,
  340. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  341. IN PULONG Key OPTIONAL
  342. );
  343. //NTSYSCALLAPI
  344. NTSTATUS
  345. NTAPI
  346. AVrfpNtWaitForSingleObject(
  347. IN HANDLE Handle,
  348. IN BOOLEAN Alertable,
  349. IN PLARGE_INTEGER Timeout OPTIONAL
  350. );
  351. //NTSYSCALLAPI
  352. NTSTATUS
  353. NTAPI
  354. AVrfpNtWaitForMultipleObjects(
  355. IN ULONG Count,
  356. IN HANDLE Handles[],
  357. IN WAIT_TYPE WaitType,
  358. IN BOOLEAN Alertable,
  359. IN PLARGE_INTEGER Timeout OPTIONAL
  360. );
  361. NTSTATUS
  362. NTAPI
  363. AVrfpRtlSetThreadPoolStartFunc(
  364. PRTLP_START_THREAD StartFunc,
  365. PRTLP_EXIT_THREAD ExitFunc
  366. );
  367. /////////////////////////////////////////////////////////////////////
  368. /////////////////////////////////////// kernel32.dll verified exports
  369. /////////////////////////////////////////////////////////////////////
  370. #define AVRF_INDEX_KERNEL32_HEAPCREATE 0
  371. #define AVRF_INDEX_KERNEL32_HEAPDESTROY 1
  372. #define AVRF_INDEX_KERNEL32_CLOSEHANDLE 2
  373. #define AVRF_INDEX_KERNEL32_EXITTHREAD 3
  374. #define AVRF_INDEX_KERNEL32_TERMINATETHREAD 4
  375. #define AVRF_INDEX_KERNEL32_SUSPENDTHREAD 5
  376. #define AVRF_INDEX_KERNEL32_TLSALLOC 6
  377. #define AVRF_INDEX_KERNEL32_TLSFREE 7
  378. #define AVRF_INDEX_KERNEL32_TLSGETVALUE 8
  379. #define AVRF_INDEX_KERNEL32_TLSSETVALUE 9
  380. #define AVRF_INDEX_KERNEL32_CREATETHREAD 10
  381. #define AVRF_INDEX_KERNEL32_GETPROCADDRESS 11
  382. #define AVRF_INDEX_KERNEL32_WAITFORSINGLEOBJECT 12
  383. #define AVRF_INDEX_KERNEL32_WAITFORMULTIPLEOBJECTS 13
  384. #define AVRF_INDEX_KERNEL32_WAITFORSINGLEOBJECTEX 14
  385. #define AVRF_INDEX_KERNEL32_WAITFORMULTIPLEOBJECTSEX 15
  386. #define AVRF_INDEX_KERNEL32_GLOBALALLOC 16
  387. #define AVRF_INDEX_KERNEL32_GLOBALREALLOC 17
  388. #define AVRF_INDEX_KERNEL32_LOCALALLOC 18
  389. #define AVRF_INDEX_KERNEL32_LOCALREALLOC 19
  390. #define AVRF_INDEX_KERNEL32_CREATEFILEA 20
  391. #define AVRF_INDEX_KERNEL32_CREATEFILEW 21
  392. #define AVRF_INDEX_KERNEL32_FREELIBRARYANDEXITTHREAD 22
  393. #define AVRF_INDEX_KERNEL32_GETTICKCOUNT 23
  394. #define AVRF_INDEX_KERNEL32_ISBADREADPTR 24
  395. #define AVRF_INDEX_KERNEL32_ISBADHUGEREADPTR 25
  396. #define AVRF_INDEX_KERNEL32_ISBADWRITEPTR 26
  397. #define AVRF_INDEX_KERNEL32_ISBADHUGEWRITEPTR 27
  398. #define AVRF_INDEX_KERNEL32_ISBADCODEPTR 28
  399. #define AVRF_INDEX_KERNEL32_ISBADSTRINGPTRA 29
  400. #define AVRF_INDEX_KERNEL32_ISBADSTRINGPTRW 30
  401. #define AVRF_INDEX_KERNEL32_EXITPROCESS 31
  402. #define AVRF_INDEX_KERNEL32_VIRTUALFREE 32
  403. #define AVRF_INDEX_KERNEL32_VIRTUALFREEEX 33
  404. //WINBASEAPI
  405. HANDLE
  406. WINAPI
  407. AVrfpHeapCreate(
  408. IN DWORD flOptions,
  409. IN SIZE_T dwInitialSize,
  410. IN SIZE_T dwMaximumSize
  411. );
  412. //WINBASEAPI
  413. BOOL
  414. WINAPI
  415. AVrfpHeapDestroy(
  416. IN OUT HANDLE hHeap
  417. );
  418. //WINBASEAPI
  419. BOOL
  420. WINAPI
  421. AVrfpCloseHandle(
  422. IN OUT HANDLE hObject
  423. );
  424. //WINBASEAPI
  425. DECLSPEC_NORETURN
  426. VOID
  427. WINAPI
  428. AVrfpExitThread(
  429. IN DWORD dwExitCode
  430. );
  431. //WINBASEAPI
  432. BOOL
  433. WINAPI
  434. AVrfpTerminateThread(
  435. IN OUT HANDLE hThread,
  436. IN DWORD dwExitCode
  437. );
  438. //WINBASEAPI
  439. DWORD
  440. WINAPI
  441. AVrfpSuspendThread(
  442. IN HANDLE hThread
  443. );
  444. //WINBASEAPI
  445. HANDLE
  446. WINAPI
  447. AVrfpCreateThread(
  448. IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
  449. IN SIZE_T dwStackSize,
  450. IN LPTHREAD_START_ROUTINE lpStartAddress,
  451. IN LPVOID lpParameter,
  452. IN DWORD dwCreationFlags,
  453. OUT LPDWORD lpThreadId
  454. );
  455. //WINBASEAPI
  456. DWORD
  457. WINAPI
  458. AVrfpTlsAlloc(
  459. VOID
  460. );
  461. //WINBASEAPI
  462. BOOL
  463. WINAPI
  464. AVrfpTlsFree(
  465. IN DWORD dwTlsIndex
  466. );
  467. //WINBASEAPI
  468. LPVOID
  469. WINAPI
  470. AVrfpTlsGetValue(
  471. IN DWORD dwTlsIndex
  472. );
  473. //WINBASEAPI
  474. BOOL
  475. WINAPI
  476. AVrfpTlsSetValue(
  477. IN DWORD dwTlsIndex,
  478. IN LPVOID lpTlsValue
  479. );
  480. //WINBASEAPI
  481. FARPROC
  482. WINAPI
  483. AVrfpGetProcAddress(
  484. IN HMODULE hModule,
  485. IN LPCSTR lpProcName
  486. );
  487. //WINBASEAPI
  488. DWORD
  489. WINAPI
  490. AVrfpWaitForSingleObject(
  491. IN HANDLE hHandle,
  492. IN DWORD dwMilliseconds
  493. );
  494. //WINBASEAPI
  495. DWORD
  496. WINAPI
  497. AVrfpWaitForMultipleObjects(
  498. IN DWORD nCount,
  499. IN CONST HANDLE *lpHandles,
  500. IN BOOL bWaitAll,
  501. IN DWORD dwMilliseconds
  502. );
  503. //WINBASEAPI
  504. DWORD
  505. WINAPI
  506. AVrfpWaitForSingleObjectEx(
  507. IN HANDLE hHandle,
  508. IN DWORD dwMilliseconds,
  509. IN BOOL bAlertable
  510. );
  511. //WINBASEAPI
  512. DWORD
  513. WINAPI
  514. AVrfpWaitForMultipleObjectsEx(
  515. IN DWORD nCount,
  516. IN CONST HANDLE *lpHandles,
  517. IN BOOL bWaitAll,
  518. IN DWORD dwMilliseconds,
  519. IN BOOL bAlertable
  520. );
  521. //WINBASEAPI
  522. HGLOBAL
  523. WINAPI
  524. AVrfpGlobalAlloc(
  525. IN UINT uFlags,
  526. IN SIZE_T dwBytes
  527. );
  528. //WINBASEAPI
  529. HGLOBAL
  530. WINAPI
  531. AVrfpGlobalReAlloc(
  532. IN HGLOBAL hMem,
  533. IN SIZE_T dwBytes,
  534. IN UINT uFlags
  535. );
  536. //WINBASEAPI
  537. HLOCAL
  538. WINAPI
  539. AVrfpLocalAlloc(
  540. IN UINT uFlags,
  541. IN SIZE_T uBytes
  542. );
  543. //WINBASEAPI
  544. HLOCAL
  545. WINAPI
  546. AVrfpLocalReAlloc(
  547. IN HLOCAL hMem,
  548. IN SIZE_T uBytes,
  549. IN UINT uFlags
  550. );
  551. //WINBASEAPI
  552. HANDLE
  553. WINAPI
  554. AVrfpCreateFileA(
  555. IN LPCSTR lpFileName,
  556. IN DWORD dwDesiredAccess,
  557. IN DWORD dwShareMode,
  558. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  559. IN DWORD dwCreationDisposition,
  560. IN DWORD dwFlagsAndAttributes,
  561. IN HANDLE hTemplateFile
  562. );
  563. //WINBASEAPI
  564. HANDLE
  565. WINAPI
  566. AVrfpCreateFileW(
  567. IN LPCWSTR lpFileName,
  568. IN DWORD dwDesiredAccess,
  569. IN DWORD dwShareMode,
  570. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  571. IN DWORD dwCreationDisposition,
  572. IN DWORD dwFlagsAndAttributes,
  573. IN HANDLE hTemplateFile
  574. );
  575. //WINBASEAPI
  576. DECLSPEC_NORETURN
  577. VOID
  578. WINAPI
  579. AVrfpFreeLibraryAndExitThread(
  580. IN HMODULE hLibModule,
  581. IN DWORD dwExitCode
  582. );
  583. //WINBASEAPI
  584. DWORD
  585. WINAPI
  586. AVrfpGetTickCount(
  587. VOID
  588. );
  589. //WINBASEAPI
  590. BOOL
  591. WINAPI
  592. AVrfpIsBadReadPtr(
  593. CONST VOID *lp,
  594. UINT_PTR cb
  595. );
  596. //WINBASEAPI
  597. BOOL
  598. WINAPI
  599. AVrfpIsBadHugeReadPtr(
  600. CONST VOID *lp,
  601. UINT_PTR cb
  602. );
  603. //WINBASEAPI
  604. BOOL
  605. WINAPI
  606. AVrfpIsBadWritePtr(
  607. LPVOID lp,
  608. UINT_PTR cb
  609. );
  610. //WINBASEAPI
  611. BOOL
  612. WINAPI
  613. AVrfpIsBadHugeWritePtr(
  614. LPVOID lp,
  615. UINT_PTR cb
  616. );
  617. //WINBASEAPI
  618. BOOL
  619. WINAPI
  620. AVrfpIsBadCodePtr(
  621. FARPROC lpfn
  622. );
  623. //WINBASEAPI
  624. BOOL
  625. WINAPI
  626. AVrfpIsBadStringPtrA(
  627. LPCSTR lpsz,
  628. UINT_PTR cchMax
  629. );
  630. //WINBASEAPI
  631. BOOL
  632. WINAPI
  633. AVrfpIsBadStringPtrW(
  634. LPCWSTR lpsz,
  635. UINT_PTR cchMax
  636. );
  637. //WINBASEAPI
  638. DECLSPEC_NORETURN
  639. VOID
  640. WINAPI
  641. AVrfpExitProcess(
  642. IN UINT uExitCode
  643. );
  644. //WINBASEAPI
  645. BOOL
  646. WINAPI
  647. AVrfpVirtualFree(
  648. IN LPVOID lpAddress,
  649. IN SIZE_T dwSize,
  650. IN DWORD dwFreeType
  651. );
  652. //WINBASEAPI
  653. BOOL
  654. WINAPI
  655. AVrfpVirtualFreeEx(
  656. IN HANDLE hProcess,
  657. IN LPVOID lpAddress,
  658. IN SIZE_T dwSize,
  659. IN DWORD dwFreeType
  660. );
  661. /////////////////////////////////////////////////////////////////////
  662. /////////////////////////////////////// advapi32.dll verified exports
  663. /////////////////////////////////////////////////////////////////////
  664. typedef ACCESS_MASK REGSAM;
  665. #define AVRF_INDEX_ADVAPI32_REGCREATEKEYA 0
  666. #define AVRF_INDEX_ADVAPI32_REGCREATEKEYW 1
  667. #define AVRF_INDEX_ADVAPI32_REGCREATEKEYEXA 2
  668. #define AVRF_INDEX_ADVAPI32_REGCREATEKEYEXW 3
  669. #define AVRF_INDEX_ADVAPI32_REGOPENKEYA 4
  670. #define AVRF_INDEX_ADVAPI32_REGOPENKEYW 5
  671. #define AVRF_INDEX_ADVAPI32_REGOPENKEYEXA 6
  672. #define AVRF_INDEX_ADVAPI32_REGOPENKEYEXW 7
  673. //WINADVAPI
  674. LONG
  675. APIENTRY
  676. AVrfpRegCreateKeyExW (
  677. IN HKEY hKey,
  678. IN LPCWSTR lpSubKey,
  679. IN DWORD Reserved,
  680. IN LPWSTR lpClass,
  681. IN DWORD dwOptions,
  682. IN REGSAM samDesired,
  683. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  684. OUT PHKEY phkResult,
  685. OUT LPDWORD lpdwDisposition
  686. );
  687. //WINADVAPI
  688. LONG
  689. APIENTRY
  690. AVrfpRegCreateKeyA (
  691. IN HKEY hKey,
  692. IN LPCSTR lpSubKey,
  693. OUT PHKEY phkResult
  694. );
  695. //WINADVAPI
  696. LONG
  697. APIENTRY
  698. AVrfpRegCreateKeyW (
  699. IN HKEY hKey,
  700. IN LPCWSTR lpSubKey,
  701. OUT PHKEY phkResult
  702. );
  703. //WINADVAPI
  704. LONG
  705. APIENTRY
  706. AVrfpRegCreateKeyExA (
  707. IN HKEY hKey,
  708. IN LPCSTR lpSubKey,
  709. IN DWORD Reserved,
  710. IN LPSTR lpClass,
  711. IN DWORD dwOptions,
  712. IN REGSAM samDesired,
  713. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  714. OUT PHKEY phkResult,
  715. OUT LPDWORD lpdwDisposition
  716. );
  717. //WINADVAPI
  718. LONG
  719. APIENTRY
  720. AVrfpRegCreateKeyExW (
  721. IN HKEY hKey,
  722. IN LPCWSTR lpSubKey,
  723. IN DWORD Reserved,
  724. IN LPWSTR lpClass,
  725. IN DWORD dwOptions,
  726. IN REGSAM samDesired,
  727. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  728. OUT PHKEY phkResult,
  729. OUT LPDWORD lpdwDisposition
  730. );
  731. //WINADVAPI
  732. LONG
  733. APIENTRY
  734. AVrfpRegOpenKeyA (
  735. IN HKEY hKey,
  736. IN LPCSTR lpSubKey,
  737. OUT PHKEY phkResult
  738. );
  739. //WINADVAPI
  740. LONG
  741. APIENTRY
  742. AVrfpRegOpenKeyW (
  743. IN HKEY hKey,
  744. IN LPCWSTR lpSubKey,
  745. OUT PHKEY phkResult
  746. );
  747. //WINADVAPI
  748. LONG
  749. APIENTRY
  750. AVrfpRegOpenKeyExA (
  751. IN HKEY hKey,
  752. IN LPCSTR lpSubKey,
  753. IN DWORD ulOptions,
  754. IN REGSAM samDesired,
  755. OUT PHKEY phkResult
  756. );
  757. //WINADVAPI
  758. LONG
  759. APIENTRY
  760. AVrfpRegOpenKeyExW (
  761. IN HKEY hKey,
  762. IN LPCWSTR lpSubKey,
  763. IN DWORD ulOptions,
  764. IN REGSAM samDesired,
  765. OUT PHKEY phkResult
  766. );
  767. /////////////////////////////////////////////////////////////////////
  768. /////////////////////////////////////// msvcrt.dll verified exports
  769. /////////////////////////////////////////////////////////////////////
  770. #define AVRF_INDEX_MSVCRT_MALLOC 0
  771. #define AVRF_INDEX_MSVCRT_CALLOC 1
  772. #define AVRF_INDEX_MSVCRT_REALLOC 2
  773. #define AVRF_INDEX_MSVCRT_FREE 3
  774. #define AVRF_INDEX_MSVCRT_NEW 4
  775. #define AVRF_INDEX_MSVCRT_DELETE 5
  776. #define AVRF_INDEX_MSVCRT_NEWARRAY 6
  777. #define AVRF_INDEX_MSVCRT_DELETEARRAY 7
  778. PVOID __cdecl
  779. AVrfp_malloc (
  780. IN SIZE_T Size
  781. );
  782. PVOID __cdecl
  783. AVrfp_calloc (
  784. IN SIZE_T Number,
  785. IN SIZE_T Size
  786. );
  787. PVOID __cdecl
  788. AVrfp_realloc (
  789. IN PVOID Address,
  790. IN SIZE_T Size
  791. );
  792. VOID __cdecl
  793. AVrfp_free (
  794. IN PVOID Address
  795. );
  796. PVOID __cdecl
  797. AVrfp_new (
  798. IN SIZE_T Size
  799. );
  800. VOID __cdecl
  801. AVrfp_delete (
  802. IN PVOID Address
  803. );
  804. PVOID __cdecl
  805. AVrfp_newarray (
  806. IN SIZE_T Size
  807. );
  808. VOID __cdecl
  809. AVrfp_deletearray (
  810. IN PVOID Address
  811. );
  812. /////////////////////////////////////////////////////////////////////
  813. ////////////////////////////////////////// ole32.dll verified exports
  814. /////////////////////////////////////////////////////////////////////
  815. #define AVRF_INDEX_OLEAUT32_SYSALLOCSTRING 0
  816. #define AVRF_INDEX_OLEAUT32_SYSREALLOCSTRING 1
  817. #define AVRF_INDEX_OLEAUT32_SYSALLOCSTRINGLEN 2
  818. #define AVRF_INDEX_OLEAUT32_SYSREALLOCSTRINGLEN 3
  819. #define AVRF_INDEX_OLEAUT32_SYSALLOCSTRINGBYTELEN 4
  820. typedef WCHAR OLECHAR;
  821. BSTR STDAPICALLTYPE AVrfpSysAllocString(const OLECHAR *);
  822. INT STDAPICALLTYPE AVrfpSysReAllocString(BSTR *, const OLECHAR *);
  823. BSTR STDAPICALLTYPE AVrfpSysAllocStringLen(const OLECHAR *, UINT);
  824. INT STDAPICALLTYPE AVrfpSysReAllocStringLen(BSTR *, const OLECHAR *, UINT);
  825. BSTR STDAPICALLTYPE AVrfpSysAllocStringByteLen(LPCSTR psz, UINT len);
  826. #endif // _VERIFIER_H_