mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[ROSTESTS] Fix 64bit issues (#1261)
This commit is contained in:
parent
efe4605177
commit
bb9a5f6046
23 changed files with 101 additions and 81 deletions
|
@ -442,7 +442,7 @@ NTSTATUS TdiQueryAddress(
|
||||||
if (SnmpInfo.NumAddr != 1)
|
if (SnmpInfo.NumAddr != 1)
|
||||||
{
|
{
|
||||||
/* Skip loopback address */
|
/* Skip loopback address */
|
||||||
*Address = DN2H(((PIPADDR_ENTRY)((ULONG)IpAddress + sizeof(IPADDR_ENTRY)))->Addr);
|
*Address = DN2H(((PIPADDR_ENTRY)((PUCHAR)IpAddress + sizeof(IPADDR_ENTRY)))->Addr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -507,7 +507,7 @@ NTSTATUS TdiSendDatagram(
|
||||||
RtlZeroMemory(ConnectInfo, sizeof(TDI_CONNECTION_INFORMATION) + sizeof(TA_IP_ADDRESS));
|
RtlZeroMemory(ConnectInfo, sizeof(TDI_CONNECTION_INFORMATION) + sizeof(TA_IP_ADDRESS));
|
||||||
|
|
||||||
ConnectInfo->RemoteAddressLength = sizeof(TA_IP_ADDRESS);
|
ConnectInfo->RemoteAddressLength = sizeof(TA_IP_ADDRESS);
|
||||||
ConnectInfo->RemoteAddress = (PUCHAR) ((ULONG)ConnectInfo + sizeof(TDI_CONNECTION_INFORMATION));
|
ConnectInfo->RemoteAddress = ((PUCHAR)ConnectInfo + sizeof(TDI_CONNECTION_INFORMATION));
|
||||||
|
|
||||||
TA = (PTA_IP_ADDRESS)(ConnectInfo->RemoteAddress);
|
TA = (PTA_IP_ADDRESS)(ConnectInfo->RemoteAddress);
|
||||||
TA->TAAddressCount = 1;
|
TA->TAAddressCount = 1;
|
||||||
|
@ -630,9 +630,9 @@ NTSTATUS TdiReceiveDatagram(
|
||||||
ReceiveInfo->RemoteAddressLength = 0;
|
ReceiveInfo->RemoteAddressLength = 0;
|
||||||
ReceiveInfo->RemoteAddress = NULL;
|
ReceiveInfo->RemoteAddress = NULL;
|
||||||
|
|
||||||
ReturnInfo = (PTDI_CONNECTION_INFORMATION) ((ULONG)ReceiveInfo + sizeof(TDI_CONNECTION_INFORMATION));
|
ReturnInfo = (PTDI_CONNECTION_INFORMATION) ((PUCHAR)ReceiveInfo + sizeof(TDI_CONNECTION_INFORMATION));
|
||||||
ReturnInfo->RemoteAddressLength = sizeof(TA_IP_ADDRESS);
|
ReturnInfo->RemoteAddressLength = sizeof(TA_IP_ADDRESS);
|
||||||
ReturnInfo->RemoteAddress = (PUCHAR) ((ULONG)ReturnInfo + sizeof(TDI_CONNECTION_INFORMATION));
|
ReturnInfo->RemoteAddress = ((PUCHAR)ReturnInfo + sizeof(TDI_CONNECTION_INFORMATION));
|
||||||
|
|
||||||
ReturnAddress = (PTA_IP_ADDRESS)(ReturnInfo->RemoteAddress);
|
ReturnAddress = (PTA_IP_ADDRESS)(ReturnInfo->RemoteAddress);
|
||||||
ReturnAddress->TAAddressCount = 1;
|
ReturnAddress->TAAddressCount = 1;
|
||||||
|
|
|
@ -288,8 +288,8 @@ service_main(DWORD dwArgc, LPWSTR* lpszArgv)
|
||||||
goto quit;
|
goto quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
test_tcp(lpszArgv[0], (DWORD)Teb->SubProcessTag);
|
test_tcp(lpszArgv[0], PtrToUlong(Teb->SubProcessTag));
|
||||||
test_udp(lpszArgv[0], (DWORD)Teb->SubProcessTag);
|
test_udp(lpszArgv[0], PtrToUlong(Teb->SubProcessTag));
|
||||||
|
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
quit:
|
quit:
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#define CBM_CREATDIB 2
|
#define CBM_CREATDIB 2
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xC0000000C0000000ULL)
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
GetExpected(
|
GetExpected(
|
||||||
DWORD *pdwError,
|
DWORD *pdwError,
|
||||||
|
@ -39,14 +41,14 @@ GetExpected(
|
||||||
{
|
{
|
||||||
if (!lpbmih)
|
if (!lpbmih)
|
||||||
{
|
{
|
||||||
if (!lpbInit || (lpbInit == (PVOID)0xC0000000)) return FALSE;
|
if (!lpbInit || (lpbInit == INVALID_POINTER)) return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lpbInit)
|
if (lpbInit)
|
||||||
{
|
{
|
||||||
if (lpbInit == (PVOID)0xC0000000) return FALSE;
|
if (lpbInit == INVALID_POINTER) return FALSE;
|
||||||
if (!lpbmi || (lpbmi == (PVOID)0xC0000000)) return FALSE;
|
if (!lpbmi || (lpbmi == INVALID_POINTER)) return FALSE;
|
||||||
if (lpbmi->bmiHeader.biSize == 0) return FALSE;
|
if (lpbmi->bmiHeader.biSize == 0) return FALSE;
|
||||||
if (fuUsage == 2) return FALSE;
|
if (fuUsage == 2) return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -64,10 +66,10 @@ GetExpected(
|
||||||
|
|
||||||
if (fdwInit & CBM_INIT)
|
if (fdwInit & CBM_INIT)
|
||||||
{
|
{
|
||||||
if (!lpbInit || (lpbInit == (PVOID)0xC0000000)) return FALSE;
|
if (!lpbInit || (lpbInit == INVALID_POINTER)) return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!lpbmi) || (lpbmi == (PVOID)0xc0000000) || (lpbmi->bmiHeader.biSize == 0))
|
if ((!lpbmi) || (lpbmi == INVALID_POINTER) || (lpbmi->bmiHeader.biSize == 0))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +78,7 @@ GetExpected(
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((lpbmih == NULL) ||
|
if ((lpbmih == NULL) ||
|
||||||
(lpbmih == (PVOID)0xC0000000) ||
|
(lpbmih == INVALID_POINTER) ||
|
||||||
(lpbmih->biSize == 0))
|
(lpbmih->biSize == 0))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -89,7 +91,7 @@ GetExpected(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (lpbmi == (PVOID)0xc0000000) return FALSE;
|
if (lpbmi == INVALID_POINTER) return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -119,7 +121,7 @@ Test_CreateDIBitmap_Params(void)
|
||||||
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, CBM_INIT, NULL, NULL, DIB_PAL_COLORS);
|
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, CBM_INIT, NULL, NULL, DIB_PAL_COLORS);
|
||||||
ok(hbmp != 0, "\n");
|
ok(hbmp != 0, "\n");
|
||||||
|
|
||||||
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, 0, (PVOID)0xc0000000, &bmi, DIB_PAL_COLORS);
|
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, 0, INVALID_POINTER, &bmi, DIB_PAL_COLORS);
|
||||||
ok(hbmp != 0, "\n");
|
ok(hbmp != 0, "\n");
|
||||||
|
|
||||||
hbmp = CreateDIBitmap(NULL, &bmi.bmiHeader, CBM_INIT, NULL, &bmi, DIB_PAL_COLORS);
|
hbmp = CreateDIBitmap(NULL, &bmi.bmiHeader, CBM_INIT, NULL, &bmi, DIB_PAL_COLORS);
|
||||||
|
@ -152,14 +154,14 @@ Test_CreateDIBitmap_Params(void)
|
||||||
ok_err(0xbadbad00);
|
ok_err(0xbadbad00);
|
||||||
|
|
||||||
SetLastError(0xbadbad00);
|
SetLastError(0xbadbad00);
|
||||||
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, CBM_INIT, (PVOID)0xc0000000, &bmi, DIB_PAL_COLORS);
|
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, CBM_INIT, INVALID_POINTER, &bmi, DIB_PAL_COLORS);
|
||||||
ok(hbmp == 0, "\n");
|
ok(hbmp == 0, "\n");
|
||||||
ok_err(0xbadbad00);
|
ok_err(0xbadbad00);
|
||||||
|
|
||||||
SetLastError(0xbadbad00);
|
SetLastError(0xbadbad00);
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, 0, ajBits, (PVOID)0xc0000000, DIB_PAL_COLORS);
|
hbmp = CreateDIBitmap(hdc, &bmi.bmiHeader, 0, ajBits, INVALID_POINTER, DIB_PAL_COLORS);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
@ -188,10 +190,10 @@ Test_CreateDIBitmap_Params(void)
|
||||||
{
|
{
|
||||||
ULONG i1, i2, i3, i4, i5, i6;
|
ULONG i1, i2, i3, i4, i5, i6;
|
||||||
HDC ahdc[3] = {0, hdc, (HDC)-1};
|
HDC ahdc[3] = {0, hdc, (HDC)-1};
|
||||||
PBITMAPINFOHEADER apbih[4] = {NULL, &bmi.bmiHeader, &bmiBroken.bmiHeader, (PVOID)0xC0000000};
|
PBITMAPINFOHEADER apbih[4] = {NULL, &bmi.bmiHeader, &bmiBroken.bmiHeader, INVALID_POINTER};
|
||||||
ULONG afInitf[12] = {0, 1, 2, 3, CBM_INIT, 4, 5, 6, 7, 8, 0x10, 0x20};
|
ULONG afInitf[12] = {0, 1, 2, 3, CBM_INIT, 4, 5, 6, 7, 8, 0x10, 0x20};
|
||||||
PVOID apvBits[3] = {NULL, ajBits, (PVOID)0xc0000000};
|
PVOID apvBits[3] = {NULL, ajBits, INVALID_POINTER};
|
||||||
PBITMAPINFO apbmi[4] = {NULL, &bmi, &bmiBroken, (PVOID)0xC0000000};
|
PBITMAPINFO apbmi[4] = {NULL, &bmi, &bmiBroken, INVALID_POINTER};
|
||||||
ULONG aiUsage[5] = {0, 1, 2, 3, 23};
|
ULONG aiUsage[5] = {0, 1, 2, 3, 23};
|
||||||
DWORD dwExpError;
|
DWORD dwExpError;
|
||||||
BOOL bExpSuccess;
|
BOOL bExpSuccess;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
|
||||||
|
|
||||||
void Test_DPtoLP_Params()
|
void Test_DPtoLP_Params()
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
@ -24,7 +26,7 @@ void Test_DPtoLP_Params()
|
||||||
ok_int(DPtoLP(NULL, NULL, -1), 1);
|
ok_int(DPtoLP(NULL, NULL, -1), 1);
|
||||||
ok_err(ERROR_SUCCESS);
|
ok_err(ERROR_SUCCESS);
|
||||||
|
|
||||||
ok_int(DPtoLP(NULL, (PVOID)0x80000000, -1), 1);
|
ok_int(DPtoLP(NULL, INVALID_POINTER, -1), 1);
|
||||||
ok_err(ERROR_SUCCESS);
|
ok_err(ERROR_SUCCESS);
|
||||||
|
|
||||||
ok_int(DPtoLP(NULL, NULL, 2), 0);
|
ok_int(DPtoLP(NULL, NULL, 2), 0);
|
||||||
|
@ -53,7 +55,7 @@ void Test_DPtoLP_Params()
|
||||||
|
|
||||||
hdc = GetDC(0);
|
hdc = GetDC(0);
|
||||||
SetLastError(ERROR_SUCCESS);
|
SetLastError(ERROR_SUCCESS);
|
||||||
ok_int(DPtoLP(hdc, (PVOID)0x80000000, 2), 1);
|
ok_int(DPtoLP(hdc, INVALID_POINTER, 2), 1);
|
||||||
ok_err(ERROR_SUCCESS);
|
ok_err(ERROR_SUCCESS);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ void Test_ExtCreatePen_Params()
|
||||||
ok(pelp->elpWidth == 0, "Wrong elpWidth, expected 0, got %lu\n", pelp->elpWidth);
|
ok(pelp->elpWidth == 0, "Wrong elpWidth, expected 0, got %lu\n", pelp->elpWidth);
|
||||||
ok(pelp->elpBrushStyle == BS_SOLID, "Wrong elpBrushStyle, expected BS_SOLID, got 0x%x\n", pelp->elpBrushStyle);
|
ok(pelp->elpBrushStyle == BS_SOLID, "Wrong elpBrushStyle, expected BS_SOLID, got 0x%x\n", pelp->elpBrushStyle);
|
||||||
ok(pelp->elpColor == 0, "Wrong elpColor, expected 0, got 0x%lx\n", pelp->elpColor);
|
ok(pelp->elpColor == 0, "Wrong elpColor, expected 0, got 0x%lx\n", pelp->elpColor);
|
||||||
ok(pelp->elpHatch == 0, "Wrong elpHatch, expected 0, got 0x%p\n", (PVOID)pelp->elpColor);
|
ok(pelp->elpHatch == 0, "Wrong elpHatch, expected 0, got 0x%lx\n", pelp->elpHatch);
|
||||||
ok(pelp->elpNumEntries == 0, "Wrong elpNumEntries, expected %u got %lu\n", 0, pelp->elpNumEntries);
|
ok(pelp->elpNumEntries == 0, "Wrong elpNumEntries, expected %u got %lu\n", 0, pelp->elpNumEntries);
|
||||||
|
|
||||||
/* Test PS_NULL with styles */
|
/* Test PS_NULL with styles */
|
||||||
|
|
|
@ -360,13 +360,13 @@ void Test_GetDIBits()
|
||||||
ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1);
|
ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1);
|
||||||
ok_int(pbi->bmiHeader.biPlanes, 1);
|
ok_int(pbi->bmiHeader.biPlanes, 1);
|
||||||
SetLastError(0xdeadbabe);
|
SetLastError(0xdeadbabe);
|
||||||
ok_int(GetDIBits((HDC)0xff00ff00, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
ok_int(GetDIBits((HDC)UlongToHandle(0xff00ff00), hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
||||||
ok_err(0x57);
|
ok_err(0x57);
|
||||||
SetLastError(0xdeadbabe);
|
SetLastError(0xdeadbabe);
|
||||||
ok_int(GetDIBits(hdcScreen, (HBITMAP)0xff00ff00, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
ok_int(GetDIBits(hdcScreen, (HBITMAP)UlongToHandle(0xff00ff00), 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
||||||
ok_err(0xdeadbabe);
|
ok_err(0xdeadbabe);
|
||||||
SetLastError(0xdeadbabe);
|
SetLastError(0xdeadbabe);
|
||||||
ok_int(GetDIBits((HDC)0xff00ff00, (HBITMAP)0xff00ff00, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
ok_int(GetDIBits((HDC)UlongToHandle(0xff00ff00), (HBITMAP)UlongToHandle(0xff00ff00), 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
||||||
ok_err(0x57);
|
ok_err(0x57);
|
||||||
SetLastError(0xdeadbabe);
|
SetLastError(0xdeadbabe);
|
||||||
ok_int(GetDIBits(NULL, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
ok_int(GetDIBits(NULL, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0);
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
|
||||||
|
|
||||||
void
|
void
|
||||||
Test_General(void)
|
Test_General(void)
|
||||||
{
|
{
|
||||||
|
@ -124,21 +126,21 @@ Test_General(void)
|
||||||
|
|
||||||
/* Test invalid buffer */
|
/* Test invalid buffer */
|
||||||
SetLastError(0xbadbad00);
|
SetLastError(0xbadbad00);
|
||||||
ok(GetObjectA(GetStockObject(WHITE_BRUSH), sizeof(LOGBRUSH), (PVOID)0xc0000000) == 0, "\n");
|
ok(GetObjectA(GetStockObject(WHITE_BRUSH), sizeof(LOGBRUSH), INVALID_POINTER) == 0, "\n");
|
||||||
ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
|
ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
|
||||||
SetLastError(0xbadbad00);
|
SetLastError(0xbadbad00);
|
||||||
ok(GetObjectW(GetStockObject(BLACK_PEN), sizeof(LOGPEN), (PVOID)0xc0000000) == 0, "\n");
|
ok(GetObjectW(GetStockObject(BLACK_PEN), sizeof(LOGPEN), INVALID_POINTER) == 0, "\n");
|
||||||
ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
|
ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
|
||||||
SetLastError(0xbadbad00);
|
SetLastError(0xbadbad00);
|
||||||
ok(GetObjectW(GetStockObject(21), sizeof(BITMAP), (PVOID)0xc0000000) == 0, "\n");
|
ok(GetObjectW(GetStockObject(21), sizeof(BITMAP), INVALID_POINTER) == 0, "\n");
|
||||||
ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
|
ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
|
||||||
SetLastError(0xbadbad00);
|
SetLastError(0xbadbad00);
|
||||||
ok(GetObjectW(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), (PVOID)0xc0000000) == 0, "\n");
|
ok(GetObjectW(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), INVALID_POINTER) == 0, "\n");
|
||||||
ok(GetLastError() == 0xbadbad00, "wrong error: %ld\n", GetLastError());
|
ok(GetLastError() == 0xbadbad00, "wrong error: %ld\n", GetLastError());
|
||||||
SetLastError(ERROR_SUCCESS);
|
SetLastError(ERROR_SUCCESS);
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
ret = GetObjectA(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), (PVOID)0xc0000000);
|
ret = GetObjectA(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), INVALID_POINTER);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,8 +13,8 @@ START_TEST(RealizePalette)
|
||||||
{
|
{
|
||||||
InitStuff();
|
InitStuff();
|
||||||
ok_int(RealizePalette(NULL), GDI_ERROR);
|
ok_int(RealizePalette(NULL), GDI_ERROR);
|
||||||
ok_int(RealizePalette((HDC)0xdeadc0de), GDI_ERROR);
|
ok_int(RealizePalette((HDC)UlongToHandle(0xdeadc0de)), GDI_ERROR);
|
||||||
ok_int(RealizePalette((HDC)0x00010001), 0);
|
ok_int(RealizePalette((HDC)UlongToHandle(0x00010001)), 0);
|
||||||
ok_int(RealizePalette(ghdcDIB32), 0);
|
ok_int(RealizePalette(ghdcDIB32), 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
// stolen from com_apitest.h
|
// stolen from com_apitest.h
|
||||||
DEFINE_GUID(CLSID_FadeTask, 0x7EB5FBE4, 0x2100, 0x49E6, 0x85, 0x93, 0x17, 0xE1, 0x30, 0x12, 0x2F, 0x91);
|
DEFINE_GUID(CLSID_FadeTask, 0x7EB5FBE4, 0x2100, 0x49E6, 0x85, 0x93, 0x17, 0xE1, 0x30, 0x12, 0x2F, 0x91);
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
|
||||||
|
|
||||||
typedef HRESULT (__stdcall *tShellDimScreen) (IUnknown** Unknown, HWND* hWindow);
|
typedef HRESULT (__stdcall *tShellDimScreen) (IUnknown** Unknown, HWND* hWindow);
|
||||||
|
|
||||||
|
@ -21,8 +22,8 @@ tShellDimScreen ShellDimScreen;
|
||||||
|
|
||||||
static void Test_Dim()
|
static void Test_Dim()
|
||||||
{
|
{
|
||||||
IUnknown* unk = (IUnknown*)0xdeadbeef;
|
IUnknown* unk = (IUnknown*)INVALID_POINTER;
|
||||||
HWND wnd = (HWND)0xdeadbeef;
|
HWND wnd = (HWND)INVALID_POINTER;
|
||||||
ULONG count;
|
ULONG count;
|
||||||
|
|
||||||
HRESULT hr = ShellDimScreen(NULL, NULL);
|
HRESULT hr = ShellDimScreen(NULL, NULL);
|
||||||
|
@ -30,24 +31,24 @@ static void Test_Dim()
|
||||||
|
|
||||||
hr = ShellDimScreen(&unk, &wnd);
|
hr = ShellDimScreen(&unk, &wnd);
|
||||||
ok_hex(hr, S_OK);
|
ok_hex(hr, S_OK);
|
||||||
ok(unk != ((IUnknown*)0xdeadbeef), "Expected a valid object\n");
|
ok(unk != INVALID_POINTER, "Expected a valid object\n");
|
||||||
ok(wnd != ((HWND)0xdeadbeef), "Expected a valid window ptr\n");
|
ok(wnd != INVALID_POINTER, "Expected a valid window ptr\n");
|
||||||
ok(IsWindow(wnd), "Expected a valid window\n");
|
ok(IsWindow(wnd), "Expected a valid window\n");
|
||||||
ok(IsWindowVisible(wnd), "Expected the window to be visible\n");
|
ok(IsWindowVisible(wnd), "Expected the window to be visible\n");
|
||||||
|
|
||||||
if (unk != ((IUnknown*)0xdeadbeef) && unk)
|
if (unk != ((IUnknown*)INVALID_POINTER) && unk)
|
||||||
{
|
{
|
||||||
count = unk->Release();
|
count = unk->Release();
|
||||||
ok(count == 0, "Expected count to be 0, was: %lu\n", count);
|
ok(count == 0, "Expected count to be 0, was: %lu\n", count);
|
||||||
ok(!IsWindow(wnd), "Expected the window to be destroyed\n");
|
ok(!IsWindow(wnd), "Expected the window to be destroyed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
unk = (IUnknown*)0xdeadbeef;
|
unk = (IUnknown*)INVALID_POINTER;
|
||||||
wnd = (HWND)0xdeadbeef;
|
wnd = (HWND)INVALID_POINTER;
|
||||||
hr = ShellDimScreen(&unk, &wnd);
|
hr = ShellDimScreen(&unk, &wnd);
|
||||||
ok_hex(hr, S_OK);
|
ok_hex(hr, S_OK);
|
||||||
ok(unk != ((IUnknown*)0xdeadbeef), "Expected a valid object\n");
|
ok(unk != ((IUnknown*)INVALID_POINTER), "Expected a valid object\n");
|
||||||
ok(wnd != ((HWND)0xdeadbeef), "Expected a valid window ptr\n");
|
ok(wnd != ((HWND)INVALID_POINTER), "Expected a valid window ptr\n");
|
||||||
ok(IsWindow(wnd), "Expected a valid window\n");
|
ok(IsWindow(wnd), "Expected a valid window\n");
|
||||||
ok(IsWindowVisible(wnd), "Expected the window to be visible\n");
|
ok(IsWindowVisible(wnd), "Expected the window to be visible\n");
|
||||||
char classname[100] = {0};
|
char classname[100] = {0};
|
||||||
|
@ -60,7 +61,7 @@ static void Test_Dim()
|
||||||
style = GetWindowLong(wnd, GWL_EXSTYLE);
|
style = GetWindowLong(wnd, GWL_EXSTYLE);
|
||||||
ok(style == WS_EX_TOPMOST, "Expected exstyle to be %x, was %lx\n", WS_EX_TOPMOST, style);
|
ok(style == WS_EX_TOPMOST, "Expected exstyle to be %x, was %lx\n", WS_EX_TOPMOST, style);
|
||||||
|
|
||||||
if (unk != ((IUnknown*)0xdeadbeef) && unk)
|
if (unk != ((IUnknown*)INVALID_POINTER) && unk)
|
||||||
{
|
{
|
||||||
count = unk->AddRef();
|
count = unk->AddRef();
|
||||||
ok(count == 2, "Expected count to be 2, was: %lu\n", count);
|
ok(count == 2, "Expected count to be 2, was: %lu\n", count);
|
||||||
|
@ -92,7 +93,7 @@ static void Test_Dim()
|
||||||
ok((rc.right - rc.left) == GetSystemMetrics(SM_CXVIRTUALSCREEN), "Expected rc.left to be %u, was %lu\n", GetSystemMetrics(SM_CXVIRTUALSCREEN), (rc.right - rc.left));
|
ok((rc.right - rc.left) == GetSystemMetrics(SM_CXVIRTUALSCREEN), "Expected rc.left to be %u, was %lu\n", GetSystemMetrics(SM_CXVIRTUALSCREEN), (rc.right - rc.left));
|
||||||
ok((rc.bottom - rc.top) == GetSystemMetrics(SM_CYVIRTUALSCREEN), "Expected rc.top to be %u, was %lu\n", GetSystemMetrics(SM_CYVIRTUALSCREEN), (rc.bottom - rc.top));
|
ok((rc.bottom - rc.top) == GetSystemMetrics(SM_CYVIRTUALSCREEN), "Expected rc.top to be %u, was %lu\n", GetSystemMetrics(SM_CYVIRTUALSCREEN), (rc.bottom - rc.top));
|
||||||
|
|
||||||
if (unk != ((IUnknown*)0xdeadbeef) && unk)
|
if (unk != ((IUnknown*)INVALID_POINTER) && unk)
|
||||||
{
|
{
|
||||||
count = unk->Release();
|
count = unk->Release();
|
||||||
ok(count == 0, "Expected count to be 0, was: %lu\n", count);
|
ok(count == 0, "Expected count to be 0, was: %lu\n", count);
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <shellutils.h>
|
#include <shellutils.h>
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
|
||||||
|
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
TestShellFolder(
|
TestShellFolder(
|
||||||
|
@ -55,7 +57,7 @@ VOID TestInitialize(_In_ IShellFolder2 *psf2)
|
||||||
hr = ppf2->Initialize(NULL);
|
hr = ppf2->Initialize(NULL);
|
||||||
ok(hr == S_OK, "hr = %lx\n", hr);
|
ok(hr == S_OK, "hr = %lx\n", hr);
|
||||||
|
|
||||||
hr = ppf2->Initialize((LPCITEMIDLIST)0xdeaddead);
|
hr = ppf2->Initialize((LPCITEMIDLIST)INVALID_POINTER);
|
||||||
ok(hr == S_OK, "hr = %lx\n", hr);
|
ok(hr == S_OK, "hr = %lx\n", hr);
|
||||||
|
|
||||||
//crashes in xp
|
//crashes in xp
|
||||||
|
|
|
@ -88,7 +88,7 @@ TestNotification(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set an invalid icon for the notification icon */
|
/* Set an invalid icon for the notification icon */
|
||||||
hr = pUserNotif->SetIconInfo((HICON)0xdeadbeef, L"Tooltip text");
|
hr = pUserNotif->SetIconInfo((HICON)UlongToHandle(0xdeadbeef), L"Tooltip text");
|
||||||
ok_hr(hr, S_OK);
|
ok_hr(hr, S_OK);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -120,7 +120,7 @@ void test_CShellMenu_params()
|
||||||
hResult = shellMenu->SetMenu(hmenu, NULL, 0);
|
hResult = shellMenu->SetMenu(hmenu, NULL, 0);
|
||||||
test_S_OK(hResult, "SetMenu failed");
|
test_S_OK(hResult, "SetMenu failed");
|
||||||
|
|
||||||
hwndToolbar = (HWND)0xdeadbeef;
|
hwndToolbar = (HWND)UlongToPtr(0xdeadbeef);
|
||||||
hResult = dockingMenu->GetWindow(&hwndToolbar);
|
hResult = dockingMenu->GetWindow(&hwndToolbar);
|
||||||
test_S_OK(hResult, "GetWindow failed");
|
test_S_OK(hResult, "GetWindow failed");
|
||||||
ok (hwndToolbar == NULL, "Expected NULL window\n");
|
ok (hwndToolbar == NULL, "Expected NULL window\n");
|
||||||
|
@ -144,7 +144,7 @@ void test_CShellMenu_params()
|
||||||
hResult = shellMenu->SetShellFolder(NULL, NULL, 0, 0);
|
hResult = shellMenu->SetShellFolder(NULL, NULL, 0, 0);
|
||||||
test_HRES(hResult, E_INVALIDARG, "SetShellFolder should fail");
|
test_HRES(hResult, E_INVALIDARG, "SetShellFolder should fail");
|
||||||
|
|
||||||
hwndToolbar = (HWND)0xdeadbeef;
|
hwndToolbar = (HWND)UlongToHandle(0xdeadbeef);
|
||||||
hResult = dockingMenu->GetWindow(&hwndToolbar);
|
hResult = dockingMenu->GetWindow(&hwndToolbar);
|
||||||
test_S_OK(hResult, "GetWindow failed");
|
test_S_OK(hResult, "GetWindow failed");
|
||||||
ok (hwndToolbar == NULL, "Expected NULL window\n");
|
ok (hwndToolbar == NULL, "Expected NULL window\n");
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#include <marshalling/marshalling.h>
|
#include <marshalling/marshalling.h>
|
||||||
#include <marshalling/ports.h>
|
#include <marshalling/ports.h>
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
|
||||||
|
|
||||||
START_TEST(MarshallDownStructuresArray)
|
START_TEST(MarshallDownStructuresArray)
|
||||||
{
|
{
|
||||||
const DWORD cElements = 2;
|
const DWORD cElements = 2;
|
||||||
|
@ -49,11 +51,11 @@ START_TEST(MarshallDownStructuresArray)
|
||||||
|
|
||||||
// This is triggered by both pStructuresArray and pInfo.
|
// This is triggered by both pStructuresArray and pInfo.
|
||||||
SetLastError(0xDEADBEEF);
|
SetLastError(0xDEADBEEF);
|
||||||
ok(!MarshallDownStructuresArray((PVOID)0xDEADDEAD, 1, NULL, 0, FALSE), "MarshallDownStructuresArray returns TRUE!\n");
|
ok(!MarshallDownStructuresArray(INVALID_POINTER, 1, NULL, 0, FALSE), "MarshallDownStructuresArray returns TRUE!\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xDEADBEEF);
|
SetLastError(0xDEADBEEF);
|
||||||
ok(!MarshallDownStructuresArray(NULL, 1, (const MARSHALLING_INFO*)0xDEADDEAD, 0, FALSE), "MarshallDownStructuresArray returns TRUE!\n");
|
ok(!MarshallDownStructuresArray(NULL, 1, (const MARSHALLING_INFO*)INVALID_POINTER, 0, FALSE), "MarshallDownStructuresArray returns TRUE!\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
||||||
|
|
||||||
// Now create two PORT_INFO_2W structures.
|
// Now create two PORT_INFO_2W structures.
|
||||||
|
@ -99,13 +101,13 @@ START_TEST(MarshallDownStructuresArray)
|
||||||
// Due to the implementation of PackStrings, (&pPortInfo2[0])->pPortName contains the highest offset.
|
// Due to the implementation of PackStrings, (&pPortInfo2[0])->pPortName contains the highest offset.
|
||||||
// Show that MarshallUpStructuresArray checks the offsets and bails out with ERROR_INVALID_DATA if cbSize <= highest offset.
|
// Show that MarshallUpStructuresArray checks the offsets and bails out with ERROR_INVALID_DATA if cbSize <= highest offset.
|
||||||
SetLastError(0xDEADBEEF);
|
SetLastError(0xDEADBEEF);
|
||||||
ok(!MarshallUpStructuresArray((DWORD)(&pPortInfo2[0])->pPortName, pPortInfo2Test, cElements, pPortInfoMarshalling[2]->pInfo, pPortInfoMarshalling[2]->cbStructureSize, TRUE), "MarshallUpStructuresArray returns TRUE!\n");
|
ok(!MarshallUpStructuresArray((DWORD_PTR)(&pPortInfo2[0])->pPortName, pPortInfo2Test, cElements, pPortInfoMarshalling[2]->pInfo, pPortInfoMarshalling[2]->cbStructureSize, TRUE), "MarshallUpStructuresArray returns TRUE!\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_DATA, "GetLastError returns %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_DATA, "GetLastError returns %lu!\n", GetLastError());
|
||||||
|
|
||||||
// It works with cbSize > highest offset.
|
// It works with cbSize > highest offset.
|
||||||
// In real world cases, we would use cbPortInfo2Size for cbSize.
|
// In real world cases, we would use cbPortInfo2Size for cbSize.
|
||||||
SetLastError(0xDEADBEEF);
|
SetLastError(0xDEADBEEF);
|
||||||
ok(MarshallUpStructuresArray((DWORD)(&pPortInfo2[0])->pPortName + 1, pPortInfo2, cElements, pPortInfoMarshalling[2]->pInfo, pPortInfoMarshalling[2]->cbStructureSize, TRUE), "MarshallUpStructuresArray returns FALSE!\n");
|
ok(MarshallUpStructuresArray((DWORD_PTR)(&pPortInfo2[0])->pPortName + 1, pPortInfo2, cElements, pPortInfoMarshalling[2]->pInfo, pPortInfoMarshalling[2]->cbStructureSize, TRUE), "MarshallUpStructuresArray returns FALSE!\n");
|
||||||
ok(GetLastError() == 0xDEADBEEF, "GetLastError returns %lu!\n", GetLastError());
|
ok(GetLastError() == 0xDEADBEEF, "GetLastError returns %lu!\n", GetLastError());
|
||||||
|
|
||||||
// pPortInfo2 should now be identical to the copy again.
|
// pPortInfo2 should now be identical to the copy again.
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#include <marshalling/marshalling.h>
|
#include <marshalling/marshalling.h>
|
||||||
|
|
||||||
|
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
|
||||||
|
|
||||||
START_TEST(MarshallUpStructuresArray)
|
START_TEST(MarshallUpStructuresArray)
|
||||||
{
|
{
|
||||||
// Setting cElements to zero should yield success.
|
// Setting cElements to zero should yield success.
|
||||||
|
@ -26,11 +28,11 @@ START_TEST(MarshallUpStructuresArray)
|
||||||
|
|
||||||
// This is triggered by both pStructuresArray and pInfo.
|
// This is triggered by both pStructuresArray and pInfo.
|
||||||
SetLastError(0xDEADBEEF);
|
SetLastError(0xDEADBEEF);
|
||||||
ok(!MarshallUpStructuresArray(0, (PVOID)0xDEADDEAD, 1, NULL, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
|
ok(!MarshallUpStructuresArray(0, INVALID_POINTER, 1, NULL, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xDEADBEEF);
|
SetLastError(0xDEADBEEF);
|
||||||
ok(!MarshallUpStructuresArray(0, NULL, 1, (const MARSHALLING_INFO*)0xDEADDEAD, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
|
ok(!MarshallUpStructuresArray(0, NULL, 1, (const MARSHALLING_INFO*)INVALID_POINTER, 0, FALSE), "MarshallUpStructuresArray returns TRUE!\n");
|
||||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError returns %lu!\n", GetLastError());
|
||||||
|
|
||||||
// More testing is conducted in the MarshallDownStructuresArray test.
|
// More testing is conducted in the MarshallDownStructuresArray test.
|
||||||
|
|
|
@ -805,7 +805,7 @@ static LRESULT CALLBACK MSGTestProcMDI2(HWND hWnd, UINT message, WPARAM wParam,
|
||||||
mcs.style = WS_MAXIMIZE;
|
mcs.style = WS_MAXIMIZE;
|
||||||
|
|
||||||
hchild = (HWND) SendMessage (g_hwndMDIClient, WM_MDICREATE, 0,
|
hchild = (HWND) SendMessage (g_hwndMDIClient, WM_MDICREATE, 0,
|
||||||
(LONG)(LPMDICREATESTRUCT) &mcs);
|
(LPARAM)&mcs);
|
||||||
ok(hchild == g_ChildWindow, "We are testing with %p instead of %p\n", g_ChildWindow, hchild);
|
ok(hchild == g_ChildWindow, "We are testing with %p instead of %p\n", g_ChildWindow, hchild);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,11 +121,11 @@ FreeGuarded(
|
||||||
#define TestUserObjectInfoWithString(Handle, Index, Buffer, BufferSize, String) do \
|
#define TestUserObjectInfoWithString(Handle, Index, Buffer, BufferSize, String) do \
|
||||||
{ \
|
{ \
|
||||||
BOOLEAN _Check; \
|
BOOLEAN _Check; \
|
||||||
ULONG SizeOfString = wcslen(String) * sizeof(WCHAR) + sizeof(UNICODE_NULL); \
|
SIZE_T SizeOfString = wcslen(String) * sizeof(WCHAR) + sizeof(UNICODE_NULL); \
|
||||||
TestUserObjectInfo(Handle, Index, NULL, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
|
TestUserObjectInfo(Handle, Index, NULL, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
|
||||||
TestUserObjectInfo(Handle, Index, (PVOID)1, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
|
TestUserObjectInfo(Handle, Index, UlongToPtr(1), 0, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
|
||||||
TestUserObjectInfo(Handle, Index, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET); \
|
TestUserObjectInfo(Handle, Index, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET); \
|
||||||
TestUserObjectInfo(Handle, Index, (PVOID)1, 1, FALSE, ERROR_NOACCESS, NOTSET); \
|
TestUserObjectInfo(Handle, Index, UlongToPtr(1), 1, FALSE, ERROR_NOACCESS, NOTSET); \
|
||||||
RtlFillMemory(Buffer, BufferSize, 0x55); \
|
RtlFillMemory(Buffer, BufferSize, 0x55); \
|
||||||
TestUserObjectInfo(Handle, Index, Buffer, SizeOfString - 2, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
|
TestUserObjectInfo(Handle, Index, Buffer, SizeOfString - 2, FALSE, ERROR_INSUFFICIENT_BUFFER, SizeOfString); \
|
||||||
_Check = CheckBuffer(Buffer, BufferSize, 0x55); \
|
_Check = CheckBuffer(Buffer, BufferSize, 0x55); \
|
||||||
|
@ -168,21 +168,21 @@ TestGetUserObjectInfoW(void)
|
||||||
|
|
||||||
TestUserObjectInfo(NULL, 5, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, 5, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_FLAGS, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_FLAGS, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_FLAGS, (PVOID)1, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_FLAGS, UlongToPtr(1), 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_FLAGS, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(NULL, UOI_FLAGS, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(NULL, UOI_FLAGS, (PVOID)1, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(NULL, UOI_FLAGS, UlongToPtr(1), 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(NULL, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
|
|
||||||
TestUserObjectInfo(NULL, UOI_TYPE, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_TYPE, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_TYPE, (PVOID)1, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_TYPE, UlongToPtr(1), 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_TYPE, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(NULL, UOI_TYPE, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(NULL, UOI_TYPE, (PVOID)1, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(NULL, UOI_TYPE, UlongToPtr(1), 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(NULL, UOI_TYPE, Buffer, BufferSize, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_TYPE, Buffer, BufferSize, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
|
|
||||||
TestUserObjectInfo(NULL, UOI_NAME, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_NAME, NULL, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_NAME, (PVOID)1, 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_NAME, UlongToPtr(1), 0, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
TestUserObjectInfo(NULL, UOI_NAME, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(NULL, UOI_NAME, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(NULL, UOI_NAME, (PVOID)1, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(NULL, UOI_NAME, UlongToPtr(1), 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(NULL, UOI_NAME, Buffer, BufferSize, FALSE, ERROR_INVALID_HANDLE, 0);
|
TestUserObjectInfo(NULL, UOI_NAME, Buffer, BufferSize, FALSE, ERROR_INVALID_HANDLE, 0);
|
||||||
|
|
||||||
Desktop = GetThreadDesktop(GetCurrentThreadId());
|
Desktop = GetThreadDesktop(GetCurrentThreadId());
|
||||||
|
@ -203,9 +203,9 @@ TestGetUserObjectInfoW(void)
|
||||||
|
|
||||||
TestUserObjectInfo(Desktop, 5, NULL, 0, FALSE, ERROR_INVALID_PARAMETER, 0);
|
TestUserObjectInfo(Desktop, 5, NULL, 0, FALSE, ERROR_INVALID_PARAMETER, 0);
|
||||||
TestUserObjectInfo(Desktop, UOI_FLAGS, NULL, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(USEROBJECTFLAGS));
|
TestUserObjectInfo(Desktop, UOI_FLAGS, NULL, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(USEROBJECTFLAGS));
|
||||||
TestUserObjectInfo(Desktop, UOI_FLAGS, (PVOID)1, 0, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(USEROBJECTFLAGS));
|
TestUserObjectInfo(Desktop, UOI_FLAGS, UlongToPtr(1), 0, FALSE, ERROR_INSUFFICIENT_BUFFER, sizeof(USEROBJECTFLAGS));
|
||||||
TestUserObjectInfo(Desktop, UOI_FLAGS, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(Desktop, UOI_FLAGS, NULL, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(Desktop, UOI_FLAGS, (PVOID)1, 1, FALSE, ERROR_NOACCESS, NOTSET);
|
TestUserObjectInfo(Desktop, UOI_FLAGS, UlongToPtr(1), 1, FALSE, ERROR_NOACCESS, NOTSET);
|
||||||
TestUserObjectInfo(Desktop, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), TRUE, 0xdeadbeef, sizeof(USEROBJECTFLAGS));
|
TestUserObjectInfo(Desktop, UOI_FLAGS, &UserObjectFlags, sizeof(UserObjectFlags), TRUE, 0xdeadbeef, sizeof(USEROBJECTFLAGS));
|
||||||
|
|
||||||
TestUserObjectInfoWithString(Desktop, UOI_TYPE, Buffer, BufferSize, L"Desktop");
|
TestUserObjectInfoWithString(Desktop, UOI_TYPE, Buffer, BufferSize, L"Desktop");
|
||||||
|
|
|
@ -36,16 +36,16 @@ START_TEST(PrivateExtractIcons)
|
||||||
for (i = 0; i < _countof(IconTests); ++i)
|
for (i = 0; i < _countof(IconTests); ++i)
|
||||||
{
|
{
|
||||||
/* Always test extraction of the FIRST icon (index 0) */
|
/* Always test extraction of the FIRST icon (index 0) */
|
||||||
ahIcon = (HICON)0xdeadbeef;
|
ahIcon = (HICON)UlongToHandle(0xdeadbeef);
|
||||||
aIconId = 0xdeadbeef;
|
aIconId = 0xdeadbeef;
|
||||||
cIcons = PrivateExtractIconsW(IconTests[i].FilePath, 0, 16, 16, &ahIcon, &aIconId, 1, 0);
|
cIcons = PrivateExtractIconsW(IconTests[i].FilePath, 0, 16, 16, &ahIcon, &aIconId, 1, 0);
|
||||||
ok(cIcons == IconTests[i].cIcons, "PrivateExtractIconsW(%u): got %u, expected %u\n", i, cIcons, IconTests[i].cIcons);
|
ok(cIcons == IconTests[i].cIcons, "PrivateExtractIconsW(%u): got %u, expected %u\n", i, cIcons, IconTests[i].cIcons);
|
||||||
ok(ahIcon != (HICON)0xdeadbeef, "PrivateExtractIconsW(%u): icon not set\n", i);
|
ok(ahIcon != (HICON)UlongToHandle(0xdeadbeef), "PrivateExtractIconsW(%u): icon not set\n", i);
|
||||||
ok((IconTests[i].bhIconValid && ahIcon) || (!IconTests[i].bhIconValid && !ahIcon),
|
ok((IconTests[i].bhIconValid && ahIcon) || (!IconTests[i].bhIconValid && !ahIcon),
|
||||||
"PrivateExtractIconsW(%u): icon expected to be %s, but got 0x%p\n",
|
"PrivateExtractIconsW(%u): icon expected to be %s, but got 0x%p\n",
|
||||||
i, IconTests[i].bhIconValid ? "valid" : "not valid", ahIcon);
|
i, IconTests[i].bhIconValid ? "valid" : "not valid", ahIcon);
|
||||||
ok(aIconId != 0xdeadbeef, "PrivateExtractIconsW(%u): id not set\n", i);
|
ok(aIconId != 0xdeadbeef, "PrivateExtractIconsW(%u): id not set\n", i);
|
||||||
if (ahIcon && ahIcon != (HICON)0xdeadbeef)
|
if (ahIcon && ahIcon != (HICON)UlongToHandle(0xdeadbeef))
|
||||||
DestroyIcon(ahIcon);
|
DestroyIcon(ahIcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,8 +193,8 @@ TestRecursiveInterThreadMessages(
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
DWORD ExitCode;
|
DWORD ExitCode;
|
||||||
|
|
||||||
Parameter = (PVOID)((KillThread1 ? KILL_THREAD1_FLAG : 0) |
|
Parameter = UlongToPtr((KillThread1 ? KILL_THREAD1_FLAG : 0) |
|
||||||
(KillThread2 ? KILL_THREAD2_FLAG : 0));
|
(KillThread2 ? KILL_THREAD2_FLAG : 0));
|
||||||
hThread1 = CreateThread(NULL, 0, Thread1, Parameter, CREATE_SUSPENDED, &dwThread1);
|
hThread1 = CreateThread(NULL, 0, Thread1, Parameter, CREATE_SUSPENDED, &dwThread1);
|
||||||
hThread2 = CreateThread(NULL, 0, Thread2, Parameter, CREATE_SUSPENDED, &dwThread2);
|
hThread2 = CreateThread(NULL, 0, Thread2, Parameter, CREATE_SUSPENDED, &dwThread2);
|
||||||
|
|
||||||
|
|
|
@ -140,34 +140,34 @@ static void Test_MouseSpeed()
|
||||||
ok(ulMouseSpeed >= 1 && ulMouseSpeed <=20, "Wrong mouse speed (%d)\n", (int)ulMouseSpeed);
|
ok(ulMouseSpeed >= 1 && ulMouseSpeed <=20, "Wrong mouse speed (%d)\n", (int)ulMouseSpeed);
|
||||||
|
|
||||||
temp = 1;
|
temp = 1;
|
||||||
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)temp, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, UlongToPtr(temp), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
ok(temp == 1, "SPI_GETMOUSESPEED did not get value set by SPI_SETMOUSESPEED (%d instead of 1)\n", (int)temp);
|
ok(temp == 1, "SPI_GETMOUSESPEED did not get value set by SPI_SETMOUSESPEED (%d instead of 1)\n", (int)temp);
|
||||||
|
|
||||||
temp = 20;
|
temp = 20;
|
||||||
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)temp, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, UlongToPtr(temp), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
ok(temp == 20, "SPI_GETMOUSESPEED did not get value set by SPI_SETMOUSESPEED (%d instead of 20)\n", (int)temp);
|
ok(temp == 20, "SPI_GETMOUSESPEED did not get value set by SPI_SETMOUSESPEED (%d instead of 20)\n", (int)temp);
|
||||||
|
|
||||||
temp = 21;
|
temp = 21;
|
||||||
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)temp, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, UlongToPtr(temp), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||||
ok(!ret, "expected SystemParametersInfo to fail\n");
|
ok(!ret, "expected SystemParametersInfo to fail\n");
|
||||||
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
ok(temp == 20, "SPI_GETMOUSESPEED got unexpected value (%d instead of 20)\n", (int)temp);
|
ok(temp == 20, "SPI_GETMOUSESPEED got unexpected value (%d instead of 20)\n", (int)temp);
|
||||||
|
|
||||||
temp = 0;
|
temp = 0;
|
||||||
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)temp, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, UlongToPtr(temp), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||||
ok(!ret, "expected SystemParametersInfo to fail\n");
|
ok(!ret, "expected SystemParametersInfo to fail\n");
|
||||||
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
ok(temp == 20, "SPI_GETMOUSESPEED got unexpected value (%d instead of 20)\n", (int)temp);
|
ok(temp == 20, "SPI_GETMOUSESPEED got unexpected value (%d instead of 20)\n", (int)temp);
|
||||||
|
|
||||||
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)ulMouseSpeed, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, UlongToPtr(ulMouseSpeed), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||||
ok(ret, "SystemParametersInfo failed\n");
|
ok(ret, "SystemParametersInfo failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ printMixerLine(LPMIXERLINEW MixerLine, IN ULONG MixerIndex)
|
||||||
MixerLineControls.cbmxctrl= sizeof(MIXERCONTROLW);
|
MixerLineControls.cbmxctrl= sizeof(MIXERCONTROLW);
|
||||||
MixerLineControls.pamxctrl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MixerLineControls.cControls * sizeof(MIXERCONTROLW));
|
MixerLineControls.pamxctrl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MixerLineControls.cControls * sizeof(MIXERCONTROLW));
|
||||||
|
|
||||||
Result = mixerGetLineControlsW((HMIXEROBJ)MixerIndex, &MixerLineControls, MIXER_GETLINECONTROLSF_ALL | MIXER_OBJECTF_MIXER);
|
Result = mixerGetLineControlsW((HMIXEROBJ)UlongToHandle(MixerIndex), &MixerLineControls, MIXER_GETLINECONTROLSF_ALL | MIXER_OBJECTF_MIXER);
|
||||||
|
|
||||||
printf("Result %u\n", Result);
|
printf("Result %u\n", Result);
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ printMixerLine(LPMIXERLINEW MixerLine, IN ULONG MixerIndex)
|
||||||
MixerControlDetails.dwControlID = MixerLineControls.pamxctrl[Index].dwControlID;
|
MixerControlDetails.dwControlID = MixerLineControls.pamxctrl[Index].dwControlID;
|
||||||
MixerControlDetails.paDetails = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MixerControlDetails.cbDetails * MixerControlDetails.cChannels * MixerControlDetails.cMultipleItems);
|
MixerControlDetails.paDetails = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MixerControlDetails.cbDetails * MixerControlDetails.cChannels * MixerControlDetails.cMultipleItems);
|
||||||
|
|
||||||
Result = mixerGetControlDetailsW((HMIXEROBJ)MixerIndex, &MixerControlDetails, MIXER_GETCONTROLDETAILSF_LISTTEXT | MIXER_OBJECTF_MIXER);
|
Result = mixerGetControlDetailsW((HMIXEROBJ)UlongToHandle(MixerIndex), &MixerControlDetails, MIXER_GETCONTROLDETAILSF_LISTTEXT | MIXER_OBJECTF_MIXER);
|
||||||
|
|
||||||
printf("Result %x\n", Result);
|
printf("Result %x\n", Result);
|
||||||
ListText = (LPMIXERCONTROLDETAILS_LISTTEXTW)MixerControlDetails.paDetails;
|
ListText = (LPMIXERCONTROLDETAILS_LISTTEXTW)MixerControlDetails.paDetails;
|
||||||
|
@ -190,7 +190,7 @@ test();
|
||||||
DstMixerLine.dwDestination = DestinationIndex;
|
DstMixerLine.dwDestination = DestinationIndex;
|
||||||
DstMixerLine.cbStruct = sizeof(DstMixerLine);
|
DstMixerLine.cbStruct = sizeof(DstMixerLine);
|
||||||
|
|
||||||
Result = mixerGetLineInfoW((HMIXEROBJ)MixerIndex, &DstMixerLine, MIXER_GETLINEINFOF_DESTINATION | MIXER_OBJECTF_MIXER);
|
Result = mixerGetLineInfoW((HMIXEROBJ)UlongToHandle(MixerIndex), &DstMixerLine, MIXER_GETLINEINFOF_DESTINATION | MIXER_OBJECTF_MIXER);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Destination Index %lu\n", DestinationIndex);
|
printf("Destination Index %lu\n", DestinationIndex);
|
||||||
printMixerLine(&DstMixerLine, MixerIndex);
|
printMixerLine(&DstMixerLine, MixerIndex);
|
||||||
|
@ -201,7 +201,7 @@ test();
|
||||||
SrcLine.dwSource = SrcIndex;
|
SrcLine.dwSource = SrcIndex;
|
||||||
SrcLine.cbStruct = sizeof(SrcLine);
|
SrcLine.cbStruct = sizeof(SrcLine);
|
||||||
|
|
||||||
Result = mixerGetLineInfoW((HMIXEROBJ)MixerIndex, &SrcLine, MIXER_GETLINEINFOF_SOURCE | MIXER_OBJECTF_MIXER);
|
Result = mixerGetLineInfoW((HMIXEROBJ)UlongToHandle(MixerIndex), &SrcLine, MIXER_GETLINEINFOF_SOURCE | MIXER_OBJECTF_MIXER);
|
||||||
|
|
||||||
if (Result == MMSYSERR_NOERROR)
|
if (Result == MMSYSERR_NOERROR)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
|
|
||||||
add_definitions(-D__ROS_LONG64__)
|
add_definitions(-D__ROS_LONG64__)
|
||||||
|
|
||||||
|
if (MSVC AND ARCH STREQUAL "amd64")
|
||||||
|
add_compile_flags("/wd4312")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(advapi32)
|
add_subdirectory(advapi32)
|
||||||
add_subdirectory(advpack)
|
add_subdirectory(advpack)
|
||||||
add_subdirectory(amstream)
|
add_subdirectory(amstream)
|
||||||
|
|
|
@ -8,7 +8,6 @@ list(APPEND SOURCE
|
||||||
directory.c
|
directory.c
|
||||||
env.c
|
env.c
|
||||||
error.c
|
error.c
|
||||||
exception.c
|
|
||||||
file.c
|
file.c
|
||||||
info.c
|
info.c
|
||||||
large_int.c
|
large_int.c
|
||||||
|
@ -26,7 +25,9 @@ list(APPEND SOURCE
|
||||||
precomp.h)
|
precomp.h)
|
||||||
|
|
||||||
if(ARCH STREQUAL "i386")
|
if(ARCH STREQUAL "i386")
|
||||||
list(APPEND SOURCE generated.c)
|
list(APPEND SOURCE
|
||||||
|
exception.c
|
||||||
|
generated.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(ntdll_winetest ${SOURCE} testlist.c)
|
add_executable(ntdll_winetest ${SOURCE} testlist.c)
|
||||||
|
|
|
@ -32,7 +32,9 @@ const struct test winetest_testlist[] =
|
||||||
{ "directory", func_directory },
|
{ "directory", func_directory },
|
||||||
{ "env", func_env },
|
{ "env", func_env },
|
||||||
{ "error", func_error },
|
{ "error", func_error },
|
||||||
|
#ifdef _M_IX86
|
||||||
{ "exception", func_exception },
|
{ "exception", func_exception },
|
||||||
|
#endif
|
||||||
{ "file", func_file },
|
{ "file", func_file },
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
{ "generated", func_generated },
|
{ "generated", func_generated },
|
||||||
|
|
Loading…
Reference in a new issue