diff options
author | midipix <writeonce@midipix.org> | 2019-02-22 22:53:39 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-02-22 23:05:58 -0500 |
commit | 766a639b263460187852043816a4ed06920e624b (patch) | |
tree | 57e199aec98c27a9fe1687bae18a863709831417 /src | |
parent | 919f4260802aee4b33c8b3cf4413ce445a6d0c38 (diff) | |
download | ntapi-766a639b263460187852043816a4ed06920e624b.tar.bz2 ntapi-766a639b263460187852043816a4ed06920e624b.tar.xz |
internals: explicitly attribute protected visibility to all interfaces.
Diffstat (limited to 'src')
21 files changed, 271 insertions, 242 deletions
diff --git a/src/hash/ntapi_tt_crc32.c b/src/hash/ntapi_tt_crc32.c index 0a3d459..2e0630a 100644 --- a/src/hash/ntapi_tt_crc32.c +++ b/src/hash/ntapi_tt_crc32.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_crc32.h> +#include "ntapi_impl.h" static const uint32_t crc32_table[256] = NTAPI_CRC32_TABLE; diff --git a/src/hash/ntapi_tt_crc64.c b/src/hash/ntapi_tt_crc64.c index fd76ec5..8fa7f60 100644 --- a/src/hash/ntapi_tt_crc64.c +++ b/src/hash/ntapi_tt_crc64.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_crc64.h> +#include "ntapi_impl.h" static const uint64_t crc64_table[256] = NTAPI_CRC64_TABLE; diff --git a/src/internal/ntapi_fnapi.h b/src/internal/ntapi_fnapi.h index 42bbdbf..0d50970 100644 --- a/src/internal/ntapi_fnapi.h +++ b/src/internal/ntapi_fnapi.h @@ -15,6 +15,10 @@ extern "C" { #endif +#define NTAPI_UFN(fn) __attr_protected__ ntapi_##fn __ntapi_##fn +#define NTAPI_SFN(fn) __attr_protected__ ntapi_##fn __ntapi_tt_##fn +#define NTAPI_VFN(fn,v) __attr_protected__ ntapi_##fn __ntapi_##fn##_##v + /* internal prototypes */ typedef int32_t __stdcall ntapi_tt_create_remote_runtime_data( __in void * hprocess, @@ -23,316 +27,317 @@ typedef int32_t __stdcall ntapi_tt_create_remote_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_open_dev_object_directory __ntapi_tt_open_dev_object_directory; -ntapi_tt_create_dev_object_directory_entry __ntapi_tt_create_dev_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; -ntapi_tt_keyed_object_to_key __ntapi_tt_keyed_object_to_key; -ntapi_tt_sid_copy __ntapi_tt_sid_copy; -ntapi_tt_sid_compare __ntapi_tt_sid_compare; +NTAPI_UFN(tt_open_ipc_object_directory); +NTAPI_UFN(tt_create_ipc_object_directory_entry); +NTAPI_UFN(tt_open_dev_object_directory); +NTAPI_UFN(tt_create_dev_object_directory_entry); +NTAPI_UFN(tt_create_keyed_object_directory); +NTAPI_UFN(tt_open_keyed_object_directory); +NTAPI_UFN(tt_create_keyed_object_directory_entry); +NTAPI_UFN(tt_keyed_object_to_key); +NTAPI_UFN(tt_sid_copy); +NTAPI_UFN(tt_sid_compare); /* 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; +NTAPI_UFN(tt_buffer_crc32); +NTAPI_UFN(tt_mbstr_crc32); +NTAPI_UFN(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; +NTAPI_UFN(tt_buffer_crc64); +NTAPI_UFN(tt_mbstr_crc64); +NTAPI_UFN(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; -ntapi_tt_open_volume_by_guid __ntapi_tt_open_volume_by_guid; +NTAPI_UFN(tt_get_file_handle_type); +NTAPI_UFN(tt_open_logical_parent_directory); +NTAPI_UFN(tt_open_physical_parent_directory); +NTAPI_UFN(tt_open_volume_by_guid); /* 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; +NTAPI_UFN(ipc_connect_by_attr); +NTAPI_UFN(ipc_connect_by_name); +NTAPI_UFN(ipc_connect_by_symlink); +NTAPI_UFN(ipc_connect_by_port); +NTAPI_UFN(ipc_connect_section_by_attr); +NTAPI_UFN(ipc_connect_section_by_name); +NTAPI_UFN(ipc_connect_section_by_symlink); +NTAPI_UFN(ipc_connect_section_by_port); +NTAPI_UFN(ipc_get_port_by_attr); +NTAPI_UFN(ipc_get_port_section_by_attr); +NTAPI_UFN(ipc_init_section_by_port); +NTAPI_UFN(ipc_disconnect_unmap_section_by_port); +NTAPI_VFN(ipc_create_pipe,v1); +NTAPI_VFN(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; +NTAPI_UFN(sem_create); +NTAPI_UFN(sem_open); +NTAPI_UFN(sem_fcntl); +NTAPI_UFN(sem_ioctl); +NTAPI_UFN(sem_query); +NTAPI_UFN(sem_set); +NTAPI_UFN(sem_cancel); +NTAPI_UFN(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; +NTAPI_UFN(msq_create); +NTAPI_UFN(msq_open); +NTAPI_UFN(msq_send); +NTAPI_UFN(msq_recv); +NTAPI_UFN(msq_fcntl); +NTAPI_UFN(msq_ioctl); +NTAPI_UFN(msq_query); +NTAPI_UFN(msq_set); +NTAPI_UFN(msq_cancel); +NTAPI_UFN(msq_free); /* nt_afl.h */ -ntapi_afl_create __ntapi_afl_create; -ntapi_afl_open __ntapi_afl_open; -ntapi_afl_fcntl __ntapi_afl_fcntl; -ntapi_afl_ioctl __ntapi_afl_ioctl; -ntapi_afl_query __ntapi_afl_query; -ntapi_afl_set __ntapi_afl_set; -ntapi_afl_cancel __ntapi_afl_cancel; -ntapi_afl_free __ntapi_afl_free; +NTAPI_UFN(afl_create); +NTAPI_UFN(afl_open); +NTAPI_UFN(afl_fcntl); +NTAPI_UFN(afl_ioctl); +NTAPI_UFN(afl_query); +NTAPI_UFN(afl_set); +NTAPI_UFN(afl_cancel); +NTAPI_UFN(afl_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; +NTAPI_UFN(ldr_load_system_dll); +NTAPI_UFN(ldr_create_state_snapshot); +NTAPI_UFN(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_aligned_block_memlock __ntapi_tt_aligned_block_memlock; -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_tt_uintptr_to_dec_utf16 __ntapi_tt_uintptr_to_dec_utf16; -ntapi_tt_uintptr_to_dec_utf8 __ntapi_tt_uintptr_to_dec_utf8; -ntapi_tt_uintptr_to_dec_null_utf16 __ntapi_tt_uintptr_to_dec_null_utf16; -ntapi_tt_uintptr_to_dec_null_utf8 __ntapi_tt_uintptr_to_dec_null_utf8; -ntapi_tt_dec_utf16_to_uint16 __ntapi_tt_dec_utf16_to_uint16; -ntapi_tt_dec_utf16_to_uint32 __ntapi_tt_dec_utf16_to_uint32; -ntapi_tt_dec_utf16_to_uint64 __ntapi_tt_dec_utf16_to_uint64; -ntapi_tt_dec_utf16_to_uintptr __ntapi_tt_dec_utf16_to_uintptr; -ntapi_wcslen __ntapi_tt_wcslen; +NTAPI_UFN(tt_string_null_offset_multibyte); +NTAPI_UFN(tt_string_null_offset_short); +NTAPI_UFN(tt_string_null_offset_dword); +NTAPI_UFN(tt_string_null_offset_qword); +NTAPI_UFN(tt_string_null_offset_ptrsize); +NTAPI_UFN(tt_strcmp_multibyte); +NTAPI_UFN(tt_strcmp_utf16); +NTAPI_UFN(tt_strncmp_multibyte); +NTAPI_UFN(tt_strncmp_utf16); +NTAPI_UFN(tt_aligned_block_memset); +NTAPI_UFN(tt_aligned_block_memcpy); +NTAPI_UFN(tt_aligned_block_memlock); +NTAPI_UFN(tt_init_unicode_string_from_utf16); +NTAPI_UFN(tt_memcpy_utf16); +NTAPI_UFN(tt_aligned_memcpy_utf16); +NTAPI_UFN(tt_generic_memset); +NTAPI_UFN(tt_generic_memcpy); +NTAPI_UFN(tt_uint16_to_hex_utf16); +NTAPI_UFN(tt_uint32_to_hex_utf16); +NTAPI_UFN(tt_uint64_to_hex_utf16); +NTAPI_UFN(tt_uintptr_to_hex_utf16); +NTAPI_UFN(tt_hex_utf16_to_uint16); +NTAPI_UFN(tt_hex_utf16_to_uint32); +NTAPI_UFN(tt_hex_utf16_to_uint64); +NTAPI_UFN(tt_hex_utf16_to_uintptr); +NTAPI_UFN(tt_uint16_to_hex_utf8); +NTAPI_UFN(tt_uint32_to_hex_utf8); +NTAPI_UFN(tt_uint64_to_hex_utf8); +NTAPI_UFN(tt_uintptr_to_hex_utf8); +NTAPI_UFN(tt_uintptr_to_dec_utf16); +NTAPI_UFN(tt_uintptr_to_dec_utf8); +NTAPI_UFN(tt_uintptr_to_dec_null_utf16); +NTAPI_UFN(tt_uintptr_to_dec_null_utf8); +NTAPI_UFN(tt_dec_utf16_to_uint16); +NTAPI_UFN(tt_dec_utf16_to_uint32); +NTAPI_UFN(tt_dec_utf16_to_uint64); +NTAPI_UFN(tt_dec_utf16_to_uintptr); +NTAPI_SFN(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; +NTAPI_UFN(tt_guid_to_string_utf16); +NTAPI_UFN(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; +NTAPI_UFN(tt_get_system_directory_native_path); +NTAPI_UFN(tt_get_system_directory_dos_path); +NTAPI_UFN(tt_get_system_directory_handle); +NTAPI_UFN(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; +NTAPI_UFN(tt_create_thread); +NTAPI_UFN(tt_create_local_thread); +NTAPI_UFN(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_spawn_foreign_process __ntapi_tt_spawn_foreign_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; +NTAPI_UFN(tt_fork); +NTAPI_VFN(tt_fork,v1); +NTAPI_VFN(tt_fork,v2); +NTAPI_UFN(tt_create_remote_process_params); +NTAPI_UFN(tt_create_remote_runtime_data); +NTAPI_VFN(tt_create_native_process,v1); +NTAPI_VFN(tt_create_native_process,v2); +NTAPI_UFN(tt_spawn_native_process); +NTAPI_UFN(tt_spawn_foreign_process); +NTAPI_UFN(tt_get_runtime_data); +NTAPI_UFN(tt_init_runtime_data); +NTAPI_UFN(tt_update_runtime_data); +NTAPI_UFN(tt_exec_map_image_as_data); +NTAPI_UFN(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; +NTAPI_UFN(tt_enable_token_privilege); +NTAPI_UFN(tt_disable_token_privilege); /* nt_section.h */ -ntapi_tt_get_section_name __ntapi_tt_get_section_name; +NTAPI_UFN(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; +NTAPI_UFN(tt_create_inheritable_event); +NTAPI_UFN(tt_create_private_event); +NTAPI_UFN(tt_wait_for_dummy_event); +NTAPI_UFN(tt_sync_block_init); +NTAPI_UFN(tt_sync_block_discard); +NTAPI_UFN(tt_sync_block_lock); +NTAPI_UFN(tt_sync_block_unlock); +NTAPI_UFN(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; +NTAPI_UFN(tt_port_guid_from_type); +NTAPI_UFN(tt_port_type_from_guid); +NTAPI_UFN(tt_port_generate_keys); +NTAPI_UFN(tt_port_format_keys); +NTAPI_UFN(tt_port_name_from_attr); +NTAPI_UFN(tt_port_attr_from_name); +NTAPI_UFN(tt_port_attr_from_string); +NTAPI_UFN(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; +NTAPI_UFN(tt_get_cmd_line_utf16); +NTAPI_UFN(tt_get_peb_env_block_utf16); +NTAPI_UFN(tt_parse_cmd_line_args_utf16); +NTAPI_UFN(tt_get_argv_envp_utf8); +NTAPI_UFN(tt_get_argv_envp_utf16); +NTAPI_UFN(tt_get_env_var_meta_utf8); +NTAPI_UFN(tt_get_env_var_meta_utf16); +NTAPI_UFN(tt_array_copy_utf8); +NTAPI_UFN(tt_array_copy_utf16); +NTAPI_UFN(tt_array_convert_utf8_to_utf16); +NTAPI_UFN(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; +NTAPI_UFN(blt_alloc); +NTAPI_UFN(blt_free); +NTAPI_UFN(blt_acquire); +NTAPI_UFN(blt_obtain); +NTAPI_UFN(blt_possess); +NTAPI_UFN(blt_release); +NTAPI_UFN(blt_get); +NTAPI_UFN(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; +NTAPI_UFN(uc_validate_unicode_stream_utf8); +NTAPI_UFN(uc_validate_unicode_stream_utf16); +NTAPI_UFN(uc_get_code_point_byte_count_utf8); +NTAPI_UFN(uc_get_code_point_byte_count_utf16); +NTAPI_UFN(uc_convert_unicode_stream_utf8_to_utf16); +NTAPI_UFN(uc_convert_unicode_stream_utf8_to_utf32); +NTAPI_UFN(uc_convert_unicode_stream_utf16_to_utf8); +NTAPI_UFN(uc_convert_unicode_stream_utf16_to_utf32); /* nt_daemon.h */ -ntapi_dsr_init __ntapi_dsr_init; -ntapi_dsr_create_port __ntapi_dsr_create_port; +NTAPI_UFN(dsr_init); +NTAPI_UFN(dsr_create_port); /* nt_acl.h */ -ntapi_acl_init_common_descriptor __ntapi_acl_init_common_descriptor; -ntapi_acl_init_common_descriptor_meta __ntapi_acl_init_common_descriptor_meta; +NTAPI_UFN(acl_init_common_descriptor); +NTAPI_UFN(acl_init_common_descriptor_meta); /* nt_vfd.h */ -ntapi_vfd_dev_name_init __ntapi_vfd_dev_name_init; +NTAPI_UFN(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_query_server_pts_slot_info __ntapi_tty_query_server_pts_slot_info; -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_xquery __ntapi_pty_xquery; -ntapi_pty_set __ntapi_pty_set; -ntapi_pty_cancel __ntapi_pty_cancel; +NTAPI_UFN(tty_create_session); +NTAPI_UFN(tty_join_session); +NTAPI_UFN(tty_connect); +NTAPI_UFN(tty_client_session_disconnect); +NTAPI_UFN(tty_client_session_query); +NTAPI_UFN(tty_client_session_set); +NTAPI_UFN(tty_client_process_register); +NTAPI_UFN(tty_query_information_section); +NTAPI_UFN(tty_query_information_server); +NTAPI_UFN(tty_query_information_service); +NTAPI_UFN(tty_query_server_pts_slot_info); +NTAPI_UFN(tty_request_peer); +NTAPI_UFN(tty_vms_query); +NTAPI_UFN(tty_vms_request); +NTAPI_UFN(pty_open); +NTAPI_UFN(pty_open_pair); +NTAPI_UFN(pty_reopen); +NTAPI_UFN(pty_inherit ); +NTAPI_UFN(pty_inherit_runtime_ctty ); +NTAPI_UFN(pty_close); +NTAPI_UFN(pty_read); +NTAPI_UFN(pty_write); +NTAPI_UFN(pty_ioctl); +NTAPI_UFN(pty_query); +NTAPI_UFN(pty_xquery); +NTAPI_UFN(pty_set); +NTAPI_UFN(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; +NTAPI_VFN(sc_socket,v1); +NTAPI_VFN(sc_socket,v2); +NTAPI_VFN(sc_bind,v1); +NTAPI_VFN(sc_bind,v2); +NTAPI_VFN(sc_connect,v1); +NTAPI_VFN(sc_connect,v2); +NTAPI_VFN(sc_getsockname,v1); +NTAPI_VFN(sc_getsockname,v2); +NTAPI_VFN(sc_getpeername,v1); +NTAPI_VFN(sc_getpeername,v2); +NTAPI_VFN(sc_server_accept_connection,v1); +NTAPI_VFN(sc_server_accept_connection,v2); +NTAPI_UFN(sc_server_duplicate_socket); +NTAPI_UFN(sc_setsockopt); +NTAPI_UFN(sc_getsockopt); +NTAPI_UFN(sc_listen); +NTAPI_UFN(sc_accept); +NTAPI_UFN(sc_send); +NTAPI_UFN(sc_recv); +NTAPI_UFN(sc_shutdown); +NTAPI_UFN(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; +NTAPI_UFN(tt_get_dos_drive_device_handle); +NTAPI_UFN(tt_get_dos_drive_root_handle); +NTAPI_UFN(tt_get_dos_drive_device_name); +NTAPI_UFN(tt_get_dos_drive_mount_points); +NTAPI_UFN(tt_dev_mount_points_to_statfs); +NTAPI_UFN(tt_get_dos_drive_letter_from_device); /* nt_istat.h */ -ntapi_tt_istat __ntapi_tt_istat; +NTAPI_UFN(tt_istat); /* nt_stat.h */ -ntapi_tt_stat __ntapi_tt_stat; +NTAPI_UFN(tt_stat); /* nt_statfs.h */ -ntapi_tt_statfs __ntapi_tt_statfs; +NTAPI_UFN(tt_statfs); /* nt_hashes.h */ -ntapi_tt_populate_hashed_import_table __ntapi_tt_populate_hashed_import_table; +NTAPI_UFN(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; +NTAPI_UFN(tt_guid_copy); +NTAPI_UFN(tt_guid_compare); +NTAPI_UFN(tt_guid_to_string_utf16); +NTAPI_UFN(tt_string_to_guid_utf16); /* debug */ -ntapi_dbg_write __dbg_write; -ntapi_dbg_fn_call __dbg_fn_call; -ntapi_dbg_msg __dbg_msg; +NTAPI_UFN(dbg_write); +NTAPI_UFN(dbg_fn_call); +NTAPI_UFN(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; +NTAPI_VFN(tt_get_csr_port_handle_addr_by_logic,i386); +NTAPI_VFN(tt_get_csr_port_handle_addr_by_logic,x86_64); +NTAPI_UFN(csr_port_handle); #ifdef __cplusplus } diff --git a/src/ldr/ntapi_ldr_create_state_snapshot.c b/src/ldr/ntapi_ldr_create_state_snapshot.c index d0aaf2a..77281f2 100644 --- a/src/ldr/ntapi_ldr_create_state_snapshot.c +++ b/src/ldr/ntapi_ldr_create_state_snapshot.c @@ -8,6 +8,7 @@ #include <pemagine/pemagine.h> #include <dalist/dalist.h> #include <ntapi/ntapi.h> +#include "ntapi_impl.h" struct callback_ctx { struct dalist_ex * ldr_state_snapshot; diff --git a/src/process/ntapi_tt_fork_v1.c b/src/process/ntapi_tt_fork_v1.c index 72b642e..eeee49b 100644 --- a/src/process/ntapi_tt_fork_v1.c +++ b/src/process/ntapi_tt_fork_v1.c @@ -43,6 +43,7 @@ static intptr_t __tt_fork_cancel(void * hprocess,int32_t status) return (intptr_t)(-1); } +__attr_protected__ intptr_t __fastcall __tt_fork_impl_v1( uintptr_t saved_regs_stack_pointer, uintptr_t stack_adjustment) diff --git a/src/process/ntapi_tt_fork_v2.c b/src/process/ntapi_tt_fork_v2.c index f3c62da..032fe9d 100644 --- a/src/process/ntapi_tt_fork_v2.c +++ b/src/process/ntapi_tt_fork_v2.c @@ -22,6 +22,7 @@ static intptr_t __tt_fork_cancel(void * hprocess,int32_t status) return (intptr_t)(-1); } +__attr_protected__ intptr_t __fastcall __tt_fork_impl_v2( __out void ** hprocess, __out void ** hthread) diff --git a/src/string/ntapi_tt_aligned_block_memcpy.c b/src/string/ntapi_tt_aligned_block_memcpy.c index ea239a7..dda33b6 100644 --- a/src/string/ntapi_tt_aligned_block_memcpy.c +++ b/src/string/ntapi_tt_aligned_block_memcpy.c @@ -7,6 +7,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_string.h> +__attr_protected__ uintptr_t * __cdecl __ntapi_tt_aligned_block_memcpy( __in uintptr_t * dst, __in uintptr_t * src, @@ -21,6 +22,7 @@ uintptr_t * __cdecl __ntapi_tt_aligned_block_memcpy( } +__attr_protected__ void * __cdecl __ntapi_tt_generic_memcpy( __in void * dst, __in const void * src, diff --git a/src/string/ntapi_tt_aligned_block_memlock.c b/src/string/ntapi_tt_aligned_block_memlock.c index 5aa3a7e..17fb078 100644 --- a/src/string/ntapi_tt_aligned_block_memlock.c +++ b/src/string/ntapi_tt_aligned_block_memlock.c @@ -9,6 +9,7 @@ #include <ntapi/nt_sync.h> #include <ntapi/nt_atomic.h> +__attr_protected__ uintptr_t * __cdecl __ntapi_tt_aligned_block_memlock( __in uintptr_t * dst, __in size_t bytes) diff --git a/src/string/ntapi_tt_aligned_block_memset.c b/src/string/ntapi_tt_aligned_block_memset.c index 820bd61..2be00a7 100644 --- a/src/string/ntapi_tt_aligned_block_memset.c +++ b/src/string/ntapi_tt_aligned_block_memset.c @@ -5,6 +5,7 @@ /********************************************************/ #include <psxtypes/psxtypes.h> +#include "ntapi_impl.h" void * __cdecl __ntapi_tt_aligned_block_memset( __in void * block, diff --git a/src/string/ntapi_tt_aligned_memcpy_utf16.c b/src/string/ntapi_tt_aligned_memcpy_utf16.c index 474c8e4..60c02be 100644 --- a/src/string/ntapi_tt_aligned_memcpy_utf16.c +++ b/src/string/ntapi_tt_aligned_memcpy_utf16.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> +__attr_protected__ wchar16_t * __cdecl __ntapi_tt_aligned_memcpy_utf16( __in uintptr_t * dst, __in uintptr_t * src, diff --git a/src/string/ntapi_tt_dec_utf16_to_uintptr.c b/src/string/ntapi_tt_dec_utf16_to_uintptr.c index 93f0967..3e9b85d 100644 --- a/src/string/ntapi_tt_dec_utf16_to_uintptr.c +++ b/src/string/ntapi_tt_dec_utf16_to_uintptr.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_status.h> +#include "ntapi_impl.h" static int32_t __tt_dec_utf16_to_uint64( __in const wchar16_t * wch_arg, diff --git a/src/string/ntapi_tt_hex_utf16_to_uintptr.c b/src/string/ntapi_tt_hex_utf16_to_uintptr.c index 33478f3..a3fddb0 100644 --- a/src/string/ntapi_tt_hex_utf16_to_uintptr.c +++ b/src/string/ntapi_tt_hex_utf16_to_uintptr.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_status.h> +#include "ntapi_impl.h" int32_t __fastcall __ntapi_tt_hex_utf16_to_uint32( __in const wchar16_t hex_key_utf16[8], diff --git a/src/string/ntapi_tt_memcpy_utf16.c b/src/string/ntapi_tt_memcpy_utf16.c index 70829e6..1d4f7cf 100644 --- a/src/string/ntapi_tt_memcpy_utf16.c +++ b/src/string/ntapi_tt_memcpy_utf16.c @@ -7,6 +7,7 @@ #include <psxtypes/psxtypes.h> #include <pemagine/pemagine.h> +__attr_protected__ wchar16_t * __cdecl __ntapi_tt_memcpy_utf16( __in wchar16_t * dst, __in wchar16_t * src, diff --git a/src/string/ntapi_tt_strcmp_multibyte.c b/src/string/ntapi_tt_strcmp_multibyte.c index 7cedcf5..c7e4592 100644 --- a/src/string/ntapi_tt_strcmp_multibyte.c +++ b/src/string/ntapi_tt_strcmp_multibyte.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_string.h> +#include "ntapi_impl.h" int __cdecl __ntapi_tt_strcmp_multibyte( __in const char * a, diff --git a/src/string/ntapi_tt_strcmp_utf16.c b/src/string/ntapi_tt_strcmp_utf16.c index 7f13c73..6bac873 100644 --- a/src/string/ntapi_tt_strcmp_utf16.c +++ b/src/string/ntapi_tt_strcmp_utf16.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_string.h> +#include "ntapi_impl.h" int __cdecl __ntapi_tt_strcmp_utf16( __in const wchar16_t * a, diff --git a/src/string/ntapi_tt_strncmp_multibyte.c b/src/string/ntapi_tt_strncmp_multibyte.c index 90b85f6..df8b95e 100644 --- a/src/string/ntapi_tt_strncmp_multibyte.c +++ b/src/string/ntapi_tt_strncmp_multibyte.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_string.h> +#include "ntapi_impl.h" int __cdecl __ntapi_tt_strncmp_multibyte( __in const char * a, diff --git a/src/string/ntapi_tt_strncmp_utf16.c b/src/string/ntapi_tt_strncmp_utf16.c index aaa90ca..7fe1b23 100644 --- a/src/string/ntapi_tt_strncmp_utf16.c +++ b/src/string/ntapi_tt_strncmp_utf16.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_string.h> +#include "ntapi_impl.h" int __cdecl __ntapi_tt_strncmp_utf16( __in const wchar16_t * a, diff --git a/src/string/ntapi_tt_uintptr_to_dec.c b/src/string/ntapi_tt_uintptr_to_dec.c index c496247..a3252fc 100644 --- a/src/string/ntapi_tt_uintptr_to_dec.c +++ b/src/string/ntapi_tt_uintptr_to_dec.c @@ -6,6 +6,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_status.h> +#include "ntapi_impl.h" static void __tt_uintptr_to_mirrored_dec_utf8( uintptr_t key, diff --git a/src/string/ntapi_tt_uintptr_to_hex_utf16.c b/src/string/ntapi_tt_uintptr_to_hex_utf16.c index 0afe43d..85909b7 100644 --- a/src/string/ntapi_tt_uintptr_to_hex_utf16.c +++ b/src/string/ntapi_tt_uintptr_to_hex_utf16.c @@ -36,6 +36,7 @@ static void __fastcall __ntapi_tt_uint_to_hex_utf16( } +__attr_protected__ void __fastcall __ntapi_tt_uint16_to_hex_utf16( __in const uint32_t key, __out wchar16_t * formatted_key) @@ -47,6 +48,7 @@ void __fastcall __ntapi_tt_uint16_to_hex_utf16( } +__attr_protected__ void __fastcall __ntapi_tt_uint32_to_hex_utf16( __in const uint32_t key, __out wchar16_t * formatted_key) @@ -58,6 +60,7 @@ void __fastcall __ntapi_tt_uint32_to_hex_utf16( } +__attr_protected__ void __fastcall __ntapi_tt_uint64_to_hex_utf16( __in const uint64_t key, __out wchar16_t * formatted_key) @@ -69,6 +72,7 @@ void __fastcall __ntapi_tt_uint64_to_hex_utf16( } +__attr_protected__ void __fastcall __ntapi_tt_uintptr_to_hex_utf16( __in const uintptr_t key, __out wchar16_t * formatted_key) diff --git a/src/string/ntapi_tt_uintptr_to_hex_utf8.c b/src/string/ntapi_tt_uintptr_to_hex_utf8.c index 36e333e..007b34b 100644 --- a/src/string/ntapi_tt_uintptr_to_hex_utf8.c +++ b/src/string/ntapi_tt_uintptr_to_hex_utf8.c @@ -5,6 +5,7 @@ /********************************************************/ #include <psxtypes/psxtypes.h> +#include "ntapi_impl.h" static void __fastcall __ntapi_tt_uint_to_hex_utf8( __in const uint64_t key, diff --git a/src/unicode/ntapi_uc_unicode_validation.c b/src/unicode/ntapi_uc_unicode_validation.c index ff8dce8..7596c98 100644 --- a/src/unicode/ntapi_uc_unicode_validation.c +++ b/src/unicode/ntapi_uc_unicode_validation.c @@ -7,6 +7,7 @@ #include <psxtypes/psxtypes.h> #include <ntapi/nt_status.h> #include <ntapi/nt_unicode.h> +#include "ntapi_impl.h" /** * unofficial bit distribution table for comprehension purposes only |