summaryrefslogtreecommitdiffhomepage
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-06-06 22:43:59 +0000
committermidipix <writeonce@midipix.org>2018-06-06 21:49:35 -0400
commitcbd18a567736b5442275ba21ace1004f9777107a (patch)
treec6acb80194cd9153b7ad26760b09e64288da82ca /src/internal
parentb69287c10456cd47113d9a6b87e5fe246742e167 (diff)
downloadntapi-cbd18a567736b5442275ba21ace1004f9777107a.tar.bz2
ntapi-cbd18a567736b5442275ba21ace1004f9777107a.tar.xz
internals: removed __ntapi_log_write(), as it is no longer needed.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/ntapi_log.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/internal/ntapi_log.h b/src/internal/ntapi_log.h
deleted file mode 100644
index 59aa603..0000000
--- a/src/internal/ntapi_log.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/********************************************************/
-/* ntapi: Native API core library */
-/* Copyright (C) 2013--2017 Z. Gilboa */
-/* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */
-/********************************************************/
-
-#include <psxtypes/psxtypes.h>
-#include <ntapi/nt_file.h>
-#include <ntapi/ntapi.h>
-#include "ntapi_impl.h"
-
-static inline int __ntapi_uintptr_to_utf8(uintptr_t value,unsigned char * buf)
-{
- int i,len;
- uintptr_t val;
-
- if (!value) {
- *buf = '0';
- len = 1;
- } else {
- for (len=0,val=value; val; val=val/10,len++);
- for (i=len,buf+=len-1; i; i--,buf--,value=value/10)
- *buf = '0' + (value % 10);
- }
-
- return len;
-}
-
-static inline ssize_t __ntapi_log_write(void * msg,uint32_t size)
-{
- int32_t status;
- void * hlog;
- nt_iosb iosb;
- uintptr_t buffer[8] = {0};
- unsigned char * ch = (unsigned char *)buffer;
-
- if (!(hlog = __ntapi_internals()->rtdata->hlog))
- return NT_STATUS_INVALID_HANDLE;
-
- *ch++ = '@';
- ch += __ntapi_uintptr_to_utf8(
- pe_get_current_process_id(),
- ch);
- *ch++ = ':';
- ch += __ntapi_uintptr_to_utf8(
- pe_get_current_thread_id(),
- ch);
- *ch++ = '@';
- *ch++ = ' ';
-
- __ntapi->zw_write_file(
- hlog,
- 0,0,0,&iosb,
- buffer,
- (uint32_t)(ch-(unsigned char *)buffer),
- 0,0);
-
- status = __ntapi->zw_write_file(
- hlog,
- 0,0,0,&iosb,
- msg,
- (uint32_t)size,
- 0,0);
-
- return status ? -1 : iosb.info;
-}