mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[misc] use COBJMACROS for COM calls
This commit is contained in:
parent
f8592959bd
commit
7745edbb92
5 changed files with 35 additions and 35 deletions
|
@ -121,7 +121,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -145,7 +145,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -170,7 +170,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -199,7 +199,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
|
@ -223,7 +223,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -247,7 +247,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -273,7 +273,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
@ -302,7 +302,7 @@
|
|||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
|
|
2
configure
vendored
2
configure
vendored
|
@ -3894,7 +3894,7 @@ fi
|
|||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
CFLAGS="${saved_CFLAGS}"
|
||||
|
||||
AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Werror-implicit-function-declaration $nopointersign_cflags"
|
||||
AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Werror-implicit-function-declaration $nopointersign_cflags"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
|||
[nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""])
|
||||
CFLAGS="${saved_CFLAGS}"
|
||||
|
||||
AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Werror-implicit-function-declaration $nopointersign_cflags"
|
||||
AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -std=gnu99 -Wshadow -Wall -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Werror-implicit-function-declaration $nopointersign_cflags"
|
||||
|
||||
AC_SUBST([VISIBILITY_CFLAGS])
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_ACCEPTFILES
|
||||
CAPTION "Rufus 3.4.1426"
|
||||
CAPTION "Rufus 3.4.1427"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
|
@ -394,8 +394,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3,4,1426,0
|
||||
PRODUCTVERSION 3,4,1426,0
|
||||
FILEVERSION 3,4,1427,0
|
||||
PRODUCTVERSION 3,4,1427,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -413,13 +413,13 @@ BEGIN
|
|||
VALUE "Comments", "https://akeo.ie"
|
||||
VALUE "CompanyName", "Akeo Consulting"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "3.4.1426"
|
||||
VALUE "FileVersion", "3.4.1427"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
|
||||
VALUE "OriginalFilename", "rufus-3.4.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "3.4.1426"
|
||||
VALUE "ProductVersion", "3.4.1427"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
40
src/stdlg.c
40
src/stdlg.c
|
@ -158,7 +158,7 @@ void BrowseForFolder(void) {
|
|||
pfod = NULL; // Just in case
|
||||
goto fallback;
|
||||
}
|
||||
hr = pfod->lpVtbl->SetOptions(pfod, FOS_PICKFOLDERS);
|
||||
hr = IFileOpenDialog_SetOptions(pfod, FOS_PICKFOLDERS);
|
||||
if (FAILED(hr)) {
|
||||
uprintf("Failed to set folder option for FileOpenDialog: error %X\n", hr);
|
||||
goto fallback;
|
||||
|
@ -180,19 +180,19 @@ void BrowseForFolder(void) {
|
|||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (wpath != NULL) {
|
||||
pfod->lpVtbl->SetFolder(pfod, si_path);
|
||||
IFileOpenDialog_SetFolder(pfod, si_path);
|
||||
}
|
||||
if (fname != NULL) {
|
||||
pfod->lpVtbl->SetFileName(pfod, fname);
|
||||
IFileOpenDialog_SetFileName(pfod, fname);
|
||||
}
|
||||
}
|
||||
safe_free(wpath);
|
||||
|
||||
hr = pfod->lpVtbl->Show(pfod, hMainDialog);
|
||||
hr = IFileOpenDialog_Show(pfod, hMainDialog);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = pfod->lpVtbl->GetResult(pfod, &psi);
|
||||
hr = IFileOpenDialog_GetResult(pfod, &psi);
|
||||
if (SUCCEEDED(hr)) {
|
||||
psi->lpVtbl->GetDisplayName(psi, SIGDN_FILESYSPATH, &wpath);
|
||||
IShellItem_GetDisplayName(psi, SIGDN_FILESYSPATH, &wpath);
|
||||
tmp_path = wchar_to_utf8(wpath);
|
||||
CoTaskMemFree(wpath);
|
||||
if (tmp_path == NULL) {
|
||||
|
@ -209,12 +209,12 @@ void BrowseForFolder(void) {
|
|||
uprintf("Could not show FileOpenDialog: error %X\n", hr);
|
||||
goto fallback;
|
||||
}
|
||||
pfod->lpVtbl->Release(pfod);
|
||||
IFileOpenDialog_Release(pfod);
|
||||
dialog_showing--;
|
||||
return;
|
||||
fallback:
|
||||
if (pfod != NULL) {
|
||||
pfod->lpVtbl->Release(pfod);
|
||||
IFileOpenDialog_Release(pfod);
|
||||
}
|
||||
|
||||
memset(&bi, 0, sizeof(BROWSEINFOW));
|
||||
|
@ -280,7 +280,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
}
|
||||
|
||||
// Set the file extension filters
|
||||
pfd->lpVtbl->SetFileTypes(pfd, (UINT)ext->count + 1, filter_spec);
|
||||
IFileDialog_SetFileTypes(pfd, (UINT)ext->count + 1, filter_spec);
|
||||
|
||||
if (path == NULL) {
|
||||
// Try to use the "Downloads" folder as the initial default directory
|
||||
|
@ -290,7 +290,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
if (SUCCEEDED(hr)) {
|
||||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||
if (SUCCEEDED(hr)) {
|
||||
pfd->lpVtbl->SetDefaultFolder(pfd, si_path);
|
||||
IFileDialog_SetDefaultFolder(pfd, si_path);
|
||||
}
|
||||
CoTaskMemFree(wpath);
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
wpath = utf8_to_wchar(path);
|
||||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||
if (SUCCEEDED(hr)) {
|
||||
pfd->lpVtbl->SetFolder(pfd, si_path);
|
||||
IFileDialog_SetFolder(pfd, si_path);
|
||||
}
|
||||
safe_free(wpath);
|
||||
}
|
||||
|
@ -306,11 +306,11 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
// Set the default filename
|
||||
wfilename = utf8_to_wchar((ext->filename == NULL) ? "" : ext->filename);
|
||||
if (wfilename != NULL) {
|
||||
pfd->lpVtbl->SetFileName(pfd, wfilename);
|
||||
IFileDialog_SetFileName(pfd, wfilename);
|
||||
}
|
||||
|
||||
// Display the dialog
|
||||
hr = pfd->lpVtbl->Show(pfd, hMainDialog);
|
||||
hr = IFileDialog_Show(pfd, hMainDialog);
|
||||
|
||||
// Cleanup
|
||||
safe_free(wfilename);
|
||||
|
@ -323,9 +323,9 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
|
||||
if (SUCCEEDED(hr)) {
|
||||
// Obtain the result of the user's interaction with the dialog.
|
||||
hr = pfd->lpVtbl->GetResult(pfd, &psiResult);
|
||||
hr = IFileDialog_GetResult(pfd, &psiResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = psiResult->lpVtbl->GetDisplayName(psiResult, SIGDN_FILESYSPATH, &wpath);
|
||||
hr = IShellItem_GetDisplayName(psiResult, SIGDN_FILESYSPATH, &wpath);
|
||||
if (SUCCEEDED(hr)) {
|
||||
filepath = wchar_to_utf8(wpath);
|
||||
CoTaskMemFree(wpath);
|
||||
|
@ -333,7 +333,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
SetLastError(hr);
|
||||
uprintf("Unable to access file path: %s\n", WindowsErrorString());
|
||||
}
|
||||
psiResult->lpVtbl->Release(psiResult);
|
||||
IShellItem_Release(psiResult);
|
||||
}
|
||||
} else if ((hr & 0xFFFF) != ERROR_CANCELLED) {
|
||||
// If it's not a user cancel, assume the dialog didn't show and fallback
|
||||
|
@ -341,7 +341,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
uprintf("Could not show FileOpenDialog: %s\n", WindowsErrorString());
|
||||
goto fallback;
|
||||
}
|
||||
pfd->lpVtbl->Release(pfd);
|
||||
IFileDialog_Release(pfd);
|
||||
dialog_showing--;
|
||||
return filepath;
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
fallback:
|
||||
safe_free(filter_spec);
|
||||
if (pfd != NULL) {
|
||||
pfd->lpVtbl->Release(pfd);
|
||||
IFileDialog_Release(pfd);
|
||||
}
|
||||
|
||||
memset(&ofn, 0, sizeof(ofn));
|
||||
|
@ -1301,14 +1301,14 @@ BOOL SetTaskbarProgressState(TASKBAR_PROGRESS_FLAGS tbpFlags)
|
|||
{
|
||||
if (ptbl == NULL)
|
||||
return FALSE;
|
||||
return !FAILED(ptbl->lpVtbl->SetProgressState(ptbl, hMainDialog, tbpFlags));
|
||||
return !FAILED(ITaskbarList3_SetProgressState(ptbl, hMainDialog, tbpFlags));
|
||||
}
|
||||
|
||||
BOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal)
|
||||
{
|
||||
if (ptbl == NULL)
|
||||
return FALSE;
|
||||
return !FAILED(ptbl->lpVtbl->SetProgressValue(ptbl, hMainDialog, ullCompleted, ullTotal));
|
||||
return !FAILED(ITaskbarList3_SetProgressValue(ptbl, hMainDialog, ullCompleted, ullTotal));
|
||||
}
|
||||
|
||||
static void Reposition(HWND hDlg, int id, int dx, int dw)
|
||||
|
|
Loading…
Reference in a new issue