- fix DbgPrint and implement DbgPrintEx

- stub for NtImpersonateAnonymousToken
This commit is contained in:
Raphael Junqueira 2004-04-07 19:05:34 +00:00 committed by Alexandre Julliard
parent 8c16d405e0
commit 43b9f97b22
3 changed files with 56 additions and 9 deletions

View File

@ -23,6 +23,7 @@
@ stub CsrpProcessCallbackRequest
@ stdcall DbgBreakPoint()
@ varargs DbgPrint(str)
@ varargs DbgPrintEx(long long str)
@ stub DbgPrompt
@ stub DbgSsHandleKmApiMsg
@ stub DbgSsInitialize
@ -123,6 +124,7 @@
@ stdcall NtGetContextThread(long ptr)
@ stub NtGetPlugPlayEvent
@ stub NtGetTickCount
@ stub NtImpersonateAnonymousToken
@ stub NtImpersonateClientOfPort
@ stub NtImpersonateThread
@ stub NtInitializeRegistry

View File

@ -294,17 +294,41 @@ void WINAPI RtlDumpResource(LPRTL_RWLOCK rwl)
/******************************************************************************
* DbgPrint [NTDLL.@]
*/
void WINAPIV DbgPrint(LPCSTR fmt, ...)
NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...)
{
char buf[512];
va_list args;
char buf[512];
va_list args;
va_start(args, fmt);
vsprintf(buf,fmt, args);
va_end(args);
va_start(args, fmt);
vsprintf(buf,fmt, args);
va_end(args);
MESSAGE("DbgPrint says: %s",buf);
/* hmm, raise exception? */
MESSAGE("DbgPrint says: %s",buf);
/* hmm, raise exception? */
return STATUS_SUCCESS;
}
/******************************************************************************
* DbgPrint [NTDLL.@]
*/
NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...)
{
char buf[1024];
va_list args;
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
switch (Level & DPFLTR_MASK) {
case DPFLTR_ERROR_LEVEL: ERR("%lx: %s", iComponentId, buf); break;
case DPFLTR_WARNING_LEVEL: WARN("%lx: %s", iComponentId, buf); break;
case DPFLTR_TRACE_LEVEL:
case DPFLTR_INFO_LEVEL:
default: TRACE("%lx: %s", iComponentId, buf); break;
}
return STATUS_SUCCESS;
}
/******************************************************************************

View File

@ -1011,6 +1011,15 @@ typedef struct _DEBUG_LOCK_INFORMATION {
ULONG NumberOfExclusiveWaiters;
} DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
typedef struct _PORT_MESSAGE_HEADER {
USHORT DataSize;
USHORT MessageSize;
USHORT MessageType;
USHORT VirtualRangesOffset;
CLIENT_ID ClientId;
ULONG MessageId;
ULONG SectionSize;
} PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
/***********************************************************************
* Defines
@ -1086,6 +1095,14 @@ typedef struct _DEBUG_LOCK_INFORMATION {
typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
/* DbgPrintEx default levels */
#define DPFLTR_ERROR_LEVEL 0
#define DPFLTR_WARNING_LEVEL 1
#define DPFLTR_TRACE_LEVEL 2
#define DPFLTR_INFO_LEVEL 3
#define DPFLTR_MASK 0x8000000
/***********************************************************************
* Function declarations
*/
@ -1100,7 +1117,8 @@ static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3")
void WINAPI DbgBreakPoint(void);
void WINAPI DbgUserBreakPoint(void);
#endif /* __i386__ && __GNUC__ */
void WINAPIV DbgPrint(LPCSTR fmt, ...);
NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
@ -1135,6 +1153,9 @@ NTSTATUS WINAPI NtFlushKey(HKEY);
NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);