Use xboxkrnl namespace inside xboxkrnl header file

This commit is contained in:
ergo720 2020-08-18 17:01:08 +02:00
parent 2695d91496
commit f46bcd6875
51 changed files with 72 additions and 241 deletions

View File

@ -12,6 +12,9 @@
#ifndef XBOXKRNL_H
#define XBOXKRNL_H
namespace xboxkrnl
{
// ******************************************************************
// * dll import/export
// ******************************************************************
@ -2707,6 +2710,8 @@ typedef struct _IDE_CHANNEL_OBJECT
// ******************************************************************
#include "xbox.h"
};
#endif

View File

@ -27,12 +27,8 @@
#define LOG_PREFIX CXBXR_MODULE::EEPR
#define LOG_PREFIX_INIT CXBXR_MODULE::INIT
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For XC_VALUE_INDEX and XBOX_EEPROM
};
#include <xboxkrnl/xboxkrnl.h> // For XC_VALUE_INDEX and XBOX_EEPROM
#include <stdio.h> // For printf
#include <shlobj.h> // For HANDLE, CreateFile, CreateFileMapping, MapViewOfFile
#include <random>

View File

@ -27,13 +27,10 @@
#ifndef EMU_EEPROM_H
#define EMU_EEPROM_H
// prevent name collisions
namespace xboxkrnl
{
#undef _WIN32 // Compile-in REG_DWORD and friends, since we lack a <windows> include here
#include <xboxkrnl/xboxkrnl.h> // For XC_VALUE_INDEX and XBOX_EEPROM
#define _WIN32
};
#define EEPROM_SIZE sizeof(xboxkrnl::XBOX_EEPROM)

View File

@ -35,12 +35,8 @@
#define _XBOXKRNL_DEFEXTRN_
#define LOG_PREFIX CXBXR_MODULE::INPSYS
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
#include "SdlJoystick.h"
#include "XInputPad.h"
#include "DInputKeyboardMouse.h"

View File

@ -26,12 +26,8 @@
// *
// ******************************************************************
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "common\xbe\Xbe.h"
#include "common\util\CxbxUtil.h" // For RoundUp
#include <filesystem> // filesystem related functions available on C++ 17

View File

@ -1,12 +1,12 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// prevent name collisions
#include <xboxkrnl/xboxkrnl.h> //#include <stdtypes.h>
#include "buffered_io.h"
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> //#include <stdtypes.h>
#include "buffered_io.h"
PBYTE GetSectorBuffered(
PCDIO_READ This,

View File

@ -7,6 +7,9 @@
extern "C" {
#endif
namespace xboxkrnl
{
#define BOOL BOOLEAN
#define LPSTR LPCH
@ -44,8 +47,10 @@ extern void ReleaseBufferedSector(
PCDIO_READ This,
DWORD SectorNumber);
};
#ifdef __cplusplus
}
#endif
#endif // __BUFFERED_IO_H__
#endif // __BUFFERED_IO_H__

View File

@ -5,7 +5,9 @@
#include <xboxkrnl/xboxkrnl.h> //#include <stdtypes.h>
#include "buffered_io.h"
#include "buffered_io.h"
using namespace xboxkrnl;
CONST CHAR *XDVDFS_Signature = "MICROSOFT*XBOX*MEDIA";

View File

@ -35,12 +35,8 @@
#include <condition_variable>
#include <stack>
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl\xboxkrnl.h>
};
#include <xboxkrnl\xboxkrnl.h>
#include "common\util\CxbxUtil.h"
#include "CxbxVersion.h"
#include "core\kernel\init\CxbxKrnl.h"

View File

@ -26,11 +26,8 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DSSTREAM
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp"

View File

@ -28,11 +28,8 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DSOUND
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables

View File

@ -27,11 +27,8 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DS3DCALC
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables

View File

@ -28,11 +28,8 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DSBUFFER
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables

View File

@ -25,11 +25,8 @@
// *
// ******************************************************************
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp"

View File

@ -28,11 +28,8 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::DSSTREAM
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables

View File

