Remove some high level XAPI functions, including some which were not used

This commit is contained in:
Luke Usher 2016-08-13 22:41:30 +01:00
parent bd3ee280e1
commit 5485699f06
5 changed files with 1 additions and 556 deletions

View File

@ -703,55 +703,6 @@ DWORD WINAPI XTL::EmuXInputSetState
return ret; return ret;
} }
// ******************************************************************
// * func: EmuCreateMutex
// ******************************************************************
HANDLE WINAPI XTL::EmuCreateMutex
(
LPSECURITY_ATTRIBUTES lpMutexAttributes,
BOOL bInitialOwner,
LPCSTR lpName
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuCreateMutex\n"
"(\n"
" lpMutexAttributes : 0x%.08X\n"
" bInitialOwner : 0x%.08X\n"
" lpName : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), lpMutexAttributes, bInitialOwner, lpName, lpName);
HANDLE hRet = CreateMutex((SECURITY_ATTRIBUTES *)lpMutexAttributes, bInitialOwner, lpName);
EmuSwapFS(); // XBox FS
return hRet;
}
// ******************************************************************
// * func: EmuCloseHandle
// ******************************************************************
BOOL WINAPI XTL::EmuCloseHandle
(
HANDLE hObject
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuCloseHandle\n"
"(\n"
" hObject : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hObject);
BOOL bRet = CloseHandle(hObject);
EmuSwapFS(); // XBox FS
return bRet;
}
// ****************************************************************** // ******************************************************************
// * func: EmuSetThreadPriorityBoost // * func: EmuSetThreadPriorityBoost
@ -944,28 +895,6 @@ VOID WINAPI XTL::EmuXapiThreadStartup
return; return;
} }
/* Too High Level!
// ******************************************************************
// * func: XapiSetupPerTitleDriveLetters
// ******************************************************************
XTL::NTSTATUS CDECL XTL::XapiSetupPerTitleDriveLetters(DWORD dwTitleId, LPCWSTR wszTitleName)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): XapiSetupPerTitleDriveLetters\n"
"(\n"
" dwTitleId : 0x%.08X\n"
" wszTitleName : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwTitleId, wszTitleName);
NTSTATUS ret = STATUS_SUCCESS;
EmuSwapFS(); // XBox FS
return ret;
}
*/
// ****************************************************************** // ******************************************************************
// * func: EmuXapiBootDash // * func: EmuXapiBootDash
// ****************************************************************** // ******************************************************************
@ -1764,69 +1693,6 @@ BOOL WINAPI XTL::EmuPulseEvent( HANDLE hEvent )
return bRet; return bRet;
} }
// ******************************************************************
// * func: EmuCreateSemaphore
// ******************************************************************
HANDLE WINAPI XTL::EmuCreateSemaphore
(
LPVOID lpSemaphoreAttributes,
LONG lInitialCount,
LONG lMaximumCount,
LPSTR lpName
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuCreateSemaphore\n"
"(\n"
" lpSemaphoreAttributes : 0x%.08X\n"
" lInitialCount : 0x%.08X\n"
" lMaximumCount : 0x%.08X\n"
" lpName : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName, lpName);
if(lpSemaphoreAttributes)
EmuWarning( "lpSemaphoreAttributes != NULL" );
HANDLE hRet = CreateSemaphoreA( NULL, lInitialCount, lMaximumCount, lpName );
if( !hRet )
EmuWarning( "CreateSemaphore failed!" );
EmuSwapFS(); // Xbox FS
return hRet;
}
// ******************************************************************
// * func: EmuReleaseSemaphore
// ******************************************************************
BOOL WINAPI XTL::EmuReleaseSemaphore
(
HANDLE hSemaphore,
LONG lReleaseCount,
LPLONG lpPreviousCount
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuReleaseSemaphore\n"
"(\n"
" hSemaphore : 0x%.08X\n"
" lReleaseCount : 0x%.08X\n"
" lpPreviousCount : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hSemaphore, lReleaseCount, lpPreviousCount);
BOOL bRet = ReleaseSemaphore( hSemaphore, lReleaseCount, lpPreviousCount );
if( !bRet )
EmuWarning( "ReleaseSemaphore failed!" );
EmuSwapFS(); // Xbox FS
return bRet;
}
// ****************************************************************** // ******************************************************************
// * func: timeSetEvent // * func: timeSetEvent
// ****************************************************************** // ******************************************************************
@ -1950,60 +1816,6 @@ DWORD WINAPI XTL::EmuGetFileAttributesA
return dwRet; return dwRet;
} }
// ******************************************************************
// func: EmuVirtualProtect
// ******************************************************************
BOOL WINAPI XTL::EmuVirtualProtect
(
LPVOID lpAddress, // region of committed pages
SIZE_T dwSize, // size of the region
DWORD flNewProtect, // desired access protection
PDWORD lpflOldProtect // old protection
)
{
EmuSwapFS();
DbgPrintf("EmuXapi (0x%X): EmuVirtualProtect\n"
"(\n"
" lpAddress : 0x%.08X\n"
" dwSize : 0x%.08X\n"
" flNewProtect : 0x%.08X\n"
" lpflOldProtect : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpAddress, dwSize, flNewProtect, lpflOldProtect);
DWORD dwRet = VirtualProtect(lpAddress, dwSize, flNewProtect, lpflOldProtect);
EmuSwapFS();
return dwRet;
}
// ******************************************************************
// func: EmulstrcmpiW
// ******************************************************************
int WINAPI XTL::EmulstrcmpiW
(
LPCWSTR lpString1,
LPCWSTR lpString2
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmulstrcmpiW\n"
"(\n"
" lpString1 : 0x%.08X (%S)\n"
" lpString2 : 0x%.08X (%S)\n"
");\n",
GetCurrentThreadId(), lpString1, lpString1, lpString2, lpString2);
int Ret = lstrcmpiW(lpString1, lpString2);
EmuSwapFS(); // Xbox FS
return Ret;
}
// ****************************************************************** // ******************************************************************
// func: XMountMUA // func: XMountMUA
// ****************************************************************** // ******************************************************************
@ -2146,223 +1958,6 @@ DWORD WINAPI XTL::EmuXUnmountAlternateTitle(CHAR chDrive)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
// ******************************************************************
// * func: EmuMoveFileA
// ******************************************************************
BOOL WINAPI XTL::EmuMoveFileA
(
LPCSTR lpExistingFileName,
LPCSTR lpNewFileName
)
{
EmuSwapFS(); // Win2k/XP FS
printf("EmuXapi (0x%X): EmuMoveFileA\n"
"(\n"
" lpExistingFileName : 0x%.08X (%s)\n"
" lpNewFileName : 0x%.08X (%s)\n"
");\n",
GetCurrentThreadId(), lpExistingFileName, lpExistingFileName,
lpNewFileName, lpNewFileName);
// For Panzer.
BOOL bRet = MoveFileA( lpExistingFileName, lpNewFileName );
EmuSwapFS(); // Xbox FS
return bRet;
}
/* not necessary?
// ******************************************************************
// * func: EmuXCalculateSignatureBegin
// ******************************************************************
HANDLE WINAPI XTL::EmuXCalculateSignatureBegin
(
DWORD dwFlags
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): XCalculateSignatureBegin\n"
"(\n"
" dwFlags : 0x%.08X\n"
");\n",
GetCurrentThreadId(), dwFlags);
EmuSwapFS(); // XBox FS
// return a fake handle value for now
return (PVOID)0xAAAAAAAA;
}
// ******************************************************************
// * func: EmuXCalculateSignatureBeginEx
// ******************************************************************
HANDLE WINAPI XTL::EmuXCalculateSignatureBeginEx
(
DWORD dwFlags,
DWORD dwAltTitleId
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): XCalculateSignatureBeginEx\n"
"(\n"
" dwFlags : 0x%.08X\n",
" dwAltTitleId : 0x%.08X\n",
");\n",
GetCurrentThreadId(), dwFlags, dwAltTitleId);
EmuSwapFS(); // XBox FS
// return a fake handle value for now
return (PVOID)0xAAAAAAAA;
}
// ******************************************************************
// * func: EmuXCalculateSignatureUpdate
// ******************************************************************
DWORD WINAPI XTL::EmuXCalculateSignatureUpdate
(
HANDLE hCalcSig,
const BYTE *pbData,
ULONG cbData
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): XCalculateSignatureUpdate\n"
"(\n"
" hCalcSig : 0x%.08X\n",
" pbData : 0x%.08X\n",
" cbData : 0x%.08X\n",
");\n",
GetCurrentThreadId(), hCalcSig, pbData, cbData);
EmuSwapFS(); // XBox FS
return ERROR_SUCCESS;
}
// ******************************************************************
// * func: EmuXCalculateSignatureEnd
// ******************************************************************
DWORD WINAPI XTL::EmuXCalculateSignatureEnd
(
HANDLE hCalcSig,
PXCALCSIG_SIGNATURE pSignature
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): XCalculateSignatureEnd\n"
"(\n"
" hCalcSig : 0x%.08X\n",
" pSignature : 0x%.08X\n",
");\n",
GetCurrentThreadId(), hCalcSig, pSignature);
EmuSwapFS(); // XBox FS
return ERROR_SUCCESS;
}
//*/
// ******************************************************************
// * func: EmuCreateMutex
// ******************************************************************
HANDLE WINAPI EmuCreateMutex
(
LPSECURITY_ATTRIBUTES lpMutexAttributes,
BOOL bInitialOwner,
LPCSTR lpName
)
{
// TODO: Later (if needed)
return NULL;
}
// ******************************************************************
// * func: EmuCloseHandle
// ******************************************************************
//BOOL WINAPI XTL::EmuCloseHandle
//(
// HANDLE hObject
//)
//{
// EmuSwapFS(); // Win2k/XP FS
//
// DbgPrintf("EmuXapi (0x%X): EmuCloseHandle\n"
// "(\n"
// " hObject : 0x%.08X\n",
// ");\n",
// GetCurrentThreadId(), hObject);
//
// BOOL bRet = CloseHandle( hObject );
//
// EmuSwapFS(); // Xbox FS
//
// return bRet;
//}
// ******************************************************************
// * func: EmuVirtualAlloc
// ******************************************************************
LPVOID WINAPI XTL::EmuVirtualAlloc
(
LPVOID lpAddress,
SIZE_T dwSize,
DWORD flAllocationType,
DWORD flProtect
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuVirtualAlloc\n"
"(\n"
" lpAddress : 0x%.08X\n"
" dwSize : 0x%.08X\n"
" flAllocationType : 0x%.08X\n"
" flProtect : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpAddress, dwSize, flAllocationType, flProtect);
LPVOID ret = VirtualAllocEx( GetCurrentProcess(), lpAddress, dwSize, flAllocationType, flProtect );
EmuSwapFS(); // Xbox FS
return ret;
}
// ******************************************************************
// * func: EmuVirtualAlloc
// ******************************************************************
BOOL WINAPI XTL::EmuVirtualFree
(
LPVOID lpAddress,
SIZE_T dwSize,
DWORD dwFreeType
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuVirtualFree\n"
"(\n"
" lpAddress : 0x%.08X\n"
" dwSize : 0x%.08X\n"
" dwFreeType : 0x%.08X\n"
");\n",
GetCurrentThreadId(), lpAddress, dwSize, dwFreeType);
BOOL bRet = VirtualFreeEx( GetCurrentProcess(), lpAddress, dwSize, dwFreeType );
EmuSwapFS(); // Xbox FS
return bRet;
}
// ****************************************************************** // ******************************************************************
// * func: EmuXGetDeviceEnumerationStatus // * func: EmuXGetDeviceEnumerationStatus
// ****************************************************************** // ******************************************************************
@ -2377,22 +1972,6 @@ DWORD WINAPI XTL::EmuXGetDeviceEnumerationStatus()
return XDEVICE_ENUMERATION_IDLE; return XDEVICE_ENUMERATION_IDLE;
} }
// ******************************************************************
// * func: EmuSwitchToThread
// ******************************************************************
BOOL WINAPI XTL::EmuSwitchToThread()
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuSwitchToThread()\n", GetCurrentThreadId());
BOOL bRet = SwitchToThread();
EmuSwapFS(); // Xbox FS
return bRet;
}
// ****************************************************************** // ******************************************************************
// * func: EmuXInputGetDeviceDescription // * func: EmuXInputGetDeviceDescription
// ****************************************************************** // ******************************************************************
@ -2462,71 +2041,3 @@ DWORD WINAPI XTL::EmuXMountMURootA
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
// ******************************************************************
// * func: EmuReadFileEx
// ******************************************************************
BOOL WINAPI XTL::EmuReadFileEx
(
HANDLE hFile, // handle to file
LPVOID lpBuffer, // data buffer
DWORD nNumberOfBytesToRead, // number of bytes to read
LPOVERLAPPED lpOverlapped, // offset
LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine // completion routine
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuXapi (0x%X): EmuReadFileEx\n"
"(\n"
" hFile : 0x%.08X\n"
" lpBuffer : 0x%.08X\n"
" nNumberOfBytesToRead : 0x%.08X\n"
" lpOverlapped : 0x%.08X\n"
" lpCompletionRoutine : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hFile, lpBuffer, nNumberOfBytesToRead,
lpOverlapped, lpCompletionRoutine);
BOOL bRet = ReadFileEx( hFile, lpBuffer, nNumberOfBytesToRead, lpOverlapped, lpCompletionRoutine );
if(!bRet)
printf("ReadFilEx failed!");
EmuSwapFS();
return bRet;
}
// ******************************************************************
// * func: EmuWriteFileEx
// ******************************************************************
BOOL WINAPI XTL::EmuWriteFileEx
(
HANDLE hFile, // handle to output file
LPCVOID lpBuffer, // data buffer
DWORD nNumberOfBytesToWrite, // number of bytes to write
LPOVERLAPPED lpOverlapped, // overlapped buffer
LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine // completion routine
)
{
EmuSwapFS(); // Win2k/XP FS
printf("EmuXapi (0x%X): EmuWriteFileEx\n"
"(\n"
" hFile : 0x%.08X\n"
" lpBuffer : 0x%.08X\n"
" nNumberOfBytesToWrite: 0x%.08X\n"
" lpOverlapped : 0x%.08X\n"
" lpCompletionRoutine : 0x%.08X\n"
");\n",
GetCurrentThreadId(), hFile, lpBuffer, nNumberOfBytesToWrite,
lpOverlapped, lpCompletionRoutine);
BOOL bRet = WriteFileEx( hFile, lpBuffer, nNumberOfBytesToWrite, lpOverlapped, lpCompletionRoutine );;
if(!bRet)
printf("WriteFilEx failed!");
EmuSwapFS();
return bRet;
}

