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'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<BuildLog />
|
<BuildLog />
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
<BuildLog />
|
<BuildLog />
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||||
<BuildLog />
|
<BuildLog />
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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>
|
</Midl>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<AdditionalIncludeDirectories>..\src\msvc-missing;..\src\ms-sys\inc;..\src\syslinux\libinstaller;..\src\syslinux\libfat;..\src\syslinux\win;..\src\libcdio;..\src\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<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>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<BuildLog />
|
<BuildLog />
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
<BuildLog />
|
<BuildLog />
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||||
<BuildLog />
|
<BuildLog />
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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>
|
<TargetEnvironment>X64</TargetEnvironment>
|
||||||
</Midl>
|
</Midl>
|
||||||
<ClCompile>
|
<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>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<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>
|
<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
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
CFLAGS="${saved_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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
||||||
[nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""])
|
[nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""])
|
||||||
CFLAGS="${saved_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([VISIBILITY_CFLAGS])
|
||||||
AC_SUBST([AM_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
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.4.1426"
|
CAPTION "Rufus 3.4.1427"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -394,8 +394,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,4,1426,0
|
FILEVERSION 3,4,1427,0
|
||||||
PRODUCTVERSION 3,4,1426,0
|
PRODUCTVERSION 3,4,1427,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -413,13 +413,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://akeo.ie"
|
VALUE "Comments", "https://akeo.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.4.1426"
|
VALUE "FileVersion", "3.4.1427"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.4.exe"
|
VALUE "OriginalFilename", "rufus-3.4.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.4.1426"
|
VALUE "ProductVersion", "3.4.1427"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
40
src/stdlg.c
40
src/stdlg.c
|
@ -158,7 +158,7 @@ void BrowseForFolder(void) {
|
||||||
pfod = NULL; // Just in case
|
pfod = NULL; // Just in case
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
hr = pfod->lpVtbl->SetOptions(pfod, FOS_PICKFOLDERS);
|
hr = IFileOpenDialog_SetOptions(pfod, FOS_PICKFOLDERS);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
uprintf("Failed to set folder option for FileOpenDialog: error %X\n", hr);
|
uprintf("Failed to set folder option for FileOpenDialog: error %X\n", hr);
|
||||||
goto fallback;
|
goto fallback;
|
||||||
|
@ -180,19 +180,19 @@ void BrowseForFolder(void) {
|
||||||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
if (wpath != NULL) {
|
if (wpath != NULL) {
|
||||||
pfod->lpVtbl->SetFolder(pfod, si_path);
|
IFileOpenDialog_SetFolder(pfod, si_path);
|
||||||
}
|
}
|
||||||
if (fname != NULL) {
|
if (fname != NULL) {
|
||||||
pfod->lpVtbl->SetFileName(pfod, fname);
|
IFileOpenDialog_SetFileName(pfod, fname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
safe_free(wpath);
|
safe_free(wpath);
|
||||||
|
|
||||||
hr = pfod->lpVtbl->Show(pfod, hMainDialog);
|
hr = IFileOpenDialog_Show(pfod, hMainDialog);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
hr = pfod->lpVtbl->GetResult(pfod, &psi);
|
hr = IFileOpenDialog_GetResult(pfod, &psi);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
psi->lpVtbl->GetDisplayName(psi, SIGDN_FILESYSPATH, &wpath);
|
IShellItem_GetDisplayName(psi, SIGDN_FILESYSPATH, &wpath);
|
||||||
tmp_path = wchar_to_utf8(wpath);
|
tmp_path = wchar_to_utf8(wpath);
|
||||||
CoTaskMemFree(wpath);
|
CoTaskMemFree(wpath);
|
||||||
if (tmp_path == NULL) {
|
if (tmp_path == NULL) {
|
||||||
|
@ -209,12 +209,12 @@ void BrowseForFolder(void) {
|
||||||
uprintf("Could not show FileOpenDialog: error %X\n", hr);
|
uprintf("Could not show FileOpenDialog: error %X\n", hr);
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
pfod->lpVtbl->Release(pfod);
|
IFileOpenDialog_Release(pfod);
|
||||||
dialog_showing--;
|
dialog_showing--;
|
||||||
return;
|
return;
|
||||||
fallback:
|
fallback:
|
||||||
if (pfod != NULL) {
|
if (pfod != NULL) {
|
||||||
pfod->lpVtbl->Release(pfod);
|
IFileOpenDialog_Release(pfod);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&bi, 0, sizeof(BROWSEINFOW));
|
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
|
// 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) {
|
if (path == NULL) {
|
||||||
// Try to use the "Downloads" folder as the initial default directory
|
// 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)) {
|
if (SUCCEEDED(hr)) {
|
||||||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
pfd->lpVtbl->SetDefaultFolder(pfd, si_path);
|
IFileDialog_SetDefaultFolder(pfd, si_path);
|
||||||
}
|
}
|
||||||
CoTaskMemFree(wpath);
|
CoTaskMemFree(wpath);
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
||||||
wpath = utf8_to_wchar(path);
|
wpath = utf8_to_wchar(path);
|
||||||
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
hr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
pfd->lpVtbl->SetFolder(pfd, si_path);
|
IFileDialog_SetFolder(pfd, si_path);
|
||||||
}
|
}
|
||||||
safe_free(wpath);
|
safe_free(wpath);
|
||||||
}
|
}
|
||||||
|
@ -306,11 +306,11 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
||||||
// Set the default filename
|
// Set the default filename
|
||||||
wfilename = utf8_to_wchar((ext->filename == NULL) ? "" : ext->filename);
|
wfilename = utf8_to_wchar((ext->filename == NULL) ? "" : ext->filename);
|
||||||
if (wfilename != NULL) {
|
if (wfilename != NULL) {
|
||||||
pfd->lpVtbl->SetFileName(pfd, wfilename);
|
IFileDialog_SetFileName(pfd, wfilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display the dialog
|
// Display the dialog
|
||||||
hr = pfd->lpVtbl->Show(pfd, hMainDialog);
|
hr = IFileDialog_Show(pfd, hMainDialog);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
safe_free(wfilename);
|
safe_free(wfilename);
|
||||||
|
@ -323,9 +323,9 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
||||||
|
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
// Obtain the result of the user's interaction with the dialog.
|
// 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)) {
|
if (SUCCEEDED(hr)) {
|
||||||
hr = psiResult->lpVtbl->GetDisplayName(psiResult, SIGDN_FILESYSPATH, &wpath);
|
hr = IShellItem_GetDisplayName(psiResult, SIGDN_FILESYSPATH, &wpath);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
filepath = wchar_to_utf8(wpath);
|
filepath = wchar_to_utf8(wpath);
|
||||||
CoTaskMemFree(wpath);
|
CoTaskMemFree(wpath);
|
||||||
|
@ -333,7 +333,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
||||||
SetLastError(hr);
|
SetLastError(hr);
|
||||||
uprintf("Unable to access file path: %s\n", WindowsErrorString());
|
uprintf("Unable to access file path: %s\n", WindowsErrorString());
|
||||||
}
|
}
|
||||||
psiResult->lpVtbl->Release(psiResult);
|
IShellItem_Release(psiResult);
|
||||||
}
|
}
|
||||||
} else if ((hr & 0xFFFF) != ERROR_CANCELLED) {
|
} else if ((hr & 0xFFFF) != ERROR_CANCELLED) {
|
||||||
// If it's not a user cancel, assume the dialog didn't show and fallback
|
// 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());
|
uprintf("Could not show FileOpenDialog: %s\n", WindowsErrorString());
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
pfd->lpVtbl->Release(pfd);
|
IFileDialog_Release(pfd);
|
||||||
dialog_showing--;
|
dialog_showing--;
|
||||||
return filepath;
|
return filepath;
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
||||||
fallback:
|
fallback:
|
||||||
safe_free(filter_spec);
|
safe_free(filter_spec);
|
||||||
if (pfd != NULL) {
|
if (pfd != NULL) {
|
||||||
pfd->lpVtbl->Release(pfd);
|
IFileDialog_Release(pfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&ofn, 0, sizeof(ofn));
|
memset(&ofn, 0, sizeof(ofn));
|
||||||
|
@ -1301,14 +1301,14 @@ BOOL SetTaskbarProgressState(TASKBAR_PROGRESS_FLAGS tbpFlags)
|
||||||
{
|
{
|
||||||
if (ptbl == NULL)
|
if (ptbl == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return !FAILED(ptbl->lpVtbl->SetProgressState(ptbl, hMainDialog, tbpFlags));
|
return !FAILED(ITaskbarList3_SetProgressState(ptbl, hMainDialog, tbpFlags));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal)
|
BOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal)
|
||||||
{
|
{
|
||||||
if (ptbl == NULL)
|
if (ptbl == NULL)
|
||||||
return FALSE;
|
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)
|
static void Reposition(HWND hDlg, int id, int dx, int dw)
|
||||||
|
|
Loading…
Reference in a new issue