Win32ApiWindowsGamesEmulation.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #if IL2CPP_TARGET_WINDOWS_GAMES
  4. #include "os/Win32/WindowsHeaders.h"
  5. #include <WinSock2.h>
  6. #include "os/ErrorCodes.h"
  7. extern "C"
  8. {
  9. #define GetLongPathName GetLongPathNameW
  10. #define GetUserName GetUserNameW
  11. typedef
  12. BOOL
  13. (PASCAL FAR * LPFN_DISCONNECTEX)(
  14. _In_ SOCKET s,
  15. _Inout_opt_ LPOVERLAPPED lpOverlapped,
  16. _In_ DWORD dwFlags,
  17. _In_ DWORD dwReserved
  18. );
  19. #define WSAID_DISCONNECTEX \
  20. {0x7fda2e11,0x8630,0x436f,{0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57}}
  21. inline DWORD WINAPI GetLongPathNameW(LPCWSTR lpszShortPath, LPWSTR lpszLongPath, DWORD cchBuffer)
  22. {
  23. memmove(lpszLongPath, lpszShortPath, cchBuffer * sizeof(wchar_t));
  24. return cchBuffer;
  25. }
  26. inline HANDLE WINAPI CreateSemaphore(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
  27. {
  28. return ::CreateSemaphoreEx(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName, 0, SEMAPHORE_ALL_ACCESS);
  29. }
  30. inline BOOL WINAPI GetUserNameW(LPWSTR lpBuffer, LPDWORD pcbBuffer)
  31. {
  32. SetLastError(il2cpp::os::kErrorCallNotImplemented);
  33. return FALSE;
  34. }
  35. inline BOOL SetThreadErrorMode(DWORD dwNewMode, LPDWORD lpOldMode)
  36. {
  37. return TRUE;
  38. }
  39. inline BOOL DeleteVolumeMountPointW(LPCWSTR lpszVolumeMountPoint)
  40. {
  41. return FALSE;
  42. }
  43. }
  44. #endif //IL2CPP_TARGET_WINDOWS_GAMES