fix unrar deps errors when cross-compiling with mingw

pull/3734/head
Gabriele Gristina 12 months ago
parent 5ec8c96840
commit ca53e78f7d

@ -26,7 +26,7 @@ DWORD WinNT()
// Replace it with documented Windows 11 check when available.
#include <comdef.h>
#include <Wbemidl.h>
#include <wbemidl.h>
#pragma comment(lib, "wbemuuid.lib")
static bool WMI_IsWindows10()
@ -40,8 +40,10 @@ static bool WMI_IsWindows10()
return false;
IWbemServices *pSvc = NULL;
hres = pLoc->ConnectServer(_bstr_t(L"ROOT\\CIMV2"),NULL,NULL,NULL,NULL,0,0,&pSvc);
BSTR bstr_root_cimv2 = SysAllocString(L"ROOT\\CIMV2");
hres = pLoc->ConnectServer(bstr_root_cimv2,NULL,NULL,NULL,0,0,0,&pSvc);
if (FAILED(hres))
{
@ -60,7 +62,11 @@ static bool WMI_IsWindows10()
}
IEnumWbemClassObject *pEnumerator = NULL;
hres = pSvc->ExecQuery(bstr_t("WQL"), bstr_t("SELECT * FROM Win32_OperatingSystem"),
BSTR bstr_wql = SysAllocString(L"WQL");
BSTR bstr_sql = SysAllocString(L"SELECT * FROM Win32_OperatingSystem");
hres = pSvc->ExecQuery(bstr_wql, bstr_sql,
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);
if (FAILED(hres))

7
deps/unrar/os.hpp vendored

@ -41,6 +41,11 @@
#define _UNICODE // Set _T() macro to convert from narrow to wide strings.
#endif
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#if 0
// 2021.09.05: Allow newer Vista+ APIs like IFileOpenDialog for WinRAR,
// but still keep SFX modules XP compatible.
@ -61,7 +66,7 @@
#include <prsht.h>
#include <shlwapi.h>
#pragma comment(lib, "Shlwapi.lib")
#include <PowrProf.h>
#include <powrprof.h>
#pragma comment(lib, "PowrProf.lib")
#include <shellapi.h>
#include <shlobj.h>

@ -215,9 +215,11 @@ bool ScanTree::GetNextMask()
UnixSlashToDos(CurMask,CurMask,ASIZE(CurMask));
#endif
// We prefer to scan entire disk if mask like \\server\share\ or c:\
// is specified regardless of recursion mode. Use \\server\share\*.*
// or c:\*.* mask to scan only the root directory.
/*
We prefer to scan entire disk if mask like \\server\share\ or c:\
is specified regardless of recursion mode. Use \\server\share\*.*
or c:\*.* mask to scan only the root directory.
*/
if (CurMask[0]=='\\' && CurMask[1]=='\\')
{
const wchar *Slash=wcschr(CurMask+2,'\\');

@ -752,6 +752,7 @@ LFLAGS_CROSS_WIN += -lpsapi
LFLAGS_CROSS_WIN += -lws2_32
LFLAGS_CROSS_WIN += -lpowrprof
LFLAGS_CROSS_WIN += -static -static-libgcc -static-libstdc++
LFLAGS_CROSS_WIN += -lole32 -loleaut32 -lwbemuuid
##
## Targets

Loading…
Cancel
Save