wineboot: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-07 08:40:25 +01:00 committed by Alexandre Julliard
parent be493aa6ab
commit a6cf9e57d3
3 changed files with 25 additions and 26 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = wineboot.exe MODULE = wineboot.exe
IMPORTS = uuid advapi32 ws2_32 kernelbase IMPORTS = uuid advapi32 ws2_32 kernelbase
DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev

View File

@ -96,7 +96,7 @@ static void CALLBACK end_session_message_callback( HWND hwnd, UINT msg, ULONG_PT
{ {
struct callback_data *cb_data = (struct callback_data *)data; struct callback_data *cb_data = (struct callback_data *)data;
WINE_TRACE( "received response %s hwnd %p lresult %ld\n", WINE_TRACE( "received response %s hwnd %p lresult %Id\n",
msg == WM_QUERYENDSESSION ? "WM_QUERYENDSESSION" : (msg == WM_ENDSESSION ? "WM_ENDSESSION" : "Unknown"), msg == WM_QUERYENDSESSION ? "WM_QUERYENDSESSION" : (msg == WM_ENDSESSION ? "WM_ENDSESSION" : "Unknown"),
hwnd, lresult ); hwnd, lresult );
@ -143,7 +143,7 @@ static INT_PTR CALLBACK endtask_dlg_proc( HWND hwnd, UINT msg, WPARAM wparam, LP
handle = OpenProcess( PROCESS_TERMINATE, FALSE, data->win[0].pid ); handle = OpenProcess( PROCESS_TERMINATE, FALSE, data->win[0].pid );
if (handle) if (handle)
{ {
WINE_TRACE( "terminating process %04x\n", data->win[0].pid ); WINE_TRACE( "terminating process %04lx\n", data->win[0].pid );
TerminateProcess( handle, 0 ); TerminateProcess( handle, 0 );
CloseHandle( handle ); CloseHandle( handle );
data->terminated = TRUE; data->terminated = TRUE;
@ -297,7 +297,7 @@ static DWORD_PTR send_end_session_messages( struct window_info *win, UINT count,
HANDLE handle = OpenProcess( PROCESS_TERMINATE, FALSE, win[0].pid ); HANDLE handle = OpenProcess( PROCESS_TERMINATE, FALSE, win[0].pid );
if (handle) if (handle)
{ {
WINE_TRACE( "terminating process %04x\n", win[0].pid ); WINE_TRACE( "terminating process %04lx\n", win[0].pid );
TerminateProcess( handle, 0 ); TerminateProcess( handle, 0 );
CloseHandle( handle ); CloseHandle( handle );
} }
@ -341,14 +341,14 @@ static BOOL CALLBACK shutdown_one_desktop( LPWSTR name, LPARAM force )
hdesk = OpenDesktopW( name, 0, FALSE, GENERIC_ALL ); hdesk = OpenDesktopW( name, 0, FALSE, GENERIC_ALL );
if (hdesk == NULL) if (hdesk == NULL)
{ {
WINE_ERR("Cannot open desktop %s, err=%i\n", wine_dbgstr_w(name), GetLastError()); WINE_ERR("Cannot open desktop %s, err=%li\n", wine_dbgstr_w(name), GetLastError());
return FALSE; return FALSE;
} }
if (!SetThreadDesktop( hdesk )) if (!SetThreadDesktop( hdesk ))
{ {
CloseDesktop( hdesk ); CloseDesktop( hdesk );
WINE_ERR("Cannot set thread desktop %s, err=%i\n", wine_dbgstr_w(name), GetLastError()); WINE_ERR("Cannot set thread desktop %s, err=%li\n", wine_dbgstr_w(name), GetLastError());
return FALSE; return FALSE;
} }
@ -391,7 +391,7 @@ void kill_processes( BOOL kill_desktop )
{ {
if (process.th32ProcessID == GetCurrentProcessId()) continue; if (process.th32ProcessID == GetCurrentProcessId()) continue;
if (process.th32ProcessID == desktop_pid) continue; if (process.th32ProcessID == desktop_pid) continue;
WINE_TRACE("killing process %04x %s\n", WINE_TRACE("killing process %04lx %s\n",
process.th32ProcessID, wine_dbgstr_w(process.szExeFile) ); process.th32ProcessID, wine_dbgstr_w(process.szExeFile) );
if (!(handle = OpenProcess( PROCESS_TERMINATE, FALSE, process.th32ProcessID ))) if (!(handle = OpenProcess( PROCESS_TERMINATE, FALSE, process.th32ProcessID )))
continue; continue;

View File

@ -265,7 +265,7 @@ static void create_user_shared_data(void)
InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL ); InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL );
if ((status = NtOpenSection( &handle, SECTION_ALL_ACCESS, &attr ))) if ((status = NtOpenSection( &handle, SECTION_ALL_ACCESS, &attr )))
{ {
ERR( "cannot open __wine_user_shared_data: %x\n", status ); ERR( "cannot open __wine_user_shared_data: %lx\n", status );
return; return;
} }
data = MapViewOfFile( handle, FILE_MAP_WRITE, 0, 0, sizeof(*data) ); data = MapViewOfFile( handle, FILE_MAP_WRITE, 0, 0, sizeof(*data) );
@ -951,7 +951,7 @@ static BOOL wininit(void)
if( !MoveFileExW( L"wininit.ini", L"wininit.bak", MOVEFILE_REPLACE_EXISTING) ) if( !MoveFileExW( L"wininit.ini", L"wininit.bak", MOVEFILE_REPLACE_EXISTING) )
{ {
WINE_ERR("Couldn't rename wininit.ini, error %d\n", GetLastError() ); WINE_ERR("Couldn't rename wininit.ini, error %ld\n", GetLastError() );
return FALSE; return FALSE;
} }
@ -1054,7 +1054,7 @@ static DWORD runCmd(LPWSTR cmdline, LPCWSTR dir, BOOL wait, BOOL minimized)
if( !CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, dir, &si, &info) ) if( !CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, dir, &si, &info) )
{ {
WINE_WARN("Failed to run command %s (%d)\n", wine_dbgstr_w(cmdline), GetLastError() ); WINE_WARN("Failed to run command %s (%ld)\n", wine_dbgstr_w(cmdline), GetLastError() );
return INVALID_RUNCMD_RETURN; return INVALID_RUNCMD_RETURN;
} }
@ -1111,23 +1111,23 @@ static void process_run_key( HKEY key, const WCHAR *keyname, BOOL delete, BOOL s
if ((res = RegEnumValueW( runkey, --i, value, &len, 0, &type, (BYTE *)cmdline, &len_data ))) if ((res = RegEnumValueW( runkey, --i, value, &len, 0, &type, (BYTE *)cmdline, &len_data )))
{ {
WINE_ERR( "Couldn't read value %u (%d).\n", i, res ); WINE_ERR( "Couldn't read value %lu (%ld).\n", i, res );
continue; continue;
} }
if (delete && (res = RegDeleteValueW( runkey, value ))) if (delete && (res = RegDeleteValueW( runkey, value )))
{ {
WINE_ERR( "Couldn't delete value %u (%d). Running command anyways.\n", i, res ); WINE_ERR( "Couldn't delete value %lu (%ld). Running command anyways.\n", i, res );
} }
if (type != REG_SZ) if (type != REG_SZ)
{ {
WINE_ERR( "Incorrect type of value %u (%u).\n", i, type ); WINE_ERR( "Incorrect type of value %lu (%lu).\n", i, type );
continue; continue;
} }
if (runCmd( cmdline, NULL, synchronous, FALSE ) == INVALID_RUNCMD_RETURN) if (runCmd( cmdline, NULL, synchronous, FALSE ) == INVALID_RUNCMD_RETURN)
{ {
WINE_ERR( "Error running cmd %s (%u).\n", wine_dbgstr_w(cmdline), GetLastError() ); WINE_ERR( "Error running cmd %s (%lu).\n", wine_dbgstr_w(cmdline), GetLastError() );
} }
WINE_TRACE( "Done processing cmd %u.\n", i ); WINE_TRACE( "Done processing cmd %lu.\n", i );
} }
end: end:
@ -1243,7 +1243,7 @@ static int ProcessWindowsFileProtection(void)
dllcache, targetpath, currentpath, tempfile, &sz); dllcache, targetpath, currentpath, tempfile, &sz);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
{ {
WINE_WARN("WFP: %s error 0x%x\n",wine_dbgstr_w(finddata.cFileName),rc); WINE_WARN("WFP: %s error 0x%lx\n",wine_dbgstr_w(finddata.cFileName),rc);
DeleteFileW(tempfile); DeleteFileW(tempfile);
} }
@ -1253,7 +1253,7 @@ static int ProcessWindowsFileProtection(void)
targetpath[sz++] = '\\'; targetpath[sz++] = '\\';
lstrcpynW( targetpath + sz, finddata.cFileName, MAX_PATH - sz ); lstrcpynW( targetpath + sz, finddata.cFileName, MAX_PATH - sz );
if (!DeleteFileW( targetpath )) if (!DeleteFileW( targetpath ))
WINE_WARN( "failed to delete %s: error %u\n", wine_dbgstr_w(targetpath), GetLastError() ); WINE_WARN( "failed to delete %s: error %lu\n", wine_dbgstr_w(targetpath), GetLastError() );
find_rc = FindNextFileW(find_handle,&finddata); find_rc = FindNextFileW(find_handle,&finddata);
} }
@ -1272,7 +1272,7 @@ static BOOL start_services_process(void)
if (!CreateProcessW(L"C:\\windows\\system32\\services.exe", NULL, if (!CreateProcessW(L"C:\\windows\\system32\\services.exe", NULL,
NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
{ {
WINE_ERR("Couldn't start services.exe: error %u\n", GetLastError()); WINE_ERR("Couldn't start services.exe: error %lu\n", GetLastError());
return FALSE; return FALSE;
} }
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
@ -1285,7 +1285,7 @@ static BOOL start_services_process(void)
{ {
DWORD exit_code; DWORD exit_code;
GetExitCodeProcess(pi.hProcess, &exit_code); GetExitCodeProcess(pi.hProcess, &exit_code);
WINE_ERR("Unexpected termination of services.exe - exit code %d\n", exit_code); WINE_ERR("Unexpected termination of services.exe - exit code %ld\n", exit_code);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
CloseHandle(wait_handles[0]); CloseHandle(wait_handles[0]);
return FALSE; return FALSE;
@ -1375,7 +1375,7 @@ static void install_root_pnp_devices(void)
if ((set = SetupDiCreateDeviceInfoList( NULL, NULL )) == INVALID_HANDLE_VALUE) if ((set = SetupDiCreateDeviceInfoList( NULL, NULL )) == INVALID_HANDLE_VALUE)
{ {
WINE_ERR("Failed to create device info list, error %#x.\n", GetLastError()); WINE_ERR("Failed to create device info list, error %#lx.\n", GetLastError());
return; return;
} }
@ -1384,25 +1384,25 @@ static void install_root_pnp_devices(void)
if (!SetupDiCreateDeviceInfoA( set, root_devices[i].name, &GUID_NULL, NULL, NULL, 0, &device)) if (!SetupDiCreateDeviceInfoA( set, root_devices[i].name, &GUID_NULL, NULL, NULL, 0, &device))
{ {
if (GetLastError() != ERROR_DEVINST_ALREADY_EXISTS) if (GetLastError() != ERROR_DEVINST_ALREADY_EXISTS)
WINE_ERR("Failed to create device %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); WINE_ERR("Failed to create device %s, error %#lx.\n", debugstr_a(root_devices[i].name), GetLastError());
continue; continue;
} }
if (!SetupDiSetDeviceRegistryPropertyA(set, &device, SPDRP_HARDWAREID, if (!SetupDiSetDeviceRegistryPropertyA(set, &device, SPDRP_HARDWAREID,
(const BYTE *)root_devices[i].hardware_id, (strlen(root_devices[i].hardware_id) + 2) * sizeof(WCHAR))) (const BYTE *)root_devices[i].hardware_id, (strlen(root_devices[i].hardware_id) + 2) * sizeof(WCHAR)))
{ {
WINE_ERR("Failed to set hardware id for %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); WINE_ERR("Failed to set hardware id for %s, error %#lx.\n", debugstr_a(root_devices[i].name), GetLastError());
continue; continue;
} }
if (!SetupDiCallClassInstaller(DIF_REGISTERDEVICE, set, &device)) if (!SetupDiCallClassInstaller(DIF_REGISTERDEVICE, set, &device))
{ {
WINE_ERR("Failed to register device %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); WINE_ERR("Failed to register device %s, error %#lx.\n", debugstr_a(root_devices[i].name), GetLastError());
continue; continue;
} }
if (!UpdateDriverForPlugAndPlayDevicesA(NULL, root_devices[i].hardware_id, root_devices[i].infpath, 0, NULL)) if (!UpdateDriverForPlugAndPlayDevicesA(NULL, root_devices[i].hardware_id, root_devices[i].infpath, 0, NULL))
WINE_ERR("Failed to install drivers for %s, error %#x.\n", debugstr_a(root_devices[i].name), GetLastError()); WINE_ERR("Failed to install drivers for %s, error %#lx.\n", debugstr_a(root_devices[i].name), GetLastError());
} }
SetupDiDestroyDeviceInfoList(set); SetupDiDestroyDeviceInfoList(set);
@ -1613,7 +1613,7 @@ int __cdecl main( int argc, char *argv[] )
end_session = force = init = kill = restart = shutdown = update = FALSE; end_session = force = init = kill = restart = shutdown = update = FALSE;
GetWindowsDirectoryW( windowsdir, MAX_PATH ); GetWindowsDirectoryW( windowsdir, MAX_PATH );
if( !SetCurrentDirectoryW( windowsdir ) ) if( !SetCurrentDirectoryW( windowsdir ) )
WINE_ERR("Cannot set the dir to %s (%d)\n", wine_dbgstr_w(windowsdir), GetLastError() ); WINE_ERR("Cannot set the dir to %s (%ld)\n", wine_dbgstr_w(windowsdir), GetLastError() );
if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64) if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64)
{ {
@ -1636,7 +1636,7 @@ int __cdecl main( int argc, char *argv[] )
GetExitCodeProcess( pi.hProcess, &exit_code ); GetExitCodeProcess( pi.hProcess, &exit_code );
ExitProcess( exit_code ); ExitProcess( exit_code );
} }
else WINE_ERR( "failed to restart 64-bit %s, err %d\n", wine_dbgstr_w(filename), GetLastError() ); else WINE_ERR( "failed to restart 64-bit %s, err %ld\n", wine_dbgstr_w(filename), GetLastError() );
Wow64RevertWow64FsRedirection( redir ); Wow64RevertWow64FsRedirection( redir );
} }