From 1219beec442e63d47eb5bfb3b3bd7a7818b657c7 Mon Sep 17 00:00:00 2001 From: midipix Date: May 14 2016 11:18:25 +0000 Subject: code maintenance: properly initialize struct entities. --- diff --git a/src/internal/ntapi.c b/src/internal/ntapi.c index d201eeb..885fe61 100644 --- a/src/internal/ntapi.c +++ b/src/internal/ntapi.c @@ -67,8 +67,8 @@ static __ntapi_init_fn * __ntapi_init_vtbl[3] = { __ntapi_init_completed}; /* accessor */ -ntapi_vtbl ___ntapi = {0}; -ntapi_vtbl ___ntapi_shadow = {0}; +ntapi_vtbl ___ntapi; +ntapi_vtbl ___ntapi_shadow; /* .bss */ static __ntapi_img_sec_bss __ntapi_img_bss; @@ -77,8 +77,12 @@ static __ntapi_img_sec_bss __ntapi_img_bss; static union __ntapi_img_rdata __ntapi_rdata = {{ {__NTAPI_HASH_TABLE}, /* __ntapi_import_table */ 0, /* __ntapi */ - {{0}}, /* __session_name */ - 0}}; /* __internals */ + { /* __session_name */ + {0},0,{0}, + {0,{0},0}, + {{0},0,{0},0,{0},0,{0},0,{0},0,{0}}, + 0}, + 0}}; #define internals __ntapi_rdata.img_sec_data.__internals #define import_table __ntapi_rdata.img_sec_data.__ntapi_import_table diff --git a/src/object/ntapi_tt_keyed_object_directory.c b/src/object/ntapi_tt_keyed_object_directory.c index 9520607..311e051 100644 --- a/src/object/ntapi_tt_keyed_object_directory.c +++ b/src/object/ntapi_tt_keyed_object_directory.c @@ -12,7 +12,11 @@ typedef ntapi_zw_open_directory_object objdir_open_fn; -static nt_keyed_objdir_name __template_name = {__NT_BASED_NAMED_OBJECTS}; +static nt_keyed_objdir_name __template_name = {__NT_BASED_NAMED_OBJECTS, + 0, + {0,0,0,0,0,0}, + {0,{0},0}, + {0}}; static int32_t __stdcall __tt_create_keyed_object_directory( __out void ** hdir, diff --git a/src/process/ntapi_tt_init_runtime_data.c b/src/process/ntapi_tt_init_runtime_data.c index 836b609..211f6f3 100644 --- a/src/process/ntapi_tt_init_runtime_data.c +++ b/src/process/ntapi_tt_init_runtime_data.c @@ -15,7 +15,7 @@ int32_t __stdcall __ntapi_tt_update_runtime_data(nt_runtime_data * rtdata) int32_t status; nt_process_basic_information pbi; uint32_t ret; - nt_oa oa = {sizeof(oa)}; + nt_oa oa = {sizeof(oa),0,0,0,0,0}; /* process (self) */ rtdata->cid_self.process_id = pe_get_current_process_id(); @@ -48,7 +48,7 @@ int32_t __stdcall __ntapi_tt_init_runtime_data(nt_runtime_data * rtdata) { int32_t status; nt_peb * peb; - nt_oa oa = {sizeof(oa)}; + nt_oa oa = {sizeof(oa),0,0,0,0,0}; /* init */ __ntapi->tt_aligned_block_memset(rtdata,0,sizeof(*rtdata)); diff --git a/src/socket/ntapi_sc_socket_v2.c b/src/socket/ntapi_sc_socket_v2.c index 366b9c9..0f114fe 100644 --- a/src/socket/ntapi_sc_socket_v2.c +++ b/src/socket/ntapi_sc_socket_v2.c @@ -58,7 +58,7 @@ int32_t __cdecl __ntapi_sc_socket_v2( 0x0f, 0x20, {'A','f','d','O','p','e','n','P','a','c','k','e','t','X','X',0}, - {0}, + {0,0,0,0,0}, {0}}; ea_length = sizeof(afd_ea);