mirror of
https://github.com/decompals/wibo.git
synced 2025-12-12 14:46:09 +00:00
Implement some ActCtx functions for msvcr80.dll
This commit is contained in:
@@ -5,6 +5,14 @@
|
||||
namespace user32 {
|
||||
constexpr uint32_t RT_STRING_ID = 6;
|
||||
constexpr uintptr_t kDefaultKeyboardLayout = 0x04090409;
|
||||
constexpr int UOI_FLAGS = 1;
|
||||
constexpr DWORD WSF_VISIBLE = 0x0001;
|
||||
|
||||
struct USEROBJECTFLAGS {
|
||||
BOOL fInherit;
|
||||
BOOL fReserved;
|
||||
DWORD dwFlags;
|
||||
};
|
||||
|
||||
int WIN_FUNC LoadStringA(void* hInstance, unsigned int uID, char* lpBuffer, int cchBufferMax) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
@@ -122,6 +130,48 @@ namespace user32 {
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return reinterpret_cast<HKL>(kDefaultKeyboardLayout);
|
||||
}
|
||||
|
||||
HWINSTA WIN_FUNC GetProcessWindowStation() {
|
||||
DEBUG_LOG("GetProcessWindowStation()\n");
|
||||
static int kWindowStationStub;
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return reinterpret_cast<HWINSTA>(&kWindowStationStub);
|
||||
}
|
||||
|
||||
BOOL WIN_FUNC GetUserObjectInformationA(HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength,
|
||||
LPDWORD lpnLengthNeeded) {
|
||||
DEBUG_LOG("GetUserObjectInformationA(%p, %d, %p, %u, %p)\n", hObj, nIndex, pvInfo, nLength,
|
||||
lpnLengthNeeded);
|
||||
(void)hObj;
|
||||
|
||||
if (lpnLengthNeeded) {
|
||||
*lpnLengthNeeded = sizeof(USEROBJECTFLAGS);
|
||||
}
|
||||
|
||||
if (nIndex != UOI_FLAGS) {
|
||||
wibo::lastError = ERROR_CALL_NOT_IMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!pvInfo || nLength < sizeof(USEROBJECTFLAGS)) {
|
||||
wibo::lastError = ERROR_INSUFFICIENT_BUFFER;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
auto *flags = reinterpret_cast<USEROBJECTFLAGS *>(pvInfo);
|
||||
flags->fInherit = FALSE;
|
||||
flags->fReserved = FALSE;
|
||||
flags->dwFlags = WSF_VISIBLE;
|
||||
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HWND WIN_FUNC GetActiveWindow() {
|
||||
DEBUG_LOG("GetActiveWindow()\n");
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,6 +180,9 @@ static void *resolveByName(const char *name) {
|
||||
if (strcmp(name, "LoadStringW") == 0) return (void *) user32::LoadStringW;
|
||||
if (strcmp(name, "MessageBoxA") == 0) return (void *) user32::MessageBoxA;
|
||||
if (strcmp(name, "GetKeyboardLayout") == 0) return (void *) user32::GetKeyboardLayout;
|
||||
if (strcmp(name, "GetProcessWindowStation") == 0) return (void *) user32::GetProcessWindowStation;
|
||||
if (strcmp(name, "GetUserObjectInformationA") == 0) return (void *) user32::GetUserObjectInformationA;
|
||||
if (strcmp(name, "GetActiveWindow") == 0) return (void *) user32::GetActiveWindow;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user