peview: Fix open file dialog error message
@@ -50,8 +50,6 @@ INT WINAPI wWinMain(
};
PPH_STRING commandLine;
- CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
-
if (!NT_SUCCESS(PhInitializePhLibEx(L"PE Viewer", ULONG_MAX, hInstance, 0, 0)))
return 1;
@@ -128,6 +126,9 @@ INT WINAPI wWinMain(
};
PVOID fileDialog;
+ if (!SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)))
+ return 1;
+
fileDialog = PhCreateOpenFileDialog();
PhSetFileDialogOptions(fileDialog, PH_FILEDIALOG_NOPATHVALIDATE);
PhSetFileDialogFilter(fileDialog, filters, RTL_NUMBER_OF(filters));
@@ -148,8 +149,8 @@ INT WINAPI wWinMain(
PhGetString(applicationFileName),
PvFileName->Buffer,
SW_SHOWDEFAULT,
+ PH_SHELL_EXECUTE_NOZONECHECKS,
0,
- ULONG_MAX,
NULL
))
{