@ -27,11 +27,8 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::XMO
// prevent name collisions
namespace xboxkrnl {
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <dsound.h>
#include "DirectSoundGlobal.hpp" // Global variables

View File

@ -27,12 +27,8 @@
#define LOG_PREFIX CXBXR_MODULE::XACT
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "core\kernel\init\CxbxKrnl.h"
#include "common\Logging.h"
#include "core\kernel\support\Emu.h"

View File

@ -27,13 +27,10 @@
#define LOG_PREFIX CXBXR_MODULE::XAPI
#undef FIELD_OFFSET // prevent macro redefinition warnings
/* prevent name collisions */
namespace xboxkrnl
{
#include <xboxkrnl\xboxkrnl.h>
};
#undef FIELD_OFFSET // prevent macro redefinition warnings
#include <xboxkrnl\xboxkrnl.h>
#include "common\input\SdlJoystick.h"
#include "common\input\InputManager.h"
#include <Shlwapi.h>

View File

@ -26,13 +26,9 @@
// ******************************************************************
#define LOG_PREFIX CXBXR_MODULE::KRNL
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <cstdio>
#include <cctype>
#include <clocale>

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::AV
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For AvGetSavedDataAddress, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For AvGetSavedDataAddress, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::DBG
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For DbgPrint, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For DbgPrint, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::EX
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For ExAllocatePool, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For ExAllocatePool, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuEEPROM.h" // For EmuFindEEPROMInfo, EEPROM, XboxFactoryGameRegion
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,7 @@
#define LOG_PREFIX CXBXR_MODULE::FSC
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For FscGetCacheSize, etc.
};
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::HAL
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For HalReadSMCTrayState, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For HalReadSMCTrayState, etc.
#include <Shlwapi.h> // For PathRemoveFileSpec()
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnl.h" // For InitializeListHead(), etc.

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::IO
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For IoCompletionObjectType, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For IoCompletionObjectType, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"
#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::KD
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For KdDebuggerEnabled, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For KdDebuggerEnabled, etc.
#include "Logging.h"
// ******************************************************************

View File

@ -64,12 +64,8 @@ the said software).
#define LOG_PREFIX CXBXR_MODULE::KE
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For KeBugCheck, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For KeBugCheck, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -78,12 +78,8 @@ the said software).
#define LOG_PREFIX CXBXR_MODULE::KI
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For KeBugCheck, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For KeBugCheck, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnl.h" // for the list support functions
#include "EmuKrnlKi.h"

View File

@ -27,13 +27,8 @@
#define LOG_PREFIX CXBXR_MODULE::LOG
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include "Logging.h"
#include "EmuKrnlLogging.h"
#include "core\kernel\init\CxbxKrnl.h"

View File

@ -29,12 +29,8 @@
#define LOG_PREFIX CXBXR_MODULE::MM
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For MmGlobalData, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For MmGlobalData, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnl.h" // For DefaultLaunchDataPage
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::NT
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For NtAllocateVirtualMemory, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For NtAllocateVirtualMemory, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::OB
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For ObDirectoryObjectType, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For ObDirectoryObjectType, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"
#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnlCleanup

View File

@ -25,11 +25,8 @@
// *
// ******************************************************************
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#define LOG_PREFIX CXBXR_MODULE::KRNL

View File

@ -29,12 +29,8 @@
#define LOG_PREFIX CXBXR_MODULE::PS
#include <common\util\CxbxUtil.h>
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For PsCreateSystemThreadEx, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For PsCreateSystemThreadEx, etc.
#include <process.h> // For __beginthreadex(), etc.
#include <float.h> // For _controlfp constants

View File

@ -29,12 +29,8 @@
#define LOG_PREFIX CXBXR_MODULE::RTL
#define CHECK_ALIGNMENT(size, alignment) (((size) % (alignment)) == 0) // For RtlFillMemoryUlong
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For RtlAnsiStringToUnicodeString, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For RtlAnsiStringToUnicodeString, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::XBOX
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For XboxEEPROMKey, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For XboxEEPROMKey, etc.
#include "Logging.h"
// Certificate Key

View File

