summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntapi_fnapi.h
blob: 05ff9ab0d8a616ad6d60070cb2e97b556e6b489f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/********************************************************/
/*  ntapi: Native API core library                      */
/*  Copyright (C) 2013--2017  Z. Gilboa                 */
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
/********************************************************/

#ifndef ___NTAPI_FNAPI_H_
#define ___NTAPI_FNAPI_H_

#include <psxtypes/psxtypes.h>
#include <ntapi/ntapi.h>
#include "ntapi_hash_table.h"

#ifdef __cplusplus
extern "C" {
#endif

/* internal prototypes */
typedef int32_t __stdcall ntapi_tt_create_remote_runtime_data(
	__in		void *				hprocess,
	__in_out	nt_runtime_data_block *		runtime_data);

typedef void ** __cdecl ntapi_tt_get_csr_port_handle_addr_by_logic(void);

/* nt_object.h */
ntapi_tt_open_ipc_object_directory		__ntapi_tt_open_ipc_object_directory;
ntapi_tt_create_ipc_object_directory_entry	__ntapi_tt_create_ipc_object_directory_entry;
ntapi_tt_create_keyed_object_directory		__ntapi_tt_create_keyed_object_directory;
ntapi_tt_open_keyed_object_directory		__ntapi_tt_open_keyed_object_directory;
ntapi_tt_create_keyed_object_directory_entry	__ntapi_tt_create_keyed_object_directory_entry;

/* nt_crc32.h */
ntapi_tt_buffer_crc32				__ntapi_tt_buffer_crc32;
ntapi_tt_mbstr_crc32				__ntapi_tt_mbstr_crc32;
ntapi_tt_crc32_table				__ntapi_tt_crc32_table;

/* nt_crc64.h */
ntapi_tt_buffer_crc64				__ntapi_tt_buffer_crc64;
ntapi_tt_mbstr_crc64				__ntapi_tt_mbstr_crc64;
ntapi_tt_crc64_table				__ntapi_tt_crc64_table;

/* nt_file.h */
ntapi_tt_get_file_handle_type			__ntapi_tt_get_file_handle_type;
ntapi_tt_open_logical_parent_directory		__ntapi_tt_open_logical_parent_directory;
ntapi_tt_open_physical_parent_directory		__ntapi_tt_open_physical_parent_directory;


/* nt_ipc.h */
ntapi_ipc_connect_by_attr			__ntapi_ipc_connect_by_attr;
ntapi_ipc_connect_by_name			__ntapi_ipc_connect_by_name;
ntapi_ipc_connect_by_symlink			__ntapi_ipc_connect_by_symlink;
ntapi_ipc_connect_by_port			__ntapi_ipc_connect_by_port;
ntapi_ipc_connect_section_by_attr		__ntapi_ipc_connect_section_by_attr;
ntapi_ipc_connect_section_by_name		__ntapi_ipc_connect_section_by_name;
ntapi_ipc_connect_section_by_symlink		__ntapi_ipc_connect_section_by_symlink;
ntapi_ipc_connect_section_by_port		__ntapi_ipc_connect_section_by_port;
ntapi_ipc_get_port_by_attr			__ntapi_ipc_get_port_by_attr;
ntapi_ipc_get_port_section_by_attr		__ntapi_ipc_get_port_section_by_attr;
ntapi_ipc_init_section_by_port			__ntapi_ipc_init_section_by_port;
ntapi_ipc_disconnect_unmap_section_by_port	__ntapi_ipc_disconnect_unmap_section_by_port;
ntapi_ipc_create_pipe				__ntapi_ipc_create_pipe_v1;
ntapi_ipc_create_pipe				__ntapi_ipc_create_pipe_v2;

/* nt_sem.h */
ntapi_sem_create				__ntapi_sem_create;
ntapi_sem_open					__ntapi_sem_open;
ntapi_sem_fcntl					__ntapi_sem_fcntl;
ntapi_sem_ioctl					__ntapi_sem_ioctl;
ntapi_sem_query					__ntapi_sem_query;
ntapi_sem_set					__ntapi_sem_set;
ntapi_sem_cancel				__ntapi_sem_cancel;
ntapi_sem_free					__ntapi_sem_free;

/* nt_msq.h */
ntapi_msq_create				__ntapi_msq_create;
ntapi_msq_open					__ntapi_msq_open;
ntapi_msq_send					__ntapi_msq_send;
ntapi_msq_recv					__ntapi_msq_recv;
ntapi_msq_fcntl					__ntapi_msq_fcntl;
ntapi_msq_ioctl					__ntapi_msq_ioctl;
ntapi_msq_query					__ntapi_msq_query;
ntapi_msq_set					__ntapi_msq_set;
ntapi_msq_cancel				__ntapi_msq_cancel;
ntapi_msq_free					__ntapi_msq_free;

/* nt_ldr */
ntapi_ldr_load_system_dll			__ntapi_ldr_load_system_dll;
ntapi_ldr_create_state_snapshot			__ntapi_ldr_create_state_snapshot;
ntapi_ldr_revert_state_to_snapshot		__ntapi_ldr_revert_state_to_snapshot;

/* nt_string.h */
ntapi_tt_string_null_offset_multibyte		__ntapi_tt_string_null_offset_multibyte;
ntapi_tt_string_null_offset_short		__ntapi_tt_string_null_offset_short;
ntapi_tt_string_null_offset_dword		__ntapi_tt_string_null_offset_dword;
ntapi_tt_string_null_offset_qword		__ntapi_tt_string_null_offset_qword;
ntapi_tt_string_null_offset_ptrsize		__ntapi_tt_string_null_offset_ptrsize;
ntapi_tt_strcmp_multibyte			__ntapi_tt_strcmp_multibyte;
ntapi_tt_strcmp_utf16				__ntapi_tt_strcmp_utf16;
ntapi_tt_strncmp_multibyte			__ntapi_tt_strncmp_multibyte;
ntapi_tt_strncmp_utf16				__ntapi_tt_strncmp_utf16;
ntapi_tt_aligned_block_memset			__ntapi_tt_aligned_block_memset;
ntapi_tt_aligned_block_memcpy			__ntapi_tt_aligned_block_memcpy;
ntapi_tt_init_unicode_string_from_utf16		__ntapi_tt_init_unicode_string_from_utf16;
ntapi_tt_memcpy_utf16				__ntapi_tt_memcpy_utf16;
ntapi_tt_aligned_memcpy_utf16			__ntapi_tt_aligned_memcpy_utf16;
ntapi_tt_generic_memset				__ntapi_tt_generic_memset;
ntapi_tt_generic_memcpy				__ntapi_tt_generic_memcpy;
ntapi_tt_uint16_to_hex_utf16			__ntapi_tt_uint16_to_hex_utf16;
ntapi_tt_uint32_to_hex_utf16			__ntapi_tt_uint32_to_hex_utf16;
ntapi_tt_uint64_to_hex_utf16			__ntapi_tt_uint64_to_hex_utf16;
ntapi_tt_uintptr_to_hex_utf16			__ntapi_tt_uintptr_to_hex_utf16;
ntapi_tt_hex_utf16_to_uint16			__ntapi_tt_hex_utf16_to_uint16;
ntapi_tt_hex_utf16_to_uint32			__ntapi_tt_hex_utf16_to_uint32;
ntapi_tt_hex_utf16_to_uint64			__ntapi_tt_hex_utf16_to_uint64;
ntapi_tt_hex_utf16_to_uintptr			__ntapi_tt_hex_utf16_to_uintptr;
ntapi_tt_uint16_to_hex_utf8			__ntapi_tt_uint16_to_hex_utf8;
ntapi_tt_uint32_to_hex_utf8			__ntapi_tt_uint32_to_hex_utf8;
ntapi_tt_uint64_to_hex_utf8			__ntapi_tt_uint64_to_hex_utf8;
ntapi_tt_uintptr_to_hex_utf8			__ntapi_tt_uintptr_to_hex_utf8;
ntapi_wcslen					__ntapi_tt_wcslen;

/* nt_guid.h */
ntapi_tt_guid_to_string_utf16			__ntapi_tt_guid_to_string_utf16;
ntapi_tt_string_to_guid_utf16			__ntapi_tt_string_to_guid_utf16;

/* nt_sysinfo.h */
ntapi_tt_get_system_directory_native_path	__ntapi_tt_get_system_directory_native_path;
ntapi_tt_get_system_directory_dos_path		__ntapi_tt_get_system_directory_dos_path;
ntapi_tt_get_system_directory_handle		__ntapi_tt_get_system_directory_handle;
ntapi_tt_get_system_info_snapshot		__ntapi_tt_get_system_info_snapshot;

/* nt_thread.h */
ntapi_tt_create_thread				__ntapi_tt_create_thread;
ntapi_tt_create_local_thread			__ntapi_tt_create_local_thread;
ntapi_tt_create_remote_thread			__ntapi_tt_create_remote_thread;

/* nt_process.h */
ntapi_tt_fork					__ntapi_tt_fork;
ntapi_tt_fork					__ntapi_tt_fork_v1;
ntapi_tt_fork					__ntapi_tt_fork_v2;
ntapi_tt_create_remote_process_params		__ntapi_tt_create_remote_process_params;
ntapi_tt_create_remote_runtime_data		__ntapi_tt_create_remote_runtime_data;
ntapi_tt_create_native_process			__ntapi_tt_create_native_process_v1;
ntapi_tt_create_native_process			__ntapi_tt_create_native_process_v2;
ntapi_tt_spawn_native_process			__ntapi_tt_spawn_native_process;
ntapi_tt_get_runtime_data			__ntapi_tt_get_runtime_data;
ntapi_tt_init_runtime_data			__ntapi_tt_init_runtime_data;
ntapi_tt_update_runtime_data			__ntapi_tt_update_runtime_data;
ntapi_tt_exec_map_image_as_data			__ntapi_tt_exec_map_image_as_data;
ntapi_tt_exec_unmap_image			__ntapi_tt_exec_unmap_image;

/* nt_token.h */
ntapi_tt_enable_token_privilege			__ntapi_tt_enable_token_privilege;
ntapi_tt_disable_token_privilege		__ntapi_tt_disable_token_privilege;

/* nt_section.h */
ntapi_tt_get_section_name			__ntapi_tt_get_section_name;

/* nt_sync.h */
ntapi_tt_create_inheritable_event		__ntapi_tt_create_inheritable_event;
ntapi_tt_create_private_event			__ntapi_tt_create_private_event;
ntapi_tt_wait_for_dummy_event			__ntapi_tt_wait_for_dummy_event;
ntapi_tt_sync_block_init			__ntapi_tt_sync_block_init;
ntapi_tt_sync_block_discard			__ntapi_tt_sync_block_discard;
ntapi_tt_sync_block_lock			__ntapi_tt_sync_block_lock;
ntapi_tt_sync_block_unlock			__ntapi_tt_sync_block_unlock;
ntapi_tt_sync_block_server_lock			__ntapi_tt_sync_block_server_lock;

/* nt_port.h */
ntapi_tt_port_guid_from_type			__ntapi_tt_port_guid_from_type;
ntapi_tt_port_type_from_guid			__ntapi_tt_port_type_from_guid;
ntapi_tt_port_generate_keys			__ntapi_tt_port_generate_keys;
ntapi_tt_port_format_keys			__ntapi_tt_port_format_keys;
ntapi_tt_port_name_from_attr			__ntapi_tt_port_name_from_attr;
ntapi_tt_port_attr_from_name			__ntapi_tt_port_attr_from_name;
ntapi_tt_port_attr_from_string			__ntapi_tt_port_attr_from_string;
ntapi_tt_port_attr_from_symlink			__ntapi_tt_port_attr_from_symlink;

/* nt_argv.h */
ntapi_tt_get_cmd_line_utf16			__ntapi_tt_get_cmd_line_utf16;
ntapi_tt_get_peb_env_block_utf16		__ntapi_tt_get_peb_env_block_utf16;
ntapi_tt_parse_cmd_line_args_utf16		__ntapi_tt_parse_cmd_line_args_utf16;
ntapi_tt_get_argv_envp_utf8			__ntapi_tt_get_argv_envp_utf8;
ntapi_tt_get_argv_envp_utf16			__ntapi_tt_get_argv_envp_utf16;
ntapi_tt_get_env_var_meta_utf8			__ntapi_tt_get_env_var_meta_utf8;
ntapi_tt_get_env_var_meta_utf16			__ntapi_tt_get_env_var_meta_utf16;
ntapi_tt_array_copy_utf8			__ntapi_tt_array_copy_utf8;
ntapi_tt_array_copy_utf16			__ntapi_tt_array_copy_utf16;
ntapi_tt_array_convert_utf8_to_utf16		__ntapi_tt_array_convert_utf8_to_utf16;
ntapi_tt_array_convert_utf16_to_utf8		__ntapi_tt_array_convert_utf16_to_utf8;

/* nt_blitter.h */
ntapi_blt_alloc					__ntapi_blt_alloc;
ntapi_blt_free					__ntapi_blt_free;
ntapi_blt_acquire				__ntapi_blt_acquire;
ntapi_blt_obtain				__ntapi_blt_obtain;
ntapi_blt_possess				__ntapi_blt_possess;
ntapi_blt_release				__ntapi_blt_release;
ntapi_blt_get					__ntapi_blt_get;
ntapi_blt_set					__ntapi_blt_set;

/* nt_unicode.h */
ntapi_uc_validate_unicode_stream_utf8		__ntapi_uc_validate_unicode_stream_utf8;
ntapi_uc_validate_unicode_stream_utf16		__ntapi_uc_validate_unicode_stream_utf16;
ntapi_uc_get_code_point_byte_count_utf8		__ntapi_uc_get_code_point_byte_count_utf8;
ntapi_uc_get_code_point_byte_count_utf16	__ntapi_uc_get_code_point_byte_count_utf16;
ntapi_uc_convert_unicode_stream_utf8_to_utf16	__ntapi_uc_convert_unicode_stream_utf8_to_utf16;
ntapi_uc_convert_unicode_stream_utf8_to_utf32	__ntapi_uc_convert_unicode_stream_utf8_to_utf32;
ntapi_uc_convert_unicode_stream_utf16_to_utf8	__ntapi_uc_convert_unicode_stream_utf16_to_utf8;
ntapi_uc_convert_unicode_stream_utf16_to_utf32	__ntapi_uc_convert_unicode_stream_utf16_to_utf32;


/* nt_daemon.h */
ntapi_dsr_init					__ntapi_dsr_init;
ntapi_dsr_start					__ntapi_dsr_start;
ntapi_dsr_create_port				__ntapi_dsr_create_port;
ntapi_dsr_connect_internal_client		__ntapi_dsr_connect_internal_client;
ntapi_dsr_internal_client_connect		__ntapi_dsr_internal_client_connect;

/* nt_vfd.h */
ntapi_vfd_dev_name_init				__ntapi_vfd_dev_name_init;

/* nt_tty.h */
ntapi_tty_create_session			__ntapi_tty_create_session;
ntapi_tty_join_session				__ntapi_tty_join_session;
ntapi_tty_connect				__ntapi_tty_connect;
ntapi_tty_client_session_disconnect		__ntapi_tty_client_session_disconnect;
ntapi_tty_client_session_query			__ntapi_tty_client_session_query;
ntapi_tty_client_session_set			__ntapi_tty_client_session_set;
ntapi_tty_client_process_register		__ntapi_tty_client_process_register;
ntapi_tty_query_information_section		__ntapi_tty_query_information_section;
ntapi_tty_query_information_server		__ntapi_tty_query_information_server;
ntapi_tty_query_information_service		__ntapi_tty_query_information_service;
ntapi_tty_request_peer				__ntapi_tty_request_peer;
ntapi_tty_vms_query				__ntapi_tty_vms_query;
ntapi_tty_vms_request				__ntapi_tty_vms_request;
ntapi_pty_open					__ntapi_pty_open;
ntapi_pty_open_pair				__ntapi_pty_open_pair;
ntapi_pty_reopen				__ntapi_pty_reopen;
ntapi_pty_inherit 				__ntapi_pty_inherit;
ntapi_pty_inherit_runtime_ctty 			__ntapi_pty_inherit_runtime_ctty;
ntapi_pty_close					__ntapi_pty_close;
ntapi_pty_read					__ntapi_pty_read;
ntapi_pty_write					__ntapi_pty_write;
ntapi_pty_ioctl					__ntapi_pty_ioctl;
ntapi_pty_query					__ntapi_pty_query;
ntapi_pty_set					__ntapi_pty_set;
ntapi_pty_cancel				__ntapi_pty_cancel;

/* nt_socket.h */
ntapi_sc_socket					__ntapi_sc_socket_v1;
ntapi_sc_socket					__ntapi_sc_socket_v2;
ntapi_sc_bind					__ntapi_sc_bind_v1;
ntapi_sc_bind					__ntapi_sc_bind_v2;
ntapi_sc_connect				__ntapi_sc_connect_v1;
ntapi_sc_connect				__ntapi_sc_connect_v2;
ntapi_sc_getsockname				__ntapi_sc_getsockname_v1;
ntapi_sc_getsockname				__ntapi_sc_getsockname_v2;
ntapi_sc_getpeername				__ntapi_sc_getpeername_v1;
ntapi_sc_getpeername				__ntapi_sc_getpeername_v2;
ntapi_sc_server_accept_connection		__ntapi_sc_server_accept_connection_v1;
ntapi_sc_server_accept_connection		__ntapi_sc_server_accept_connection_v2;
ntapi_sc_server_duplicate_socket		__ntapi_sc_server_duplicate_socket;
ntapi_sc_setsockopt				__ntapi_sc_setsockopt;
ntapi_sc_getsockopt				__ntapi_sc_getsockopt;
ntapi_sc_listen					__ntapi_sc_listen;
ntapi_sc_accept					__ntapi_sc_accept;
ntapi_sc_send					__ntapi_sc_send;
ntapi_sc_recv					__ntapi_sc_recv;
ntapi_sc_shutdown				__ntapi_sc_shutdown;
ntapi_sc_wait					__ntapi_sc_wait;

/* nt_mount.h */
ntapi_tt_get_dos_drive_device_handle		__ntapi_tt_get_dos_drive_device_handle;
ntapi_tt_get_dos_drive_root_handle		__ntapi_tt_get_dos_drive_root_handle;
ntapi_tt_get_dos_drive_device_name		__ntapi_tt_get_dos_drive_device_name;
ntapi_tt_get_dos_drive_mount_points		__ntapi_tt_get_dos_drive_mount_points;
ntapi_tt_dev_mount_points_to_statfs		__ntapi_tt_dev_mount_points_to_statfs;
ntapi_tt_get_dos_drive_letter_from_device	__ntapi_tt_get_dos_drive_letter_from_device;

/* nt_istat.h */
ntapi_tt_istat					__ntapi_tt_istat;

/* nt_stat.h */
ntapi_tt_stat					__ntapi_tt_stat;

/* nt_statfs.h */
ntapi_tt_statfs					__ntapi_tt_statfs;

/* nt_hashes.h */
ntapi_tt_populate_hashed_import_table		__ntapi_tt_populate_hashed_import_table;

/* nt_guid.h */
ntapi_tt_guid_copy				__ntapi_tt_guid_copy;
ntapi_tt_guid_compare				__ntapi_tt_guid_compare;
ntapi_tt_guid_to_string_utf16			__ntapi_tt_guid_to_string_utf16;
ntapi_tt_string_to_guid_utf16			__ntapi_tt_string_to_guid_utf16;

/* debug */
ntapi_dbg_write					__dbg_write;
ntapi_dbg_fn_call				__dbg_fn_call;
ntapi_dbg_msg					__dbg_msg;

/* csrss */
ntapi_tt_get_csr_port_handle_addr_by_logic	__GET_CSR_PORT_HANDLE_BY_LOGIC;
ntapi_csr_port_handle				__ntapi_csr_port_handle;

#ifdef __cplusplus
}
#endif
#endif