X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=base%2Fshell%2Ffilebrowser%2Ffilebrowser.c;h=c6da047251641c162d7d033fd67f16dee90169b5;hp=8bbfe47379de6f96a7d487edb392b5816cba3391;hb=4a5b30ee1f322ba47ca5d3b9f885a162f4e3a1f5;hpb=8db8073cbb2ceddf2cd8ffa6fbe0893c95941034 diff --git a/base/shell/filebrowser/filebrowser.c b/base/shell/filebrowser/filebrowser.c index 8bbfe47379d..c6da0472516 100644 --- a/base/shell/filebrowser/filebrowser.c +++ b/base/shell/filebrowser/filebrowser.c @@ -23,23 +23,29 @@ #include #include #include +#include +#include -typedef HRESULT (WINAPI *SH_OPEN_NEW_FRAME)(LPITEMIDLIST pidl, IUnknown *paramC, long param10, long param14); +#include int _tmain(int argc, _TCHAR* argv[]) { - HMODULE hBrowseui = LoadLibraryW(L"browseui.dll"); - if (hBrowseui) + EXPLORER_CMDLINE_PARSE_RESULTS parseResults = { 0 }; + + if (SHExplorerParseCmdLine(&parseResults)) { - SH_OPEN_NEW_FRAME SHOpenNewFrame = (SH_OPEN_NEW_FRAME)GetProcAddress(hBrowseui, (LPCSTR)103); - LPITEMIDLIST pidlDrives; - SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, &pidlDrives); - SHOpenNewFrame((LPITEMIDLIST)pidlDrives, NULL, 0, 0); + parseResults.dwFlags |= SH_EXPLORER_CMDLINE_FLAG_SEPARATE; + return SHCreateFromDesktop(&parseResults); } - /* FIXME: we should wait a bit here and see if a window was created. If not we should exit this process */ - ExitThread(0); + if (parseResults.strPath) + SHFree(parseResults.strPath); + + if (parseResults.pidlPath) + ILFree(parseResults.pidlPath); + + if (parseResults.pidlRoot) + ILFree(parseResults.pidlRoot); return 0; } -