@ -30,12 +30,8 @@
#define LOG_PREFIX CXBXR_MODULE::XC
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For XcSHAInit, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For XcSHAInit, etc.
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"
#include "common\crypto\EmuSha.h" // For A_SHAInit, etc.

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::XE
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For XeImageFileName, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For XeImageFileName, etc.
#include "core\kernel\init\CxbxKrnl.h" // For CxbxKrnl_Xbe
#include "Logging.h" // For LOG_FUNC()
#include "EmuKrnlLogging.h"

View File

@ -25,12 +25,8 @@
// *
// ******************************************************************
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "Cxbx.h" // For CxbxKrnl_KernelThunkTable
#include "core\kernel\init\CxbxKrnl.h" // For UINT

View File

@ -28,12 +28,8 @@
#define LOG_PREFIX CXBXR_MODULE::CXBXR
#define LOG_PREFIX_INIT CXBXR_MODULE::INIT
/* prevent name collisions */
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "gui/resource/ResCxbx.h"
#include "core\kernel\init\CxbxKrnl.h"
#include "common\xbdm\CxbxXbdm.h" // For Cxbx_LibXbdmThunkTable

View File

@ -29,11 +29,7 @@
#define PHYSICAL_MEMORY_H
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "core\kernel\support\Emu.h"
#include "core\kernel\init\CxbxKrnl.h"
#include <windows.h>

View File

@ -27,12 +27,8 @@
#define LOG_PREFIX CXBXR_MODULE::X86
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl\xboxkrnl.h>
};
#include <xboxkrnl\xboxkrnl.h>
#include "core\kernel\init\CxbxKrnl.h"
#include "Emu.h"
#include "devices\x86\EmuX86.h"

View File

@ -27,12 +27,8 @@
#define LOG_PREFIX CXBXR_MODULE::FS
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "core\kernel\exports\EmuKrnl.h" // For InitializeListHead(), etc.
#include "core\kernel\exports\EmuKrnlKe.h"
#include "core\kernel\support\EmuFS.h" // For fs_instruction_t

View File

@ -24,14 +24,8 @@
#ifndef EMUFILE_H
#define EMUFILE_H
// ******************************************************************
// * prevent name collisions
// ******************************************************************
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include <vector>
#include <cstdio>
#include <string>

View File

@ -32,12 +32,8 @@
#define LOG_PREFIX CXBXR_MODULE::NET
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
#include <WinSock2.h>
#include "core\kernel\init\CxbxKrnl.h"
#include "core\kernel\support\Emu.h"

View File

@ -27,12 +27,8 @@
#define LOG_PREFIX CXBXR_MODULE::SMC
/* prevent name collisions */
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For xbox.h:AV_PACK_HDTV
};
#include <xboxkrnl/xboxkrnl.h> // For xbox.h:AV_PACK_HDTV
#include "core\kernel\init\CxbxKrnl.h"
#include "EmuShared.h"

View File

@ -54,13 +54,9 @@
#define LOG_PREFIX CXBXR_MODULE::HUB
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
#include <cstring> // For memcpy
#include "OHCI.h"
#include "Hub.h"

View File

@ -51,12 +51,8 @@
#define LOG_PREFIX CXBXR_MODULE::OHCI
/* prevent name collisions */
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h>
};
#include <xboxkrnl/xboxkrnl.h>
#include "OHCI.h"
#include "core\kernel\exports\EmuKrnl.h" // For HalSystemInterrupt
#include "common\util\CxbxUtil.h"

View File

@ -56,13 +56,9 @@
#define LOG_PREFIX CXBXR_MODULE::USB
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
#include <cstring>
#include "USBDevice.h"
#include "OHCI.h"

View File

@ -52,12 +52,8 @@
#define LOG_PREFIX CXBXR_MODULE::XIDCTRL
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
};
#include <xboxkrnl/xboxkrnl.h> // For PKINTERRUPT, etc.
#include <cstring>
#include "XidGamepad.h"
#include "USBDevice.h"

View File

@ -37,11 +37,8 @@
#define LOG_PREFIX CXBXR_MODULE::NV2A
// prevent name collisions
namespace xboxkrnl
{
#include <xboxkrnl\xboxkrnl.h> // For PKINTERRUPT, etc.
};
#ifdef _MSC_VER // Check if MS Visual C compiler
# pragma comment(lib, "opengl32.lib") // Compiler-specific directive to avoid manually configuration