Fix a few code analysis warnings
This commit is contained in:
parent
28477f0a80
commit
6eaafaf241
|
@ -54,7 +54,6 @@ namespace NtDll
|
|||
|
||||
#include "CxbxKrnl.h" // For CxbxKrnlCleanup
|
||||
#include "Emu.h" // For EmuWarning()
|
||||
#include "EmuFS.h"
|
||||
#include "EmuKrnl.h" // For InitializeListHead(), etc.
|
||||
#include "EmuFile.h" // For IsEmuHandle(), NtStatusToString()
|
||||
|
||||
|
@ -161,14 +160,14 @@ xboxkrnl::KPRCB *KeGetCurrentPrcb()
|
|||
#define KeRaiseIrql(NewIrql, OldIrql) \
|
||||
*OldIrql = KfRaiseIrql(NewIrql)
|
||||
|
||||
DWORD BootTickCount = 0;
|
||||
ULONGLONG BootTickCount = 0;
|
||||
|
||||
// The Xbox GetTickCount is measured in milliseconds, just like the native GetTickCount.
|
||||
// The only difference we'll take into account here, is that the Xbox will probably reboot
|
||||
// much more often than Windows, so we correct this with a 'BootTickCount' value :
|
||||
DWORD CxbxXboxGetTickCount()
|
||||
{
|
||||
return GetTickCount() - BootTickCount;
|
||||
return (DWORD)(GetTickCount64() - BootTickCount);
|
||||
}
|
||||
|
||||
DWORD __stdcall EmuThreadDpcHandler(LPVOID lpVoid)
|
||||
|
@ -302,7 +301,7 @@ void ConnectKeInterruptTimeToThunkTable(); // forward
|
|||
|
||||
void CxbxInitPerformanceCounters()
|
||||
{
|
||||
BootTickCount = GetTickCount();
|
||||
BootTickCount = GetTickCount64();
|
||||
|
||||
// Measure current host performance counter and frequency
|
||||
QueryPerformanceCounter(&NativePerformanceCounter);
|
||||
|
@ -430,7 +429,7 @@ XBSYSAPI EXPORTNUM(96) xboxkrnl::NTSTATUS NTAPI xboxkrnl::KeBugCheckEx
|
|||
"\nContinue Execution (Not Recommended)?\n",
|
||||
BugCheckCode, BugCheckParameter1, BugCheckParameter2, BugCheckParameter3, BugCheckParameter4);
|
||||
|
||||
HRESULT result = MessageBoxA(g_hEmuWindow, buffer, "KeBugCheck", MB_YESNO | MB_ICONWARNING);
|
||||
int result = MessageBoxA(g_hEmuWindow, buffer, "KeBugCheck", MB_YESNO | MB_ICONWARNING);
|
||||
|
||||
if (result == IDNO) {
|
||||
CxbxKrnlCleanup(NULL);
|
||||
|
|
|
@ -533,13 +533,13 @@ XBSYSAPI EXPORTNUM(181) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmQueryStatistics
|
|||
{
|
||||
LOG_FUNC_ONE_ARG_OUT(MemoryStatistics);
|
||||
|
||||
MEMORYSTATUS MemoryStatus;
|
||||
MEMORYSTATUSEX MemoryStatus;
|
||||
SYSTEM_INFO SysInfo;
|
||||
NTSTATUS ret;
|
||||
|
||||
if (MemoryStatistics->Length == sizeof(MM_STATISTICS))
|
||||
{
|
||||
GlobalMemoryStatus(&MemoryStatus);
|
||||
GlobalMemoryStatusEx(&MemoryStatus);
|
||||
GetSystemInfo(&SysInfo);
|
||||
|
||||
/**
|
||||
|
@ -547,12 +547,12 @@ XBSYSAPI EXPORTNUM(181) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmQueryStatistics
|
|||
* are setup correctly below, these two lines become redundant
|
||||
*/
|
||||
ZeroMemory(MemoryStatistics, sizeof(MM_STATISTICS));
|
||||
MemoryStatistics->Length = sizeof(MM_STATISTICS);
|
||||
//MemoryStatistics->Length = sizeof(MM_STATISTICS);
|
||||
|
||||
MemoryStatistics->TotalPhysicalPages = MemoryStatus.dwTotalPhys / SysInfo.dwPageSize;
|
||||
MemoryStatistics->AvailablePages = MemoryStatus.dwAvailPhys / SysInfo.dwPageSize;
|
||||
MemoryStatistics->VirtualMemoryBytesCommitted = MemoryStatus.dwTotalVirtual - MemoryStatus.dwAvailVirtual;
|
||||
MemoryStatistics->VirtualMemoryBytesReserved = MemoryStatus.dwAvailVirtual;
|
||||
MemoryStatistics->TotalPhysicalPages = (ULONG)(MemoryStatus.ullTotalPhys / SysInfo.dwPageSize);
|
||||
MemoryStatistics->AvailablePages = (ULONG)(MemoryStatus.ullAvailPhys / SysInfo.dwPageSize);
|
||||
MemoryStatistics->VirtualMemoryBytesCommitted = (ULONG)(MemoryStatus.ullTotalVirtual - MemoryStatus.ullAvailVirtual);
|
||||
MemoryStatistics->VirtualMemoryBytesReserved = (ULONG)(MemoryStatus.ullAvailVirtual);
|
||||
// MemoryStatistics->CachePagesCommitted = [ ];
|
||||
// MemoryStatistics->PoolPagesCommitted = [ ];
|
||||
// MemoryStatistics->StackPagesCommitted = [ ];
|
||||
|
|
Loading…
Reference in New Issue