[MPLAY32] Don't hardcode C: drive (#2778)

CORE-13235
This commit is contained in:
Katayama Hirofumi MZ 2020-05-13 22:36:44 +09:00 committed by GitHub
parent d5a4e534ae
commit b1519f65a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1149,22 +1149,15 @@ OpenFileDialog(HWND hwnd, DWORD dwFilterIndex, LPTSTR lpType)
{
OPENFILENAME OpenFileName;
TCHAR szFile[MAX_PATH + 1] = _T("");
TCHAR szCurrentDir[MAX_PATH];
ZeroMemory(&OpenFileName, sizeof(OpenFileName));
if (!GetCurrentDirectory(ARRAYSIZE(szCurrentDir), szCurrentDir))
{
StringCbCopy(szCurrentDir, sizeof(szCurrentDir), _T("c:\\"));
}
OpenFileName.lStructSize = sizeof(OpenFileName);
OpenFileName.hwndOwner = hwnd;
OpenFileName.hInstance = hInstance;
OpenFileName.lpstrFilter = szFilter;
OpenFileName.lpstrFile = szFile;
OpenFileName.nMaxFile = ARRAYSIZE(szFile);
OpenFileName.lpstrInitialDir = szCurrentDir;
OpenFileName.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_SHAREAWARE;
OpenFileName.lpstrDefExt = _T("\0");
OpenFileName.nFilterIndex = dwFilterIndex;