Merge branch 'master' of github.com:LukeUsher/Cxbx-Reloaded
This commit is contained in:
commit
58b3a424d5
|
@ -61,13 +61,63 @@ constexpr const char* file_name(const char* str) {
|
|||
#include <iostream> // For std::cout
|
||||
#include <iomanip> // For std::setw
|
||||
|
||||
// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration
|
||||
extern thread_local const DWORD _CurrentThreadId;
|
||||
//
|
||||
// Hex output (type safe)
|
||||
//
|
||||
// http://stackoverflow.com/questions/673240/how-do-i-print-an-unsigned-char-as-hex-in-c-using-ostream
|
||||
//
|
||||
|
||||
// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html
|
||||
extern thread_local std::string _logPrefix;
|
||||
struct Hex1Struct
|
||||
{
|
||||
uint8_t v;
|
||||
Hex1Struct(uint8_t _v) : v(_v) { }
|
||||
};
|
||||
|
||||
inline Hex1Struct hex1(uint8_t _v)
|
||||
{
|
||||
return Hex1Struct(_v);
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const Hex1Struct& hs)
|
||||
{
|
||||
return os << "0x" << std::hex << std::uppercase << (int)hs.v;
|
||||
}
|
||||
|
||||
struct Hex2Struct
|
||||
{
|
||||
uint16_t v;
|
||||
Hex2Struct(uint16_t _v) : v(_v) { }
|
||||
};
|
||||
|
||||
inline Hex2Struct hex2(uint16_t _v)
|
||||
{
|
||||
return Hex2Struct(_v);
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const Hex2Struct& hs)
|
||||
{
|
||||
return os << "0x" << std::hex << std::uppercase << (int)hs.v;
|
||||
}
|
||||
|
||||
struct Hex4Struct
|
||||
{
|
||||
uint32_t v;
|
||||
Hex4Struct(uint32_t _v) : v(_v) { }
|
||||
};
|
||||
|
||||
inline Hex4Struct hex4(uint32_t _v)
|
||||
{
|
||||
return Hex4Struct(_v);
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const Hex4Struct& hs)
|
||||
{
|
||||
return os << "0x" << std::hex << std::uppercase << (int)hs.v;
|
||||
}
|
||||
|
||||
//
|
||||
// Data sanitization functions
|
||||
//
|
||||
|
||||
// Default sanitization functions simply returns the given argument
|
||||
template<class T>
|
||||
|
@ -81,12 +131,24 @@ inline const wchar_t * _log_sanitize(const wchar_t *arg) { return (NULL == arg)
|
|||
inline const char * _log_sanitize(BOOL value) { return value ? "TRUE" : "FALSE"; }
|
||||
inline const char * _log_sanitize(BOOLEAN value) { return value ? "TRUE" : "FALSE"; }
|
||||
|
||||
//
|
||||
// Logging defines
|
||||
//
|
||||
|
||||
// For thread_local, see : http://en.cppreference.com/w/cpp/language/storage_duration
|
||||
extern thread_local const DWORD _CurrentThreadId;
|
||||
|
||||
// TODO : Use Boost.Format http://www.boost.org/doc/libs/1_53_0/libs/format/index.html
|
||||
extern thread_local std::string _logPrefix;
|
||||
|
||||
|
||||
#ifdef _DEBUG_TRACE
|
||||
#define LOG_FUNC_BEGIN \
|
||||
do { if(g_bPrintfOn) { \
|
||||
bool _had_arg = false; \
|
||||
if (_logPrefix.empty()) { \
|
||||
std::stringstream tmp; \
|
||||
tmp << __FILENAME__ << " (0x" << std::hex << std::uppercase << _CurrentThreadId << "): "; \
|
||||
tmp << __FILENAME__ << " (" << hex2((uint16_t)_CurrentThreadId) << "): "; \
|
||||
_logPrefix = tmp.str(); \
|
||||
}; \
|
||||
std::stringstream msg; \
|
||||
|
@ -94,15 +156,17 @@ inline const char * _log_sanitize(BOOLEAN value) { return value ? "TRUE" : "FALS
|
|||
|
||||
// LOG_FUNC_ARG_OUT writes output via all available ostream << operator overloads, adding detail where possible
|
||||
#define LOG_FUNC_ARG(arg) \
|
||||
msg << "\n " << std::setw(26) << std::left << std::setfill(' ') << #arg" : " << _log_sanitize(arg);
|
||||
_had_arg = true; \
|
||||
msg << "\n " << std::setw(25) << std::left << std::setfill(' ') << #arg << " : " << _log_sanitize(arg);
|
||||
|
||||
// LOG_FUNC_ARG_OUT prevents expansion of types, by only rendering as a pointer
|
||||
#define LOG_FUNC_ARG_OUT(arg) \
|
||||
msg << "\n " << std::setw(26) << std::left << std::setfill(' ') << #arg << " : 0x" << (void*)arg;
|
||||
_had_arg = true; \
|
||||
msg << "\n OUT " << std::setw(23) << std::left << std::setfill(' ') << #arg << " : " << hex4((uint32_t)arg);
|
||||
|
||||
// LOG_FUNC_END closes off function and optional argument logging
|
||||
#define LOG_FUNC_END \
|
||||
msg.seekg(-1, std::ios::end); if (msg.get() != '(') msg << '\n'; \
|
||||
if (_had_arg) msg << '\n'; \
|
||||
msg << ");\n"; \
|
||||
std::cout << msg.str(); \
|
||||
} } while (0)
|
||||
|
@ -113,7 +177,6 @@ inline const char * _log_sanitize(BOOLEAN value) { return value ? "TRUE" : "FALS
|
|||
#else
|
||||
#define LOG_FUNC_BEGIN
|
||||
#define LOG_FUNC_ARG(arg)
|
||||
#define LOG_FUNC_ARG_STR(arg)
|
||||
#define LOG_FUNC_ARG_OUT(arg)
|
||||
#define LOG_FUNC_END
|
||||
#define LOG_FUNC_RESULT(r)
|
||||
|
|
|
@ -55,117 +55,244 @@ namespace xboxkrnl
|
|||
|
||||
std::ostream& operator<<(std::ostream& os, const PULONG& value)
|
||||
{
|
||||
os << "0x" << (void*)value;
|
||||
os << hex4((uint32_t)value);
|
||||
if (value)
|
||||
os << " (*value: " << (void*)*value << ")";
|
||||
os << " (*value: " << hex4(*value) << ")";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
#define RENDER_MEMBER(Member) << " ."#Member":" << value.Member
|
||||
// Macro's for Xbox Enum-ToString conversions :
|
||||
#define ENUM2STR_START(EnumType) const char * EnumType##ToString(const xboxkrnl::EnumType value) { switch (value) {
|
||||
#define ENUM2STR_CASE(a) case xboxkrnl::a: return #a;
|
||||
#define ENUM2STR_END(EnumType) default: return "Unknown_"#EnumType; } }
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::LARGE_INTEGER& value)
|
||||
// Xbox Enum-ToString conversions :
|
||||
|
||||
ENUM2STR_START(BUS_DATA_TYPE)
|
||||
ENUM2STR_CASE(ConfigurationSpaceUndefined)
|
||||
ENUM2STR_CASE(Cmos)
|
||||
ENUM2STR_CASE(EisaConfiguration)
|
||||
ENUM2STR_CASE(Pos)
|
||||
ENUM2STR_CASE(CbusConfiguration)
|
||||
ENUM2STR_CASE(PCIConfiguration)
|
||||
ENUM2STR_CASE(VMEConfiguration)
|
||||
ENUM2STR_CASE(NuBusConfiguration)
|
||||
ENUM2STR_CASE(PCMCIAConfiguration)
|
||||
ENUM2STR_CASE(MPIConfiguration)
|
||||
ENUM2STR_CASE(MPSAConfiguration)
|
||||
ENUM2STR_CASE(PNPISAConfiguration)
|
||||
ENUM2STR_CASE(SgiInternalConfiguration)
|
||||
ENUM2STR_CASE(MaximumBusDataType)
|
||||
ENUM2STR_END(BUS_DATA_TYPE)
|
||||
|
||||
ENUM2STR_START(EEPROM_INDEX)
|
||||
ENUM2STR_CASE(EEPROM_LANGUAGE)
|
||||
ENUM2STR_CASE(EEPROM_VIDEO)
|
||||
ENUM2STR_CASE(EEPROM_AUDIO)
|
||||
ENUM2STR_CASE(EEPROM_P_CONTROL_GAMES)
|
||||
ENUM2STR_CASE(EEPROM_P_CONTROL_PASSWORD)
|
||||
ENUM2STR_CASE(EEPROM_P_CONTROL_MOVIES)
|
||||
ENUM2STR_CASE(EEPROM_ONLINE_IP_ADDRESS)
|
||||
ENUM2STR_CASE(EEPROM_ONLINE_DNS_ADDRESS)
|
||||
ENUM2STR_CASE(EEPROM_ONLINE_DEFAULT_GATEWAY_ADDRESS)
|
||||
ENUM2STR_CASE(EEPROM_ONLINE_SUBNET_ADDRESS)
|
||||
ENUM2STR_CASE(EEPROM_MISC)
|
||||
ENUM2STR_CASE(EEPROM_DVD_REGION)
|
||||
ENUM2STR_CASE(EEPROM_MAX_OS)
|
||||
ENUM2STR_CASE(EEPROM_FACTORY_SERIAL_NUMBER)
|
||||
ENUM2STR_CASE(EEPROM_FACTORY_ETHERNET_ADDR)
|
||||
ENUM2STR_CASE(EEPROM_FACTORY_ONLINE_KEY)
|
||||
ENUM2STR_CASE(EEPROM_FACTORY_AV_REGION)
|
||||
ENUM2STR_CASE(EEPROM_FACTORY_GAME_REGION)
|
||||
ENUM2STR_CASE(EEPROM_MAX_FACTORY)
|
||||
ENUM2STR_CASE(EEPROM_ENCRYPTED_SECTION)
|
||||
ENUM2STR_CASE(EEPROM_MAX_ALL)
|
||||
ENUM2STR_END(EEPROM_INDEX)
|
||||
|
||||
ENUM2STR_START(EVENT_TYPE)
|
||||
ENUM2STR_CASE(NotificationEvent)
|
||||
ENUM2STR_CASE(SynchronizationEvent)
|
||||
ENUM2STR_END(EVENT_TYPE)
|
||||
|
||||
ENUM2STR_START(FILE_INFORMATION_CLASS)
|
||||
ENUM2STR_CASE(FileDirectoryInformation)
|
||||
ENUM2STR_CASE(FileFullDirectoryInformation)
|
||||
ENUM2STR_CASE(FileBothDirectoryInformation)
|
||||
ENUM2STR_CASE(FileBasicInformation)
|
||||
ENUM2STR_CASE(FileStandardInformation)
|
||||
ENUM2STR_CASE(FileInternalInformation)
|
||||
ENUM2STR_CASE(FileEaInformation)
|
||||
ENUM2STR_CASE(FileAccessInformation)
|
||||
ENUM2STR_CASE(FileNameInformation)
|
||||
ENUM2STR_CASE(FileRenameInformation)
|
||||
ENUM2STR_CASE(FileLinkInformation)
|
||||
ENUM2STR_CASE(FileNamesInformation)
|
||||
ENUM2STR_CASE(FileDispositionInformation)
|
||||
ENUM2STR_CASE(FilePositionInformation)
|
||||
ENUM2STR_CASE(FileFullEaInformation)
|
||||
ENUM2STR_CASE(FileModeInformation)
|
||||
ENUM2STR_CASE(FileAlignmentInformation)
|
||||
ENUM2STR_CASE(FileAllInformation)
|
||||
ENUM2STR_CASE(FileAllocationInformation)
|
||||
ENUM2STR_CASE(FileEndOfFileInformation)
|
||||
ENUM2STR_CASE(FileAlternateNameInformation)
|
||||
ENUM2STR_CASE(FileStreamInformation)
|
||||
ENUM2STR_CASE(FilePipeInformation)
|
||||
ENUM2STR_CASE(FilePipeLocalInformation)
|
||||
ENUM2STR_CASE(FilePipeRemoteInformation)
|
||||
ENUM2STR_CASE(FileMailslotQueryInformation)
|
||||
ENUM2STR_CASE(FileMailslotSetInformation)
|
||||
ENUM2STR_CASE(FileCompressionInformation)
|
||||
ENUM2STR_CASE(FileCopyOnWriteInformation)
|
||||
ENUM2STR_CASE(FileCompletionInformation)
|
||||
ENUM2STR_CASE(FileMoveClusterInformation)
|
||||
ENUM2STR_CASE(FileQuotaInformation)
|
||||
ENUM2STR_CASE(FileReparsePointInformation)
|
||||
ENUM2STR_CASE(FileNetworkOpenInformation)
|
||||
ENUM2STR_CASE(FileObjectIdInformation)
|
||||
ENUM2STR_CASE(FileTrackingInformation)
|
||||
ENUM2STR_CASE(FileOleDirectoryInformation)
|
||||
ENUM2STR_CASE(FileContentIndexInformation)
|
||||
ENUM2STR_CASE(FileInheritContentIndexInformation)
|
||||
ENUM2STR_CASE(FileOleInformation)
|
||||
ENUM2STR_CASE(FileMaximumInformation)
|
||||
ENUM2STR_END(FILE_INFORMATION_CLASS)
|
||||
|
||||
ENUM2STR_START(FS_INFORMATION_CLASS)
|
||||
ENUM2STR_CASE(FileFsVolumeInformation)
|
||||
ENUM2STR_CASE(FileFsLabelInformation)
|
||||
ENUM2STR_CASE(FileFsSizeInformation)
|
||||
ENUM2STR_CASE(FileFsDeviceInformation)
|
||||
ENUM2STR_CASE(FileFsAttributeInformation)
|
||||
ENUM2STR_CASE(FileFsControlInformation)
|
||||
ENUM2STR_CASE(FileFsFullSizeInformation)
|
||||
ENUM2STR_CASE(FileFsObjectIdInformation)
|
||||
ENUM2STR_CASE(FileFsMaximumInformation)
|
||||
ENUM2STR_END(FS_INFORMATION_CLASS)
|
||||
|
||||
ENUM2STR_START(KINTERRUPT_MODE)
|
||||
ENUM2STR_CASE(LevelSensitive)
|
||||
ENUM2STR_CASE(Latched)
|
||||
ENUM2STR_END(KINTERRUPT_MODE)
|
||||
|
||||
ENUM2STR_START(KOBJECTS)
|
||||
ENUM2STR_CASE(DpcObject)
|
||||
ENUM2STR_END(KOBJECTS)
|
||||
|
||||
ENUM2STR_START(MODE)
|
||||
ENUM2STR_CASE(KernelMode)
|
||||
ENUM2STR_CASE(UserMode)
|
||||
ENUM2STR_CASE(MaximumMode)
|
||||
ENUM2STR_END(MODE)
|
||||
|
||||
ENUM2STR_START(RETURN_FIRMWARE)
|
||||
ENUM2STR_CASE(ReturnFirmwareHalt)
|
||||
ENUM2STR_CASE(ReturnFirmwareReboot)
|
||||
ENUM2STR_CASE(ReturnFirmwareQuickReboot)
|
||||
ENUM2STR_CASE(ReturnFirmwareHard)
|
||||
ENUM2STR_CASE(ReturnFirmwareFatal)
|
||||
ENUM2STR_CASE(ReturnFirmwareAll)
|
||||
ENUM2STR_END(RETURN_FIRMWARE)
|
||||
|
||||
ENUM2STR_START(TIMER_TYPE)
|
||||
ENUM2STR_CASE(NotificationTimer)
|
||||
ENUM2STR_CASE(SynchronizationTimer)
|
||||
ENUM2STR_END(TIMER_TYPE)
|
||||
|
||||
ENUM2STR_START(WAIT_TYPE)
|
||||
ENUM2STR_CASE(WaitAll)
|
||||
ENUM2STR_CASE(WaitAny)
|
||||
ENUM2STR_END(WAIT_TYPE)
|
||||
|
||||
// Macro for implementation of rendering EnumToString :
|
||||
#define LOGRENDER_ENUM(EnumType) LOGRENDER_HEADER(EnumType) \
|
||||
{ return os << "("#EnumType") " << EnumType##ToString(value) << " = " << hex4((int)value); }
|
||||
|
||||
// Xbox enum renderers :
|
||||
LOGRENDER_ENUM(BUS_DATA_TYPE)
|
||||
LOGRENDER_ENUM(EEPROM_INDEX)
|
||||
LOGRENDER_ENUM(EVENT_TYPE)
|
||||
LOGRENDER_ENUM(FILE_INFORMATION_CLASS)
|
||||
LOGRENDER_ENUM(FS_INFORMATION_CLASS)
|
||||
LOGRENDER_ENUM(KINTERRUPT_MODE)
|
||||
LOGRENDER_ENUM(KOBJECTS)
|
||||
LOGRENDER_ENUM(MODE)
|
||||
LOGRENDER_ENUM(RETURN_FIRMWARE)
|
||||
LOGRENDER_ENUM(TIMER_TYPE)
|
||||
LOGRENDER_ENUM(WAIT_TYPE)
|
||||
|
||||
#undef ENUM_START
|
||||
#undef ENUM_CASE
|
||||
#undef ENUM_END
|
||||
#undef RENDER_ENUM
|
||||
|
||||
#define LOGRENDER_MEMBER(Member) << "\n ."#Member": " << value.Member
|
||||
|
||||
LOGRENDER_HEADER(BOOLEAN)
|
||||
{
|
||||
return os << (BOOL)value;
|
||||
}
|
||||
|
||||
// Macro combining pointer-to-type implementation and type rendering header :
|
||||
#define LOGRENDER_TYPE(Type) \
|
||||
LOGRENDER_HEADER(P##Type) \
|
||||
{ \
|
||||
os << "0x" << (void*)value; \
|
||||
if (value) \
|
||||
os << " -> P"#Type" {" << *value << "}"; \
|
||||
\
|
||||
return os; \
|
||||
} \
|
||||
\
|
||||
LOGRENDER_HEADER(Type) \
|
||||
|
||||
// Render Xbox types :
|
||||
LOGRENDER_TYPE(LARGE_INTEGER)
|
||||
{
|
||||
return os
|
||||
RENDER_MEMBER(QuadPart);
|
||||
LOGRENDER_MEMBER(QuadPart);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::MM_STATISTICS& value)
|
||||
LOGRENDER_TYPE(MM_STATISTICS)
|
||||
{
|
||||
return os
|
||||
RENDER_MEMBER(Length)
|
||||
RENDER_MEMBER(TotalPhysicalPages)
|
||||
RENDER_MEMBER(AvailablePages)
|
||||
RENDER_MEMBER(VirtualMemoryBytesCommitted)
|
||||
RENDER_MEMBER(VirtualMemoryBytesCommitted)
|
||||
RENDER_MEMBER(VirtualMemoryBytesReserved)
|
||||
RENDER_MEMBER(CachePagesCommitted)
|
||||
RENDER_MEMBER(PoolPagesCommitted)
|
||||
RENDER_MEMBER(StackPagesCommitted)
|
||||
RENDER_MEMBER(ImagePagesCommitted);
|
||||
LOGRENDER_MEMBER(Length)
|
||||
LOGRENDER_MEMBER(TotalPhysicalPages)
|
||||
LOGRENDER_MEMBER(AvailablePages)
|
||||
LOGRENDER_MEMBER(VirtualMemoryBytesCommitted)
|
||||
LOGRENDER_MEMBER(VirtualMemoryBytesCommitted)
|
||||
LOGRENDER_MEMBER(VirtualMemoryBytesReserved)
|
||||
LOGRENDER_MEMBER(CachePagesCommitted)
|
||||
LOGRENDER_MEMBER(PoolPagesCommitted)
|
||||
LOGRENDER_MEMBER(StackPagesCommitted)
|
||||
LOGRENDER_MEMBER(ImagePagesCommitted);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::OBJECT_ATTRIBUTES& value)
|
||||
LOGRENDER_TYPE(OBJECT_ATTRIBUTES)
|
||||
{
|
||||
return os
|
||||
RENDER_MEMBER(RootDirectory)
|
||||
RENDER_MEMBER(ObjectName)
|
||||
RENDER_MEMBER(Attributes);
|
||||
LOGRENDER_MEMBER(RootDirectory)
|
||||
LOGRENDER_MEMBER(ObjectName)
|
||||
LOGRENDER_MEMBER(Attributes);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::STRING& value)
|
||||
LOGRENDER_TYPE(STRING)
|
||||
{
|
||||
return os
|
||||
RENDER_MEMBER(Length)
|
||||
RENDER_MEMBER(MaximumLength)
|
||||
RENDER_MEMBER(Buffer);
|
||||
LOGRENDER_MEMBER(Length)
|
||||
LOGRENDER_MEMBER(MaximumLength)
|
||||
LOGRENDER_MEMBER(Buffer);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::UNICODE_STRING& value)
|
||||
LOGRENDER_TYPE(UNICODE_STRING)
|
||||
{
|
||||
return os
|
||||
RENDER_MEMBER(Length)
|
||||
RENDER_MEMBER(MaximumLength)
|
||||
RENDER_MEMBER(Buffer);
|
||||
LOGRENDER_MEMBER(Length)
|
||||
LOGRENDER_MEMBER(MaximumLength)
|
||||
LOGRENDER_MEMBER(Buffer);
|
||||
}
|
||||
|
||||
#undef RENDER_MEMBER
|
||||
|
||||
// Pointers to all of the above :
|
||||
|
||||
#define RENDER_POINTER(TYPE) \
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::P##TYPE& value) \
|
||||
{ \
|
||||
os << "0x" << (void*)value; \
|
||||
if (value) \
|
||||
os << " (->"#TYPE":\n" << *value << ")"; \
|
||||
\
|
||||
return os; \
|
||||
}
|
||||
|
||||
RENDER_POINTER(LARGE_INTEGER)
|
||||
RENDER_POINTER(MM_STATISTICS)
|
||||
RENDER_POINTER(OBJECT_ATTRIBUTES)
|
||||
RENDER_POINTER(STRING)
|
||||
RENDER_POINTER(UNICODE_STRING)
|
||||
|
||||
#undef RENDER_POINTER
|
||||
|
||||
/*
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PLARGE_INTEGER& value)
|
||||
{
|
||||
os << "0x" << (void*)value;
|
||||
if (value)
|
||||
os << " (->LARGE_INTEGER:\n" << *value << ")";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PMM_STATISTICS& value)
|
||||
{
|
||||
os << "0x" << (void*)value;
|
||||
if (value)
|
||||
os << " (->MM_STATISTICS:\n" << *value << ")";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::POBJECT_ATTRIBUTES& value)
|
||||
{
|
||||
os << "0x" << (void*)value;
|
||||
if (value)
|
||||
os << " (->OBJECT_ATTRIBUTES:\n" << *value << ")";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PSTRING& value)
|
||||
{
|
||||
os << "0x" << (void*)value;
|
||||
if (value)
|
||||
os << " (->STRING:\n" << *value << ")";
|
||||
|
||||
|
||||
return os;
|
||||
}
|
||||
*/
|
||||
#undef LOGRENDER_MEMBER
|
||||
#undef LOGRENDER_TYPE
|
||||
#undef LOGRENDER_HEADER
|
||||
|
|
|
@ -45,37 +45,27 @@ namespace xboxkrnl
|
|||
|
||||
#include <windows.h> // for PULONG
|
||||
#include <sstream> // for std::ostream
|
||||
//#include <iostream> // For std::cout
|
||||
//#include <iomanip> // For std::setw
|
||||
|
||||
//?#include "Cxbx.h"
|
||||
//#include "Logging.h"
|
||||
//?#include "Logging.h"
|
||||
|
||||
// TODO : Implement renderers for each usage of these types (and/or (P/LP) pointers to them)...
|
||||
//
|
||||
// TODO : xboxkrnl::ANSI_STRING
|
||||
// TODO : xboxkrnl::BUS_DATA_TYPE
|
||||
// TODO : xboxkrnl::DEVICE_OBJECT
|
||||
// TODO : xboxkrnl::DISPATCHER_HEADER
|
||||
// TODO : xboxkrnl::DVDX2_AUTHENTICATION
|
||||
// TODO : xboxkrnl::DVDX2_AUTHENTICATION_PAGE
|
||||
// TODO : xboxkrnl::EEPROM_INDEX
|
||||
// TODO : xboxkrnl::ERWLOCK
|
||||
// TODO : xboxkrnl::ETHREAD
|
||||
// TODO : xboxkrnl::EVENT_TYPE
|
||||
// TODO : xboxkrnl::EXCEPTION_RECORD
|
||||
// TODO : xboxkrnl::FILE_DIRECTORY_INFORMATION
|
||||
// TODO : xboxkrnl::FILE_FS_SIZE_INFORMATION
|
||||
// TODO : xboxkrnl::FILE_INFORMATION_CLASS
|
||||
// TODO : xboxkrnl::FILETIME
|
||||
// TODO : xboxkrnl::FS_INFORMATION_CLASS
|
||||
// TODO : xboxkrnl::IO_STATUS_BLOCK / xboxkrnl::PIO_STATUS_BLOCK ->u1.Pointer, ->Information
|
||||
// TODO : xboxkrnl::KDEVICE_QUEUE
|
||||
// TODO : xboxkrnl::KDPC
|
||||
// TODO : xboxkrnl::KEVENT
|
||||
// TODO : xboxkrnl::KINTERRUPT
|
||||
// TODO : xboxkrnl::KINTERRUPT_MODE
|
||||
// TODO : xboxkrnl::KIRQL
|
||||
// TODO : xboxkrnl::KOBJECTS
|
||||
// TODO : xboxkrnl::KPCR
|
||||
// TODO : xboxkrnl::KPRCB
|
||||
// TODO : xboxkrnl::KPROCESSOR_MODE
|
||||
|
@ -92,7 +82,6 @@ namespace xboxkrnl
|
|||
// TODO : xboxkrnl::LPCWSTR
|
||||
// TODO : xboxkrnl::MEMORY_BASIC_INFORMATION
|
||||
// TODO : xboxkrnl::MM_STATISTICS
|
||||
// TODO : xboxkrnl::MODE
|
||||
// TODO : xboxkrnl::MODE_PARAMETER_HEADER10
|
||||
// TODO : xboxkrnl::NT_TIB
|
||||
// TODO : xboxkrnl::NTSTATUS
|
||||
|
@ -111,32 +100,50 @@ namespace xboxkrnl
|
|||
// TODO : xboxkrnl::PXINPUT_STATE
|
||||
// TODO : xboxkrnl::PXPP_DEVICE_TYPE
|
||||
// TODO : xboxkrnl::PXTHREAD_NOTIFICATION -> pfnNotifyRoutine
|
||||
// TODO : xboxkrnl::RETURN_FIRMWARE
|
||||
// TODO : xboxkrnl::RTL_CRITICAL_SECTION
|
||||
// TODO : xboxkrnl::SCSI_PASS_THROUGH_DIRECT
|
||||
// TODO : xboxkrnl::SINGLE_LIST_ENTRY
|
||||
// TODO : xboxkrnl::SLIST_HEADER
|
||||
// TODO : xboxkrnl::STRING
|
||||
// TODO : xboxkrnl::TIMER_TYPE
|
||||
// TODO : xboxkrnl::TIME_FIELDS
|
||||
// TODO : xboxkrnl::UCHAR
|
||||
// TODO : xboxkrnl::ULARGE_INTEGER
|
||||
// TODO : xboxkrnl::WAIT_TYPE
|
||||
// TODO : xboxkrnl::XBOX_HARDWARE_INFO
|
||||
// TODO : xboxkrnl::XBOX_REFURB_INFO
|
||||
|
||||
// Headers for rendering non-Xbox types :
|
||||
std::ostream& operator<<(std::ostream& os, const PULONG& value);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::LARGE_INTEGER& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::MM_STATISTICS& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::OBJECT_ATTRIBUTES& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::STRING& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::UNICODE_STRING& value);
|
||||
// Macro to ease declaration of a render function per Xbox Type:
|
||||
#define LOGRENDER_HEADER(Type) std::ostream& operator<<(std::ostream& os, const xboxkrnl::Type& value)
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PLARGE_INTEGER& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PMM_STATISTICS& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::POBJECT_ATTRIBUTES& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PSTRING& value);
|
||||
std::ostream& operator<<(std::ostream& os, const xboxkrnl::PUNICODE_STRING& value);
|
||||
// Headers for rendering Xbox enum types :
|
||||
LOGRENDER_HEADER(BUS_DATA_TYPE);
|
||||
LOGRENDER_HEADER(EEPROM_INDEX);
|
||||
LOGRENDER_HEADER(EVENT_TYPE);
|
||||
LOGRENDER_HEADER(FILE_INFORMATION_CLASS);
|
||||
LOGRENDER_HEADER(FS_INFORMATION_CLASS);
|
||||
LOGRENDER_HEADER(KINTERRUPT_MODE);
|
||||
LOGRENDER_HEADER(KOBJECTS);
|
||||
LOGRENDER_HEADER(MODE);
|
||||
LOGRENDER_HEADER(RETURN_FIRMWARE);
|
||||
LOGRENDER_HEADER(TIMER_TYPE);
|
||||
LOGRENDER_HEADER(WAIT_TYPE);
|
||||
|
||||
// Headers for rendering Xbox types without pointer-to-type :
|
||||
LOGRENDER_HEADER(BOOLEAN);
|
||||
|
||||
// Macro to ease declaration of two render functions, for Xbox type and pointer-to-type :
|
||||
#define LOGRENDER_HEADERS(Type) LOGRENDER_HEADER(Type); LOGRENDER_HEADER(P##Type)
|
||||
|
||||
// Headers for rendering functions of Xbox type and pointer-to-type :
|
||||
LOGRENDER_HEADERS(LARGE_INTEGER);
|
||||
LOGRENDER_HEADERS(MM_STATISTICS);
|
||||
LOGRENDER_HEADERS(OBJECT_ATTRIBUTES);
|
||||
LOGRENDER_HEADERS(STRING);
|
||||
LOGRENDER_HEADERS(UNICODE_STRING);
|
||||
|
||||
#undef LOGRENDER_HEADERS
|
||||
// Don't #undef LOGRENDER_HEADER, because it's used in EmuKrnlLogging.cpp
|
||||
|
||||
#endif _EMU_KERNEL_LOGGING_H
|
||||
|
|
|
@ -939,6 +939,8 @@ XBSYSAPI EXPORTNUM(218) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtQueryVolumeInformat
|
|||
SizeInfo->SectorsPerAllocationUnit = 32;
|
||||
SizeInfo->BytesPerSector = 512;
|
||||
}
|
||||
else
|
||||
LOG_UNIMPLEMENTED();
|
||||
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue