Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/winspool.drv/tests/info.c | 46 ++++++++++++++--------------------
1 file changed, 19 insertions(+), 27 deletions(-)
diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c
index 53aa67ba036..56d73798538 100644
--- a/dlls/winspool.drv/tests/info.c
+++ b/dlls/winspool.drv/tests/info.c
@@ -56,16 +56,6 @@ static CHAR version_dll[] = "version.dll";
static CHAR winetest[] = "winetest";
static CHAR xcv_localport[] = ",XcvMonitor Local Port";
-static const WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0};
-static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0};
-static WCHAR emptyW[] = {0};
-
-static WCHAR portname_com1W[] = {'C','O','M','1',':',0};
-static WCHAR portname_com2W[] = {'C','O','M','2',':',0};
-static WCHAR portname_fileW[] = {'F','I','L','E',':',0};
-static WCHAR portname_lpt1W[] = {'L','P','T','1',':',0};
-static WCHAR portname_lpt2W[] = {'L','P','T','2',':',0};
-
static HANDLE hwinspool;
static BOOL (WINAPI * pAddPortExA)(LPSTR, DWORD, LPBYTE, LPSTR);
static BOOL (WINAPI * pEnumPrinterDriversW)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
@@ -2088,7 +2078,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, NULL, 0, &needed, &status);
ok( res && (status == ERROR_INSUFFICIENT_BUFFER) && (needed <= MAX_PATH),
"returned %d with %u and %u for status %u (expected '!= 0' and "
"'<= MAX_PATH' for status ERROR_INSUFFICIENT_BUFFER)\n",
@@ -2105,7 +2095,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, emptyW, NULL, 0, NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"", NULL, 0, NULL, 0, &needed, &status);
ok( res && (status == ERROR_INVALID_PARAMETER),
"returned %d with %u and %u for status %u (expected '!= 0' with "
"ERROR_INVALID_PARAMETER)\n", res, GetLastError(), needed, status);
@@ -2122,7 +2112,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len, NULL, &status);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, buffer, len, NULL, &status);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"returned %d with %u and %u for status %u (expected '0' with "
"ERROR_INVALID_PARAMETER)\n", res, GetLastError(), needed, status);
@@ -2130,7 +2120,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, NULL, len, &needed, &status);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, NULL, len, &needed, &status);
ok( !res && (GetLastError() == RPC_X_NULL_REF_POINTER),
"returned %d with %u and %u for status %u (expected '0' with "
"RPC_X_NULL_REF_POINTER)\n", res, GetLastError(), needed, status);
@@ -2138,7 +2128,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len, &needed, NULL);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, buffer, len, &needed, NULL);
ok( !res && (GetLastError() == RPC_X_NULL_REF_POINTER),
"returned %d with %u and %u for status %u (expected '0' with "
"RPC_X_NULL_REF_POINTER)\n", res, GetLastError(), needed, status);
@@ -2147,7 +2137,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len+1, &needed, &status);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, buffer, len+1, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' for status "
"ERROR_SUCCESS)\n", res, GetLastError(), needed, status);
@@ -2157,7 +2147,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len-1, &needed, &status);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, buffer, len-1, &needed, &status);
ok( res && (status == ERROR_INSUFFICIENT_BUFFER),
"returned %d with %u and %u for status %u (expected '!= 0' for status "
"ERROR_INSUFFICIENT_BUFFER)\n", res, GetLastError(), needed, status);
@@ -2168,7 +2158,7 @@ static void test_XcvDataW_MonitorUI(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_MonitorUIW, NULL, 0, buffer, len, &needed, &status);
+ res = pXcvDataW(hXcv, L"MonitorUI", NULL, 0, buffer, len, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' for status "
"ERROR_SUCCESS)\n", res, GetLastError(), needed, status);
@@ -2207,7 +2197,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, NULL, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"LPT1:", sizeof(L"LPT1:"), NULL, 0, NULL, &status);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"returned %d with %u and %u for status %u (expected '!= 0' with ERROR_INVALID_PARAMETER)\n",
res, GetLastError(), needed, status);
@@ -2216,7 +2206,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) emptyW, sizeof(emptyW), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"", sizeof(L""), NULL, 0, &needed, &status);
ok( res && ((status == ERROR_FILE_NOT_FOUND) || (status == ERROR_PATH_NOT_FOUND)),
"returned %d with %u and %u for status %u (expected '!= 0' for status: "
"ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND)\n",
@@ -2226,7 +2216,8 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) tempdirW, (lstrlenW(tempdirW) + 1) * sizeof(WCHAR), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) tempdirW, (lstrlenW(tempdirW) + 1) * sizeof(WCHAR),
+ NULL, 0, &needed, &status);
/* XP: ERROR_PATH_NOT_FOUND, w2k ERROR_ACCESS_DENIED */
ok( res && ((status == ERROR_PATH_NOT_FOUND) || (status == ERROR_ACCESS_DENIED)),
"returned %d with %u and %u for status %u (expected '!= 0' for status: "
@@ -2237,7 +2228,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"LPT1:", sizeof(L"LPT1:"), NULL, 0, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
res, GetLastError(), needed, status);
@@ -2245,7 +2236,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt2W, sizeof(portname_lpt2W), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"LPT2:", sizeof(L"LPT2:"), NULL, 0, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
res, GetLastError(), needed, status);
@@ -2253,7 +2244,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) portname_com1W, sizeof(portname_com1W), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"COM1:", sizeof(L"COM1:"), NULL, 0, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
res, GetLastError(), needed, status);
@@ -2261,7 +2252,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) portname_com2W, sizeof(portname_com2W), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"COM2:", sizeof(L"COM2:"), NULL, 0, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' for ERROR_SUCCESS)\n",
res, GetLastError(), needed, status);
@@ -2269,7 +2260,7 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) portname_fileW, sizeof(portname_fileW), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) L"FILE:", sizeof(L"FILE:"), NULL, 0, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' with ERROR_SUCCESS)\n",
res, GetLastError(), needed, status);
@@ -2279,7 +2270,8 @@ static void test_XcvDataW_PortIsValid(void)
needed = (DWORD) 0xdeadbeef;
status = (DWORD) 0xdeadbeef;
SetLastError(0xdeadbeef);
- res = pXcvDataW(hXcv, cmd_PortIsValidW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, &needed, &status);
+ res = pXcvDataW(hXcv, L"PortIsValid", (BYTE *) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR),
+ NULL, 0, &needed, &status);
ok( res && (status == ERROR_SUCCESS),
"returned %d with %u and %u for status %u (expected '!= 0' with ERROR_SUCCESS)\n",
res, GetLastError(), needed, status);
--
2.26.2