summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-14 01:10:09 +0000
committermidipix <writeonce@midipix.org>2016-12-15 01:47:35 -0500
commit3e609ebeae297011c8f70719ba2f68f2a9798d54 (patch)
treef8b9238c25de839ea270b81d42880e89d1f95c3e /src
parent95d67cc70c652076dbe261d195a27ddfbc6bbb3a (diff)
downloadntapi-3e609ebeae297011c8f70719ba2f68f2a9798d54.tar.bz2
ntapi-3e609ebeae297011c8f70719ba2f68f2a9798d54.tar.xz
code maintenance: provide smooth foreign toolchain support.
Diffstat (limited to 'src')
-rw-r--r--src/fs/ntapi_tt_statfs.c2
-rw-r--r--src/guid/ntapi_tt_guid.c8
-rw-r--r--src/ipc/ntapi_tt_create_pipe_v1.c3
-rw-r--r--src/process/ntapi_tt_spawn_native_process.c2
-rw-r--r--src/socket/ntapi_sc_send.c2
-rw-r--r--src/thread/ntapi_tt_create_thread.c4
6 files changed, 11 insertions, 10 deletions
diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c
index 44450df..b386c8b 100644
--- a/src/fs/ntapi_tt_statfs.c
+++ b/src/fs/ntapi_tt_statfs.c
@@ -102,7 +102,7 @@ int32_t __stdcall __ntapi_tt_statfs(
default:
/* pretend there is no limitation */
- statfs->f_files = (-1);
+ statfs->f_files = (uint64_t)(-1);
break;
}
diff --git a/src/guid/ntapi_tt_guid.c b/src/guid/ntapi_tt_guid.c
index 6172214..3542aa3 100644
--- a/src/guid/ntapi_tt_guid.c
+++ b/src/guid/ntapi_tt_guid.c
@@ -145,7 +145,7 @@ int32_t __fastcall __ntapi_tt_utf16_string_to_guid(
if (status != NT_STATUS_SUCCESS)
return status;
- guid->data4[0] = key / 0x100;
+ guid->data4[0] = key >> 8;
guid->data4[1] = key % 0x100;
status = __ntapi_tt_hex_utf16_to_uint16(
@@ -155,7 +155,7 @@ int32_t __fastcall __ntapi_tt_utf16_string_to_guid(
if (status != NT_STATUS_SUCCESS)
return status;
- guid->data4[2] = key / 0x100;
+ guid->data4[2] = key >> 8;
guid->data4[3] = key % 0x100;
status = __ntapi_tt_hex_utf16_to_uint16(
@@ -165,7 +165,7 @@ int32_t __fastcall __ntapi_tt_utf16_string_to_guid(
if (status != NT_STATUS_SUCCESS)
return status;
- guid->data4[4] = key / 0x100;
+ guid->data4[4] = key >> 8;
guid->data4[5] = key % 0x100;
status = __ntapi_tt_hex_utf16_to_uint16(
@@ -175,7 +175,7 @@ int32_t __fastcall __ntapi_tt_utf16_string_to_guid(
if (status != NT_STATUS_SUCCESS)
return status;
- guid->data4[6] = key / 0x100;
+ guid->data4[6] = key >> 8;
guid->data4[7] = key % 0x100;
return NT_STATUS_SUCCESS;
diff --git a/src/ipc/ntapi_tt_create_pipe_v1.c b/src/ipc/ntapi_tt_create_pipe_v1.c
index 98a23fa..00cc443 100644
--- a/src/ipc/ntapi_tt_create_pipe_v1.c
+++ b/src/ipc/ntapi_tt_create_pipe_v1.c
@@ -27,6 +27,7 @@ typedef struct __attr_ptr_size_aligned__ _nt_tty_pipe_name {
wchar16_t uscore_5th;
wchar16_t key_6th[8];
wchar16_t null_termination;
+ void * pad;
} nt_tty_pipe_name;
@@ -56,7 +57,7 @@ int32_t __stdcall __ntapi_ipc_create_pipe_v1(
{0},'_',
{0},'_',
{0},
- 0
+ 0,0
};
(void)advisory_buffer_size;
diff --git a/src/process/ntapi_tt_spawn_native_process.c b/src/process/ntapi_tt_spawn_native_process.c
index db308d6..c741cf8 100644
--- a/src/process/ntapi_tt_spawn_native_process.c
+++ b/src/process/ntapi_tt_spawn_native_process.c
@@ -259,7 +259,7 @@ int32_t __stdcall __ntapi_tt_spawn_native_process(nt_spawn_process_params * spar
session.pid = rtctx->alt_cid_self.pid;
session.pgid = rtctx->alt_cid_self.pgid;
session.sid = rtctx->alt_cid_self.sid;
- session.syspid = cparams.pbi.unique_process_id;
+ session.syspid = (uint32_t)cparams.pbi.unique_process_id;
if ((status = __ntapi->tty_client_session_set(
sparams->hsession,
diff --git a/src/socket/ntapi_sc_send.c b/src/socket/ntapi_sc_send.c
index 6810bb6..181d818 100644
--- a/src/socket/ntapi_sc_send.c
+++ b/src/socket/ntapi_sc_send.c
@@ -53,7 +53,7 @@ int32_t __cdecl __ntapi_sc_send(
0,sizeof(afd_send));
afd_send.pmeta = &afd_send.extlen;
- afd_send.addrlen = addrlen;
+ afd_send.addrlen = (uint32_t)addrlen;
afd_send.addr = addr;
}
diff --git a/src/thread/ntapi_tt_create_thread.c b/src/thread/ntapi_tt_create_thread.c
index a76fec9..50a7d2f 100644
--- a/src/thread/ntapi_tt_create_thread.c
+++ b/src/thread/ntapi_tt_create_thread.c
@@ -48,8 +48,8 @@ int32_t __stdcall __ntapi_tt_create_thread(
void * stack_system_limit;
uint32_t protect_type_old;
- nt_thread_context context __attr_aligned__(0x40);
- nt_user_stack stack __attr_aligned__(0x10);
+ nt_thread_context __attr_aligned__(0x40) context;
+ nt_user_stack __attr_aligned__(0x10) stack;
uintptr_t fsuspended;
uintptr_t * parg;
size_t size;