Takze se vola fce NtUserGetObjectInformation v wine-10.0/dlls/win32u/winstation.c. Trochu bych ji prospikoval logovanim, abychom vedeli, ze se vraci.
Kód: Vybrat vše
/***********************************************************************
* NtUserGetObjectInformation (win32u.@)
*/
BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info,
DWORD len, DWORD *needed )
{
BOOL ret;
static const WCHAR desktopW[] = {'D','e','s','k','t','o','p',0};
static const WCHAR window_stationW[] = {'W','i','n','d','o','w','S','t','a','t','i','o','n',0};
MESSAGE("pokus set_user_object_info winstation 1\n");
switch(index)
{
case UOI_FLAGS:
{
USEROBJECTFLAGS *obj_flags = info;
if (needed) *needed = sizeof(*obj_flags);
if (len < sizeof(*obj_flags))
{
RtlSetLastWin32Error( ERROR_BUFFER_OVERFLOW );
return FALSE;
}
SERVER_START_REQ( set_user_object_info )
{
req->handle = wine_server_obj_handle( handle );
req->flags = 0;
ret = !wine_server_call_err( req );
if (ret)
{
/* FIXME: inherit flag */
obj_flags->dwFlags = reply->old_obj_flags;
}
}
SERVER_END_REQ;
}
MESSAGE("pokus NtUserGetObjectInformation 1\n");
return ret;
case UOI_TYPE:
SERVER_START_REQ( set_user_object_info )
{
req->handle = wine_server_obj_handle( handle );
req->flags = 0;
ret = !wine_server_call_err( req );
if (ret)
{
size_t size = reply->is_desktop ? sizeof(desktopW) : sizeof(window_stationW);
if (needed) *needed = size;
if (len < size)
{
RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER );
ret = FALSE;
}
else memcpy( info, reply->is_desktop ? desktopW : window_stationW, size );
}
}
SERVER_END_REQ;
MESSAGE("pokus NtUserGetObjectInformation 2\n");
return ret;
case UOI_NAME:
{
WCHAR buffer[MAX_PATH];
SERVER_START_REQ( set_user_object_info )
{
req->handle = wine_server_obj_handle( handle );
req->flags = 0;
wine_server_set_reply( req, buffer, sizeof(buffer) - sizeof(WCHAR) );
ret = !wine_server_call_err( req );
if (ret)
{
size_t size = wine_server_reply_size( reply );
buffer[size / sizeof(WCHAR)] = 0;
size += sizeof(WCHAR);
if (needed) *needed = size;
if (len < size)
{
RtlSetLastWin32Error( ERROR_INSUFFICIENT_BUFFER );
ret = FALSE;
}
else memcpy( info, buffer, size );
}
}
SERVER_END_REQ;
}
MESSAGE("pokus NtUserGetObjectInformation 3\n");
return ret;
case UOI_USER_SID:
FIXME( "not supported index %d\n", index );
/* fall through */
default:
RtlSetLastWin32Error( ERROR_INVALID_PARAMETER );
MESSAGE("pokus NtUserGetObjectInformation 4\n");
return FALSE;
}
}
A zalogovat par mist, odkud se to muze volat. Treba v wine-10.0/dlls/user32/winstation.c:
Kód: Vybrat vše
/***********************************************************************
* GetUserObjectInformationA (USER32.@)
*/
BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DWORD len, LPDWORD needed )
{
MESSAGE("pokus NtUserGetObjectInformation user32 winstation\n");
/* check for information types returning strings */
if (index == UOI_TYPE || index == UOI_NAME)
{
WCHAR buffer[MAX_PATH];
DWORD lenA, lenW;
if (!NtUserGetObjectInformation( handle, index, buffer, sizeof(buffer), &lenW )) return FALSE;
lenA = WideCharToMultiByte( CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL );
if (needed) *needed = lenA;
if (lenA > len)
{
/* If the buffer length supplied by the caller is insufficient, Windows returns a
'needed' length based upon the Unicode byte length, so we should do similarly. */
if (needed) *needed = lenW;
SetLastError( ERROR_INSUFFICIENT_BUFFER );
return FALSE;
}
if (info) WideCharToMultiByte( CP_ACP, 0, buffer, -1, info, len, NULL, NULL );
return TRUE;
}
return NtUserGetObjectInformation( handle, index, info, len, needed );
}
A treba wine-10.0/dlls/win32u/sysparams.c:
Kód: Vybrat vše
static BOOL lock_display_devices( BOOL force )
{
static const WCHAR wine_service_station_name[] =
{'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n',0};
struct device_manager_ctx ctx = {.vulkan_gpus = LIST_INIT(ctx.vulkan_gpus)};
UINT64 serial;
UINT status;
WCHAR name[MAX_PATH];
BOOL ret = TRUE;
init_display_driver(); /* make sure to load the driver before anything else */
pthread_mutex_lock( &display_lock );
serial = get_monitor_update_serial();
if (!force && monitor_update_serial >= serial) return TRUE;
/* services do not have any adapters, only a virtual monitor */
MESSAGE("pokus NtUserGetObjectInformation sysparams\n");
if (NtUserGetObjectInformation( NtUserGetProcessWindowStation(), UOI_NAME, name, sizeof(name), NULL )
&& !wcscmp( name, wine_service_station_name ))
{
clear_display_devices();
list_add_tail( &monitors, &virtual_monitor.entry );
set_winstation_monitors( TRUE );
return TRUE;
}
if (!force && !update_display_cache_from_registry( serial )) force = TRUE;
if (force)
{
if (!get_vulkan_gpus( &ctx.vulkan_gpus )) WARN( "Failed to find any vulkan GPU\n" );
if (!(status = update_display_devices( &ctx ))) commit_display_devices( &ctx );
else WARN( "Failed to update display devices, status %#x\n", status );
release_display_manager_ctx( &ctx );
ret = update_display_cache_from_registry( serial );
}
if (!ret)
{
ERR( "Failed to read display config.\n" );
pthread_mutex_unlock( &display_lock );
}
return ret;
}
A jeste wine-10.0/dlls/win32u/driver.c:
Kód: Vybrat vše
static void load_display_driver(void)
{
USEROBJECTFLAGS flags;
HWINSTA winstation;
if (!load_desktop_driver( get_desktop_window() ) || user_driver == &lazy_load_driver)
{
winstation = NtUserGetProcessWindowStation();
MESSAGE("pokus NtUserGetObjectInformation driver\n");
if (!NtUserGetObjectInformation( winstation, UOI_FLAGS, &flags, sizeof(flags), NULL )
|| (flags.dwFlags & WSF_VISIBLE))
null_user_driver.pCreateWindow = nodrv_CreateWindow;
__wine_set_user_driver( &null_user_driver, WINE_GDI_DRIVER_VERSION );
}
}
A asi posledni wine-10.0/dlls/win32u/winstation.c:
Kód: Vybrat vše
HWND get_desktop_window(void)
{
static const WCHAR wine_service_station_name[] =
{'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n',0};
struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
WCHAR name[MAX_PATH];
BOOL is_service;
if (thread_info->top_window) return UlongToHandle( thread_info->top_window );
/* don't create an actual explorer desktop window for services */
MESSAGE("pokus NtUserGetObjectInformation win32u winstation\n");
if (NtUserGetObjectInformation( NtUserGetProcessWindowStation(), UOI_NAME, name, sizeof(name), NULL )
&& !wcscmp( name, wine_service_station_name ))
is_service = TRUE;
else
is_service = FALSE;
...
≠