View File

@ -39,6 +39,7 @@
extern "C" const char *szHLELastCompileTime = __TIMESTAMP__; extern "C" const char *szHLELastCompileTime = __TIMESTAMP__;
#include "Emu.h" #include "Emu.h"
#include "EmuXTL.h" #include "EmuXTL.h"
#include "HLEDataBase.h" #include "HLEDataBase.h"

View File

@ -1842,35 +1842,6 @@ OOVPATable XAPI_1_0_4627[] =
"EmuQueueUserAPC" "EmuQueueUserAPC"
#endif #endif
}, },
// VirtualProtect (* unchanged since 4627 *)
{
(OOVPA*)&VirtualProtect_1_0_4627,
XTL::EmuVirtualProtect,
#ifdef _DEBUG_TRACE
"VirtualProtect"
#endif
},
// CreateSemaphore
{
(OOVPA*)&CreateSemaphoreA_1_0_4627,
XTL::EmuCreateSemaphore,
#ifdef _DEBUG_TRACE
"EmuCreateSemaphoreA"
#endif
},
// ReleaseSemaphore
{
(OOVPA*)&ReleaseSemaphore_1_0_4627,
XTL::EmuReleaseSemaphore,
#ifdef _DEBUG_TRACE
"EmuReleaseSemaphore"
#endif
},
// XMountAlternateTitleA // XMountAlternateTitleA
{ {
(OOVPA*)&XMountAlternateTitleA_1_0_4627, (OOVPA*)&XMountAlternateTitleA_1_0_4627,

View File

@ -452,15 +452,6 @@ OOVPATable XAPI_1_0_5233[] =
"EmuQueueUserAPC" "EmuQueueUserAPC"
#endif #endif
}, },
// VirtualProtect (* unchanged since 4627 *)
{
(OOVPA*)&VirtualProtect_1_0_4627,
XTL::EmuVirtualProtect,
#ifdef _DEBUG_TRACE
"VirtualProtect"
#endif
},
// GetFileAttributesA (* unchanged since 4134 *) // GetFileAttributesA (* unchanged since 4134 *)
{ {
(OOVPA*)&GetFileAttributesA_1_0_4134, (OOVPA*)&GetFileAttributesA_1_0_4134,

View File

@ -659,26 +659,6 @@ OOVPATable XAPI_1_0_5558[] =
"EmuXapiBootDash" "EmuXapiBootDash"
#endif #endif
}, },
// CreateSemaphore
{
(OOVPA*)&CreateSemaphoreA_1_0_5558,
XTL::EmuCreateSemaphore,
#ifdef _DEBUG_TRACE
"EmuCreateSemaphoreA"
#endif
},
// ReleaseSemaphore
{
(OOVPA*)&ReleaseSemaphore_1_0_5558,
XTL::EmuReleaseSemaphore,
#ifdef _DEBUG_TRACE
"EmuReleaseSemaphore"
#endif
},
// XLaunchNewImageA // XLaunchNewImageA
{ {
(OOVPA*)&XLaunchNewImageA_1_0_5558, (OOVPA*)&XLaunchNewImageA_1_0_5558,
@ -715,15 +695,6 @@ OOVPATable XAPI_1_0_5558[] =
#ifdef _DEBUG_TRACE #ifdef _DEBUG_TRACE
"GetFileAttributesA" "GetFileAttributesA"
#endif #endif
},
// VirtualProtect (* unchanged since 4627 *)
{
(OOVPA*)&VirtualProtect_1_0_4627,
XTL::EmuVirtualProtect,
#ifdef _DEBUG_TRACE
"VirtualProtect"
#endif
}, },
// XGetSectionHandleA (* unchanged since 4134 *) // XGetSectionHandleA (* unchanged since 4134 *)
{ {