From 70b6fcac5a43802a55caa0003e3ee39c2e2f0dc0 Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Sun, 19 Feb 2017 00:47:30 +0100 Subject: [PATCH 1/4] Kernel : Implemented PsQueryStatistics partially --- import/OpenXDK/include/xboxkrnl/ps.h | 8 +++++- import/OpenXDK/include/xboxkrnl/xboxkrnl.h | 31 +++++++++++++++++----- src/CxbxKrnl/EmuKrnlPs.cpp | 21 +++++++++++++++ src/CxbxKrnl/KernelThunk.cpp | 2 +- 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/import/OpenXDK/include/xboxkrnl/ps.h b/import/OpenXDK/include/xboxkrnl/ps.h index 88af645f2..74eb99631 100644 --- a/import/OpenXDK/include/xboxkrnl/ps.h +++ b/import/OpenXDK/include/xboxkrnl/ps.h @@ -41,7 +41,13 @@ XBSYSAPI EXPORTNUM(255) NTSTATUS NTAPI PsCreateSystemThreadEx IN PKSYSTEM_ROUTINE SystemRoutine OPTIONAL ); -XBSYSAPI VOID *PsQueryStatistics; +// ****************************************************************** +// * 0x0100 - PsQueryStatistics() +// ****************************************************************** +XBSYSAPI EXPORTNUM(256) NTSTATUS NTAPI PsQueryStatistics +( + IN OUT PPS_STATISTICS ProcessStatistics +); // ****************************************************************** // * PsSetCreateThreadNotifyRoutine diff --git a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h index 76943792a..16da65482 100644 --- a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h +++ b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h @@ -1273,10 +1273,12 @@ KEVENT, *PKEVENT, *PRKEVENT; // even with undefined RESTRICTED_POINTER, this doe // ****************************************************************** // EVENT_BASIC_INFORMATION - same as Windows // ****************************************************************** -typedef struct _EVENT_BASIC_INFORMATION { +typedef struct _EVENT_BASIC_INFORMATION +{ EVENT_TYPE EventType; LONG EventState; -} EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION; +} +EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION; // ****************************************************************** // KSEMAPHORE @@ -1291,19 +1293,23 @@ KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE; // ****************************************************************** // SEMAPHORE_BASIC_INFORMATION - same as Windows // ****************************************************************** -typedef struct _SEMAPHORE_BASIC_INFORMATION { +typedef struct _SEMAPHORE_BASIC_INFORMATION +{ LONG CurrentCount; LONG MaximumCount; -} SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION; +} +SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION; // ****************************************************************** // MUTANT_BASIC_INFORMATION - same as Windows // ****************************************************************** -typedef struct _MUTANT_BASIC_INFORMATION { +typedef struct _MUTANT_BASIC_INFORMATION +{ LONG CurrentCount; BOOLEAN OwnedByCaller; BOOLEAN AbandonedState; -} MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION; +} +MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION; // ****************************************************************** // ERWLOCK @@ -1535,7 +1541,7 @@ typedef enum _KOBJECTS KOBJECTS, *PKOBJECTS; // ****************************************************************** -// * KINTERRUPR +// * KINTERRUPT // ****************************************************************** typedef struct _KINTERRUPT { @@ -1583,6 +1589,17 @@ typedef enum _KINTERRUPT_MODE } KINTERRUPT_MODE; +// ****************************************************************** +// * PS_STATISTICS +// ****************************************************************** +typedef struct _PS_STATISTICS +{ + ULONG Length; + ULONG ThreadCount; + ULONG HandleCount; +} +PS_STATISTICS, *PPS_STATISTICS; + // ****************************************************************** // * RTL_CRITICAL_SECTION // ****************************************************************** diff --git a/src/CxbxKrnl/EmuKrnlPs.cpp b/src/CxbxKrnl/EmuKrnlPs.cpp index d34834a7c..ae79a4c09 100644 --- a/src/CxbxKrnl/EmuKrnlPs.cpp +++ b/src/CxbxKrnl/EmuKrnlPs.cpp @@ -326,6 +326,27 @@ XBSYSAPI EXPORTNUM(255) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PsCreateSystemThreadE RETURN(STATUS_SUCCESS); } +// ****************************************************************** +// * 0x0100 - PsQueryStatistics() +// ****************************************************************** +XBSYSAPI EXPORTNUM(256) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PsQueryStatistics +( + IN OUT PPS_STATISTICS ProcessStatistics +) +{ + NTSTATUS ret = STATUS_SUCCESS; + + if (ProcessStatistics->Length == sizeof(PS_STATISTICS)) { + LOG_INCOMPLETE(); // TODO : Return number of threads and handles that currently exist + ProcessStatistics->ThreadCount = 1; + ProcessStatistics->HandleCount = 1; + } else { + ret = STATUS_INVALID_PARAMETER; + } + + RETURN(ret); +} + // ****************************************************************** // * 0x0101 - PsSetCreateThreadNotifyRoutine() // ****************************************************************** diff --git a/src/CxbxKrnl/KernelThunk.cpp b/src/CxbxKrnl/KernelThunk.cpp index 26754590a..f5b60a578 100644 --- a/src/CxbxKrnl/KernelThunk.cpp +++ b/src/CxbxKrnl/KernelThunk.cpp @@ -323,7 +323,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[379] = (uint32)FUNC(&xboxkrnl::PhyInitialize), // 0x00FD (253) (uint32)FUNC(&xboxkrnl::PsCreateSystemThread), // 0x00FE (254) (uint32)FUNC(&xboxkrnl::PsCreateSystemThreadEx), // 0x00FF (255) - (uint32)PANIC(0x0100), // 0x0100 (256) PsQueryStatistics + (uint32)FUNC(&xboxkrnl::PsQueryStatistics), // 0x0100 (256) (uint32)FUNC(&xboxkrnl::PsSetCreateThreadNotifyRoutine), // 0x0101 (257) (uint32)FUNC(&xboxkrnl::PsTerminateSystemThread), // 0x0102 (258) (uint32)VARIABLE(&xboxkrnl::PsThreadObjectType), // 0x0103 (259) From 0b03a4495980d9af7b3f47927255951421b97407 Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Sun, 19 Feb 2017 01:03:41 +0100 Subject: [PATCH 2/4] Kernel : Stubbed KeRestoreFloatingPointState and KeSaveFloatingPointState --- import/OpenXDK/include/xboxkrnl/kernel.h | 18 ++++++++++-- import/OpenXDK/include/xboxkrnl/xboxkrnl.h | 18 ++++++++++++ src/CxbxKrnl/EmuKrnlKe.cpp | 34 ++++++++++++++++++++++ src/CxbxKrnl/KernelThunk.cpp | 4 +-- 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/import/OpenXDK/include/xboxkrnl/kernel.h b/import/OpenXDK/include/xboxkrnl/kernel.h index c101b5b78..b7e19b7e6 100644 --- a/import/OpenXDK/include/xboxkrnl/kernel.h +++ b/import/OpenXDK/include/xboxkrnl/kernel.h @@ -269,10 +269,24 @@ XBSYSAPI EXPORTNUM(138) LONG NTAPI KeResetEvent IN PRKEVENT Event ); -XBSYSAPI VOID *KeRestoreFloatingPointState; +// ****************************************************************** +// * 0x008B - KeRestoreFloatingPointState() +// ****************************************************************** +XBSYSAPI EXPORTNUM(139) NTSTATUS NTAPI KeRestoreFloatingPointState +( + IN PKFLOATING_SAVE PublicFloatSave +); + XBSYSAPI VOID *KeResumeThread; XBSYSAPI VOID *KeRundownQueue; -XBSYSAPI VOID *KeSaveFloatingPointState; + +// ****************************************************************** +// * 0x008E - KeSaveFloatingPointState() +// ****************************************************************** +XBSYSAPI EXPORTNUM(142) NTSTATUS NTAPI KeSaveFloatingPointState +( + OUT PKFLOATING_SAVE PublicFloatSave +); // ****************************************************************** // * 0x008F - KeSetBasePriorityThread() diff --git a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h index 16da65482..5bff355f7 100644 --- a/import/OpenXDK/include/xboxkrnl/xboxkrnl.h +++ b/import/OpenXDK/include/xboxkrnl/xboxkrnl.h @@ -1527,6 +1527,24 @@ typedef struct _KDPC } KDPC, *PKDPC; +// ****************************************************************** +// * KFLOATING_SAVE +// ****************************************************************** +// See NtDll::FLOATING_SAVE_AREA +typedef struct _KFLOATING_SAVE +{ + ULONG ControlWord; + ULONG StatusWord; + // NtDll contains ULONG TagWord here + ULONG ErrorOffset; + ULONG ErrorSelector; + ULONG DataOffset; + ULONG DataSelector; + ULONG Cr0NpxState; // NtDll has RegisterArea[SIZE_OF_80387_REGISTERS]; + ULONG Spare1; // NtDll calls this Spare0 +} +KFLOATING_SAVE, *PKFLOATING_SAVE; + // ****************************************************************** // * KOBJECTS // ****************************************************************** diff --git a/src/CxbxKrnl/EmuKrnlKe.cpp b/src/CxbxKrnl/EmuKrnlKe.cpp index 1d873e295..6d040a00f 100644 --- a/src/CxbxKrnl/EmuKrnlKe.cpp +++ b/src/CxbxKrnl/EmuKrnlKe.cpp @@ -960,6 +960,40 @@ XBSYSAPI EXPORTNUM(138) xboxkrnl::LONG NTAPI xboxkrnl::KeResetEvent return ret; } +// ****************************************************************** +// * 0x008B - KeRestoreFloatingPointState() +// ****************************************************************** +XBSYSAPI EXPORTNUM(139) xboxkrnl::NTSTATUS NTAPI xboxkrnl::KeRestoreFloatingPointState +( + IN PKFLOATING_SAVE PublicFloatSave +) +{ + LOG_FUNC_ONE_ARG(PublicFloatSave); + + NTSTATUS ret = STATUS_SUCCESS; + + LOG_UNIMPLEMENTED(); + + RETURN(ret); +} + +// ****************************************************************** +// * 0x008E - KeSaveFloatingPointState() +// ****************************************************************** +XBSYSAPI EXPORTNUM(142) xboxkrnl::NTSTATUS NTAPI xboxkrnl::KeSaveFloatingPointState +( + OUT PKFLOATING_SAVE PublicFloatSave +) +{ + LOG_FUNC_ONE_ARG_OUT(PublicFloatSave); + + NTSTATUS ret = STATUS_SUCCESS; + + LOG_UNIMPLEMENTED(); + + RETURN(ret); +} + // ****************************************************************** // * 0x008F - KeSetBasePriorityThread() // ****************************************************************** diff --git a/src/CxbxKrnl/KernelThunk.cpp b/src/CxbxKrnl/KernelThunk.cpp index f5b60a578..ae642e929 100644 --- a/src/CxbxKrnl/KernelThunk.cpp +++ b/src/CxbxKrnl/KernelThunk.cpp @@ -206,10 +206,10 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[379] = (uint32)PANIC(0x0088), // 0x0088 (136) KeRemoveQueue (uint32)FUNC(&xboxkrnl::KeRemoveQueueDpc), // 0x0089 (137) (uint32)FUNC(&xboxkrnl::KeResetEvent), // 0x008A (138) - (uint32)PANIC(0x008B), // 0x008B (139) KeRestoreFloatingPointState + (uint32)FUNC(&xboxkrnl::KeRestoreFloatingPointState), // 0x008B (139) (uint32)PANIC(0x008C), // 0x008C (140) KeResumeThread (uint32)PANIC(0x008D), // 0x008D (141) KeRundownQueue - (uint32)PANIC(0x008E), // 0x008E (142) KeSaveFloatingPointState + (uint32)FUNC(&xboxkrnl::KeSaveFloatingPointState), // 0x008E (142) (uint32)FUNC(&xboxkrnl::KeSetBasePriorityThread), // 0x008F (143) (uint32)PANIC(0x0090), // 0x0090 (144) KeSetDisableBoostThread (uint32)FUNC(&xboxkrnl::KeSetEvent), // 0x0091 (145) From 2cbc7a7086c9fe5f7aeffea6abf4f3b7e1c3f3c0 Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Sun, 19 Feb 2017 01:22:54 +0100 Subject: [PATCH 3/4] Kernel : Stubbed KeResumeThread and KeSuspendThread --- import/OpenXDK/include/xboxkrnl/kernel.h | 18 ++++++++++-- src/CxbxKrnl/EmuKrnlKe.cpp | 36 +++++++++++++++++++++++- src/CxbxKrnl/KernelThunk.cpp | 4 +-- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/import/OpenXDK/include/xboxkrnl/kernel.h b/import/OpenXDK/include/xboxkrnl/kernel.h index b7e19b7e6..5b19b8b9f 100644 --- a/import/OpenXDK/include/xboxkrnl/kernel.h +++ b/import/OpenXDK/include/xboxkrnl/kernel.h @@ -277,7 +277,14 @@ XBSYSAPI EXPORTNUM(139) NTSTATUS NTAPI KeRestoreFloatingPointState IN PKFLOATING_SAVE PublicFloatSave ); -XBSYSAPI VOID *KeResumeThread; +// ****************************************************************** +// * 0x008C - KeResumeThread() +// ****************************************************************** +XBSYSAPI EXPORTNUM(140) ULONG NTAPI KeResumeThread +( + IN PKTHREAD Thread +); + XBSYSAPI VOID *KeRundownQueue; // ****************************************************************** @@ -350,7 +357,14 @@ XBSYSAPI EXPORTNUM(151) VOID NTAPI KeStallExecutionProcessor IN ULONG MicroSeconds ); -XBSYSAPI VOID *KeSuspendThread; +// ****************************************************************** +// * 0x0098 - KeSuspendThread() +// ****************************************************************** +XBSYSAPI EXPORTNUM(152) ULONG NTAPI KeSuspendThread +( + IN PKTHREAD Thread +); + XBSYSAPI VOID *KeSynchronizeExecution; XBSYSAPI VOID *KeSystemTime; XBSYSAPI VOID *KeTestAlertThread; diff --git a/src/CxbxKrnl/EmuKrnlKe.cpp b/src/CxbxKrnl/EmuKrnlKe.cpp index 6d040a00f..d3e061293 100644 --- a/src/CxbxKrnl/EmuKrnlKe.cpp +++ b/src/CxbxKrnl/EmuKrnlKe.cpp @@ -788,7 +788,7 @@ XBSYSAPI EXPORTNUM(122) xboxkrnl::VOID NTAPI xboxkrnl::KeLeaveCriticalRegion // ****************************************************************** XBSYSAPI EXPORTNUM(125) xboxkrnl::ULONGLONG NTAPI xboxkrnl::KeQueryInterruptTime(void) { - // TODO : Some software might call this often and fill the log quickly, + // TODO : Some software might call KeQueryInterruptTime often and fill the log quickly, // in which case we should not LOG_FUNC nor RETURN (use normal return instead). LOG_FUNC(); @@ -977,6 +977,23 @@ XBSYSAPI EXPORTNUM(139) xboxkrnl::NTSTATUS NTAPI xboxkrnl::KeRestoreFloatingPoin RETURN(ret); } +// ****************************************************************** +// * 0x008C - KeResumeThread() +// ****************************************************************** +XBSYSAPI EXPORTNUM(140) xboxkrnl::ULONG NTAPI xboxkrnl::KeResumeThread +( + IN PKTHREAD Thread +) +{ + LOG_FUNC_ONE_ARG(Thread); + + NTSTATUS ret = STATUS_SUCCESS; + + LOG_UNIMPLEMENTED(); + + RETURN(ret); +} + // ****************************************************************** // * 0x008E - KeSaveFloatingPointState() // ****************************************************************** @@ -1165,6 +1182,23 @@ XBSYSAPI EXPORTNUM(151) xboxkrnl::VOID NTAPI xboxkrnl::KeStallExecutionProcessor std::this_thread::sleep_for(std::chrono::microseconds(MicroSeconds)); } +// ****************************************************************** +// * 0x0098 - KeSuspendThread() +// ****************************************************************** +XBSYSAPI EXPORTNUM(152) xboxkrnl::ULONG NTAPI xboxkrnl::KeSuspendThread +( + IN PKTHREAD Thread +) +{ + LOG_FUNC_ONE_ARG(Thread); + + NTSTATUS ret = STATUS_SUCCESS; + + LOG_UNIMPLEMENTED(); + + RETURN(ret); +} + // ****************************************************************** // * 0x009A - KeSystemTime // ****************************************************************** diff --git a/src/CxbxKrnl/KernelThunk.cpp b/src/CxbxKrnl/KernelThunk.cpp index ae642e929..02b09059c 100644 --- a/src/CxbxKrnl/KernelThunk.cpp +++ b/src/CxbxKrnl/KernelThunk.cpp @@ -207,7 +207,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[379] = (uint32)FUNC(&xboxkrnl::KeRemoveQueueDpc), // 0x0089 (137) (uint32)FUNC(&xboxkrnl::KeResetEvent), // 0x008A (138) (uint32)FUNC(&xboxkrnl::KeRestoreFloatingPointState), // 0x008B (139) - (uint32)PANIC(0x008C), // 0x008C (140) KeResumeThread + (uint32)FUNC(&xboxkrnl::KeResumeThread), // 0x008C (140) (uint32)PANIC(0x008D), // 0x008D (141) KeRundownQueue (uint32)FUNC(&xboxkrnl::KeSaveFloatingPointState), // 0x008E (142) (uint32)FUNC(&xboxkrnl::KeSetBasePriorityThread), // 0x008F (143) @@ -219,7 +219,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[379] = (uint32)FUNC(&xboxkrnl::KeSetTimer), // 0x0095 (149) (uint32)FUNC(&xboxkrnl::KeSetTimerEx), // 0x0096 (150) (uint32)FUNC(&xboxkrnl::KeStallExecutionProcessor), // 0x0097 (151) - (uint32)PANIC(0x0098), // 0x0098 (152) KeSuspendThread + (uint32)FUNC(&xboxkrnl::KeSuspendThread), // 0x0098 (152) (uint32)PANIC(0x0099), // 0x0099 (153) KeSynchronizeExecution (uint32)VARIABLE(0x009A), // 0x009A (154) KeSystemTime (Set by ConnectWindowsTimersToThunkTable) (uint32)PANIC(0x009B), // 0x009B (155) KeTestAlertThread From a82b0f72d694ac6b24c51afd31cc8785a3602aca Mon Sep 17 00:00:00 2001 From: PatrickvL Date: Sun, 19 Feb 2017 01:24:11 +0100 Subject: [PATCH 4/4] Kernel : Updated a few comments, changing 'this' into a concrete symbol --- src/CxbxKrnl/EmuKrnl.cpp | 2 +- src/CxbxKrnl/EmuKrnlEx.cpp | 3 ++- src/CxbxKrnl/EmuKrnlHal.cpp | 2 +- src/CxbxKrnl/EmuKrnlMm.cpp | 6 ++++-- src/CxbxKrnl/EmuKrnlNt.cpp | 6 +++++- src/CxbxKrnl/EmuKrnlOb.cpp | 2 +- src/CxbxKrnl/EmuKrnlPs.cpp | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/CxbxKrnl/EmuKrnl.cpp b/src/CxbxKrnl/EmuKrnl.cpp index ae4415f47..208f29462 100644 --- a/src/CxbxKrnl/EmuKrnl.cpp +++ b/src/CxbxKrnl/EmuKrnl.cpp @@ -378,7 +378,7 @@ XBSYSAPI EXPORTNUM(253) xboxkrnl::NTSTATUS NTAPI xboxkrnl::PhyInitialize // ****************************************************************** // * 0x0165 - IdexChannelObject // ****************************************************************** -// TODO : Determine size, structure & filling behind this +// TODO : Determine size, structure & filling behind IdexChannelObject XBSYSAPI EXPORTNUM(357) xboxkrnl::BYTE xboxkrnl::IdexChannelObject[0x100] = { }; // ****************************************************************** diff --git a/src/CxbxKrnl/EmuKrnlEx.cpp b/src/CxbxKrnl/EmuKrnlEx.cpp index a19f0152d..5e1dde65a 100644 --- a/src/CxbxKrnl/EmuKrnlEx.cpp +++ b/src/CxbxKrnl/EmuKrnlEx.cpp @@ -125,8 +125,9 @@ XBSYSAPI EXPORTNUM(15) xboxkrnl::PVOID NTAPI xboxkrnl::ExAllocatePoolWithTag LOG_FUNC_ARG(Tag) LOG_FUNC_END; - // TODO: Actually implement this PVOID pRet = CxbxCalloc(1, NumberOfBytes); // Clear, to prevent side-effects on random contents + + LOG_INCOMPLETE(); // TODO : Actually implement ExAllocatePoolWithTag RETURN(pRet); } diff --git a/src/CxbxKrnl/EmuKrnlHal.cpp b/src/CxbxKrnl/EmuKrnlHal.cpp index 43727a34a..e1b3e2888 100644 --- a/src/CxbxKrnl/EmuKrnlHal.cpp +++ b/src/CxbxKrnl/EmuKrnlHal.cpp @@ -576,7 +576,7 @@ XBSYSAPI EXPORTNUM(360) xboxkrnl::NTSTATUS NTAPI xboxkrnl::HalInitiateShutdown // * 0x016D - HalEnableSecureTrayEject() // ****************************************************************** // Notifies the SMBUS that ejecting the DVD-ROM should not reset the system. -// Note that this function can't really be called directly... +// Note that HalEnableSecureTrayEject can't really be called directly... // // New to the XBOX. // Source:XBMC Undocumented.h diff --git a/src/CxbxKrnl/EmuKrnlMm.cpp b/src/CxbxKrnl/EmuKrnlMm.cpp index 87a6581d1..704931a19 100644 --- a/src/CxbxKrnl/EmuKrnlMm.cpp +++ b/src/CxbxKrnl/EmuKrnlMm.cpp @@ -478,7 +478,8 @@ XBSYSAPI EXPORTNUM(179) xboxkrnl::ULONG NTAPI xboxkrnl::MmQueryAddressProtect if (EmuCheckAllocationSize(VirtualAddress, false)) Result = PAGE_READWRITE; - // TODO : Improve this implementation + LOG_INCOMPLETE(); // TODO : Improve the MmQueryAddressProtect implementation + RETURN(Result); } @@ -492,7 +493,8 @@ XBSYSAPI EXPORTNUM(180) xboxkrnl::ULONG NTAPI xboxkrnl::MmQueryAllocationSize { LOG_FUNC_ONE_ARG(BaseAddress); - // TODO : Free PAGE_WRITECOMBINE differently + LOG_INCOMPLETE(); // TODO : Free PAGE_WRITECOMBINE differently + ULONG uiSize = EmuCheckAllocationSize(BaseAddress, false); RETURN(uiSize); diff --git a/src/CxbxKrnl/EmuKrnlNt.cpp b/src/CxbxKrnl/EmuKrnlNt.cpp index 5d20b5797..b43c10df9 100644 --- a/src/CxbxKrnl/EmuKrnlNt.cpp +++ b/src/CxbxKrnl/EmuKrnlNt.cpp @@ -298,7 +298,7 @@ XBSYSAPI EXPORTNUM(190) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtCreateFile { LOG_FORWARD("IoCreateFile"); - // TODO : How to base this on ObCreateObject, KeInitialize and ObInsertObject ? + // TODO : How to base IoCreateFile on ObCreateObject, KeInitialize and ObInsertObject ? return xboxkrnl::IoCreateFile( FileHandle, @@ -1466,6 +1466,8 @@ XBSYSAPI EXPORTNUM(224) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtResumeThread ThreadHandle, PreviousSuspendCount); + // TODO : Once we do our own thread-switching, implement NtResumeThread using KetResumeThread + Sleep(10); RETURN(ret); @@ -1631,6 +1633,8 @@ XBSYSAPI EXPORTNUM(231) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtSuspendThread ThreadHandle, PreviousSuspendCount); + // TODO : Once we do our own thread-switching, implement NtSuspendThread using KeSuspendThread + RETURN(ret); } diff --git a/src/CxbxKrnl/EmuKrnlOb.cpp b/src/CxbxKrnl/EmuKrnlOb.cpp index f671400a0..340bcdb64 100644 --- a/src/CxbxKrnl/EmuKrnlOb.cpp +++ b/src/CxbxKrnl/EmuKrnlOb.cpp @@ -120,7 +120,7 @@ XBSYSAPI EXPORTNUM(239) xboxkrnl::NTSTATUS NTAPI xboxkrnl::ObCreateObject // TODO : For other Ob* API's it must become possible to get from // and Object(Header) address to the Name. Right now, this requires // adding ObjectSize to ObjectHeader. This won't be available outside - // this function, so we need a better solution for this. + // ObCreateObject, so we need a better solution for this. // It might be possible to put the OBJECT_STRING struct BEFORE the // ObjectHeader (and the NameBuffer itself before that), which would // make it possible to simply offset everything off an Object. diff --git a/src/CxbxKrnl/EmuKrnlPs.cpp b/src/CxbxKrnl/EmuKrnlPs.cpp index ae79a4c09..02cf7c125 100644 --- a/src/CxbxKrnl/EmuKrnlPs.cpp +++ b/src/CxbxKrnl/EmuKrnlPs.cpp @@ -95,7 +95,7 @@ void LOG_PCSTProxy // PsCreateSystemThread proxy procedure #pragma warning(push) #pragma warning(disable: 4731) // disable ebp modification warning -// Dxbx Note : The signature of this function should conform to System.TThreadFunc ! +// Dxbx Note : The signature of PCSTProxy should conform to System.TThreadFunc ! static unsigned int WINAPI PCSTProxy ( IN PVOID Parameter