mirror of
https://github.com/reactos/wine.git
synced 2025-01-19 18:24:48 +00:00
ntprint: PSetupCreateMonitorInfo() takes two arguments, the second is a server name.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a0e73a1fb3
commit
152b240153
@ -65,18 +65,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
*
|
||||
*/
|
||||
|
||||
HANDLE WINAPI PSetupCreateMonitorInfo(LPVOID unknown1, LPVOID unknown2,LPVOID unknown3)
|
||||
HANDLE WINAPI PSetupCreateMonitorInfo(DWORD unknown1, WCHAR *server)
|
||||
{
|
||||
monitorinfo_t * mi=NULL;
|
||||
DWORD needed;
|
||||
DWORD res;
|
||||
|
||||
TRACE("(%p, %p, %p)\n", unknown1, unknown2, unknown3);
|
||||
|
||||
if ((unknown2 != NULL) || (unknown3 != NULL)) {
|
||||
FIXME("got unknown parameter: (%p, %p, %p)\n", unknown1, unknown2, unknown3);
|
||||
return NULL;
|
||||
}
|
||||
TRACE("(%d, %s)\n", unknown1, debugstr_w(server));
|
||||
|
||||
mi = HeapAlloc(GetProcessHeap(), 0, sizeof(monitorinfo_t));
|
||||
if (!mi) {
|
||||
@ -85,15 +80,14 @@ HANDLE WINAPI PSetupCreateMonitorInfo(LPVOID unknown1, LPVOID unknown2,LPVOID u
|
||||
}
|
||||
|
||||
/* Get the needed size for all Monitors */
|
||||
res = EnumMonitorsW(NULL, 2, NULL, 0, &needed, &mi->installed);
|
||||
res = EnumMonitorsW(server, 2, NULL, 0, &needed, &mi->installed);
|
||||
if (!res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
|
||||
mi->mi2 = HeapAlloc(GetProcessHeap(), 0, needed);
|
||||
res = EnumMonitorsW(NULL, 2, (LPBYTE) mi->mi2, needed, &needed, &mi->installed);
|
||||
res = EnumMonitorsW(server, 2, (LPBYTE) mi->mi2, needed, &needed, &mi->installed);
|
||||
}
|
||||
|
||||
if (!res) {
|
||||
HeapFree(GetProcessHeap(), 0, mi);
|
||||
/* FIXME: SetLastError() needed? */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
@ stub PSetupAssociateICMProfiles
|
||||
@ stub PSetupBuildDriversFromPath
|
||||
@ stub PSetupCreateDrvSetupPage
|
||||
@ stdcall PSetupCreateMonitorInfo(long ptr ptr)
|
||||
@ stdcall PSetupCreateMonitorInfo(long wstr)
|
||||
@ stub PSetupCreatePrinterDeviceInfoList
|
||||
@ stub PSetupDestroyDriverInfo3
|
||||
@ stdcall PSetupDestroyMonitorInfo(long)
|
||||
|
@ -32,7 +32,7 @@
|
||||
/* ##### */
|
||||
|
||||
static HMODULE hdll;
|
||||
static HANDLE (WINAPI *pPSetupCreateMonitorInfo)(LPVOID, LPVOID, LPVOID);
|
||||
static HANDLE (WINAPI *pPSetupCreateMonitorInfo)(DWORD, const WCHAR *);
|
||||
static VOID (WINAPI *pPSetupDestroyMonitorInfo)(HANDLE);
|
||||
static BOOL (WINAPI *pPSetupEnumMonitor)(HANDLE, DWORD, LPWSTR, LPDWORD);
|
||||
|
||||
@ -66,10 +66,12 @@ static LPCSTR load_functions(void)
|
||||
static void test_PSetupCreateMonitorInfo(VOID)
|
||||
{
|
||||
HANDLE mi;
|
||||
BYTE buffer[1024] ;
|
||||
WCHAR buffer[1024] = {'\\','\\'};
|
||||
UINT len = sizeof(buffer) / sizeof(buffer[0]) - 2;
|
||||
GetComputerNameW(buffer + 2, &len);
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
mi = pPSetupCreateMonitorInfo(NULL, NULL, NULL);
|
||||
mi = pPSetupCreateMonitorInfo(0, NULL);
|
||||
if (!mi && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) {
|
||||
win_skip("The service 'Spooler' is required for many tests\n");
|
||||
return;
|
||||
@ -77,13 +79,18 @@ static void test_PSetupCreateMonitorInfo(VOID)
|
||||
ok( mi != NULL, "got %p with %u (expected '!= NULL')\n", mi, GetLastError());
|
||||
if (mi) pPSetupDestroyMonitorInfo(mi);
|
||||
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
SetLastError(0xdeadbeef);
|
||||
mi = pPSetupCreateMonitorInfo(buffer, NULL, NULL);
|
||||
mi = pPSetupCreateMonitorInfo(0, buffer);
|
||||
ok( mi != NULL, "got %p with %u (expected '!= NULL')\n", mi, GetLastError());
|
||||
if (mi) pPSetupDestroyMonitorInfo(mi);
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
mi = pPSetupCreateMonitorInfo(0, buffer + 1);
|
||||
todo_wine {
|
||||
ok( mi == NULL, "got %p\n", mi );
|
||||
ok( GetLastError() == ERROR_INVALID_NAME, "got %d\n", GetLastError() );
|
||||
}
|
||||
if (mi) pPSetupDestroyMonitorInfo(mi);
|
||||
}
|
||||
|
||||
/* ########################### */
|
||||
@ -99,7 +106,7 @@ static void test_PSetupDestroyMonitorInfo(VOID)
|
||||
trace("returned with %u\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
mi = pPSetupCreateMonitorInfo(NULL, NULL, NULL);
|
||||
mi = pPSetupCreateMonitorInfo(0, NULL);
|
||||
if (!mi && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) {
|
||||
win_skip("The service 'Spooler' is required for many tests\n");
|
||||
return;
|
||||
@ -134,7 +141,7 @@ static void test_PSetupEnumMonitor(VOID)
|
||||
DWORD index=0;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
mi = pPSetupCreateMonitorInfo(NULL, NULL, NULL);
|
||||
mi = pPSetupCreateMonitorInfo(0, NULL);
|
||||
if (!mi) {
|
||||
skip("PSetupCreateMonitorInfo\n");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user