xref: /reactos/sdk/include/ddk/aux_klib.h (revision 34593d93)
1 /*
2  * aux_klib.h
3  *
4  * Auxiliary Kernel-Mode Library
5  *
6  * Contributors:
7  *   Victor Perevertkin <victor.perevertkin@reactos.org>
8  *
9  * THIS SOFTWARE IS NOT COPYRIGHTED
10  *
11  * This source code is offered for use in the public domain. You may
12  * use, modify or distribute it freely.
13  *
14  * This code is distributed in the hope that it will be useful but
15  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16  * DISCLAIMED. This includes but is not limited to warranties of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  */
20 
21 #pragma once
22 
23 #ifndef PIMAGE_EXPORT_DIRECTORY
24 #include <ntimage.h>
25 #endif
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define AUX_KLIB_MODULE_PATH_LEN 0x100
32 
33 typedef struct _AUX_MODULE_BASIC_INFO {
34     PVOID ImageBase;
35 } AUX_MODULE_BASIC_INFO, *PAUX_MODULE_BASIC_INFO;
36 
37 typedef struct _AUX_MODULE_EXTENDED_INFO {
38     AUX_MODULE_BASIC_INFO BasicInfo;
39     ULONG ImageSize;
40     USHORT FileNameOffset;
41     CHAR FullPathName[AUX_KLIB_MODULE_PATH_LEN];
42 } AUX_MODULE_EXTENDED_INFO, *PAUX_MODULE_EXTENDED_INFO;
43 
44 typedef struct _KBUGCHECK_DATA {
45     ULONG BugCheckDataSize;
46     ULONG BugCheckCode;
47     ULONG_PTR Parameter1;
48     ULONG_PTR Parameter2;
49     ULONG_PTR Parameter3;
50     ULONG_PTR Parameter4;
51 } KBUGCHECK_DATA, *PKBUGCHECK_DATA;
52 
53 CODE_SEG("PAGE")
54 NTSTATUS
55 NTAPI
56 AuxKlibInitialize(VOID);
57 
58 _IRQL_requires_max_(PASSIVE_LEVEL)
59 CODE_SEG("PAGE")
60 NTSTATUS
61 NTAPI
62 AuxKlibQueryModuleInformation(
63     _Inout_ PULONG InformationLength,
64     _In_ ULONG SizePerModule,
65     _Out_writes_bytes_opt_(*InformationLength) PAUX_MODULE_EXTENDED_INFO ModuleInfo);
66 
67 NTSTATUS
68 AuxKlibGetBugCheckData(
69     _Inout_ PKBUGCHECK_DATA BugCheckData);
70 
71 PIMAGE_EXPORT_DIRECTORY
72 AuxKlibGetImageExportDirectory(
73     _In_ PVOID ImageBase);
74 
75 _IRQL_requires_max_(PASSIVE_LEVEL)
76 CODE_SEG("PAGE")
77 NTSTATUS
78 NTAPI
79 AuxKlibEnumerateSystemFirmwareTables (
80     _In_ ULONG FirmwareTableProviderSignature,
81     _Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PVOID FirmwareTableBuffer,
82     _In_ ULONG BufferLength,
83     _Out_opt_ PULONG ReturnLength);
84 
85 _IRQL_requires_max_(PASSIVE_LEVEL)
86 CODE_SEG("PAGE")
87 NTSTATUS
88 NTAPI
89 AuxKlibGetSystemFirmwareTable (
90     _In_ ULONG FirmwareTableProviderSignature,
91     _In_ ULONG FirmwareTableID,
92     _Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PVOID FirmwareTableBuffer,
93     _In_ ULONG BufferLength,
94     _Out_opt_ PULONG ReturnLength);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99