示例#1
0
void sc_GetSystemAppSupportDirectory(char *str, int size)
{
#ifdef _WIN32
	ITEMIDLIST * pidl;
	char buf[MAX_PATH];
	SHGetFolderLocation(NULL, CSIDL_COMMON_APPDATA, NULL, 0, &pidl);
	SHGetPathFromIDList( pidl, buf );
	ILFree(pidl);
	strncpy(str, buf, size);
	sc_AppendToPath(str, size, "SuperCollider");
#else

	strncpy(str,
#if defined(SC_DATA_DIR)
			SC_DATA_DIR,
#elif defined(SC_IPHONE)
			"/",
#elif defined(__APPLE__)
			"/Library/Application Support",
#else
			"/usr/local/share/SuperCollider",
#endif
			size);

#if defined(__APPLE__)
	// Get the main bundle name for the app from the enclosed Info.plist 
	sc_AppendBundleName(str, size);
#endif

#endif
}
示例#2
0
文件: theme.c 项目: AlexSteel/wine
static void update_shell_folder_listview(HWND dialog) {
    int i;
    LVITEMW item;
    LONG lSelected = SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_GETNEXTITEM, -1,
                                        MAKELPARAM(LVNI_SELECTED,0));

    SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_DELETEALLITEMS, 0, 0);

    for (i=0; i<NUM_ELEMS(asfiInfo); i++) {
        WCHAR buffer[MAX_PATH];
        HRESULT hr;
        LPITEMIDLIST pidlCurrent;

        /* Some acrobatic to get the localized name of the shell folder */
        hr = SHGetFolderLocation(dialog, asfiInfo[i].nFolder, NULL, 0, &pidlCurrent);
        if (SUCCEEDED(hr)) { 
            LPSHELLFOLDER psfParent;
            LPCITEMIDLIST pidlLast;
            hr = SHBindToParent(pidlCurrent, &IID_IShellFolder, (LPVOID*)&psfParent, &pidlLast);
            if (SUCCEEDED(hr)) {
                STRRET strRet;
                hr = IShellFolder_GetDisplayNameOf(psfParent, pidlLast, SHGDN_FORADDRESSBAR, &strRet);
                if (SUCCEEDED(hr)) {
                    hr = StrRetToBufW(&strRet, pidlLast, buffer, MAX_PATH);
                }
                IShellFolder_Release(psfParent);
            }
            ILFree(pidlCurrent);
        }

        /* If there's a dangling symlink for the current shell folder, SHGetFolderLocation
         * will fail above. We fall back to the (non-verified) path of the shell folder. */
        if (FAILED(hr)) {
            hr = SHGetFolderPathW(dialog, asfiInfo[i].nFolder|CSIDL_FLAG_DONT_VERIFY, NULL,
                                 SHGFP_TYPE_CURRENT, buffer);
        }
    
        item.mask = LVIF_TEXT | LVIF_PARAM;
        item.iItem = i;
        item.iSubItem = 0;
        item.pszText = buffer;
        item.lParam = (LPARAM)&asfiInfo[i];
        SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_INSERTITEMW, 0, (LPARAM)&item);

        item.mask = LVIF_TEXT;
        item.iItem = i;
        item.iSubItem = 1;
        item.pszText = strdupU2W(asfiInfo[i].szLinkTarget);
        SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_SETITEMW, 0, (LPARAM)&item);
        HeapFree(GetProcessHeap(), 0, item.pszText);
    }

    /* Ensure that the previously selected item is selected again. */
    if (lSelected >= 0) {
        item.mask = LVIF_STATE;
        item.state = LVIS_SELECTED;
        item.stateMask = LVIS_SELECTED;
        SendDlgItemMessageW(dialog, IDC_LIST_SFPATHS, LVM_SETITEMSTATE, lSelected, (LPARAM)&item);
    }
}
示例#3
0
QString Application::UserDataDirectory()
{
    QString qstr;
#ifdef _WINDOWS
    LPITEMIDLIST pidl;

    if (SHGetFolderLocation(0, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, &pidl) != S_OK)
        return "";

    WCHAR str[MAX_PATH+1] = {};
    SHGetPathFromIDListW(pidl, str);
    CoTaskMemFree(pidl);

    qstr = WStringToQString(str) + "\\" + ApplicationName();
#else
    ///\todo Convert to QString instead of std::string.
    char *ppath = 0;
    ppath = getenv("HOME");
    if (ppath == 0)
        throw Exception("Failed to get HOME environment variable.");

    qstr = QString(ppath) + "/." + ApplicationName();
#endif

    // Apply trailing slash
    if (!qstr.endsWith(QDir::separator()))
        qstr += QDir::separator();
    return qstr;
}
示例#4
0
void sc_GetUserAppSupportDirectory(char *str, int size)
{
	// XDG support according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
	const char * xdg_data_home = getenv("XDG_DATA_HOME");
	if (xdg_data_home) {
		strncpy(str, xdg_data_home, size);
		sc_AppendToPath(str, size, "SuperCollider");
		return;
	}

#if defined(_WIN32)
	ITEMIDLIST * pidl;
	char buf[MAX_PATH];
	SHGetFolderLocation(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, &pidl);
	SHGetPathFromIDList( pidl, buf );
	ILFree(pidl);
	strncpy(str, buf, size);
	sc_AppendToPath(str, size, "SuperCollider");
#else

	sc_GetUserHomeDirectory(str, size);

#if defined(SC_IPHONE)
	sc_AppendToPath(str, size, "Documents");
#elif defined(__APPLE__)
	// Get the main bundle name for the app
	sc_AppendToPath(str, size, "Library/Application Support");
	sc_AppendBundleName(str, size);
#else
	sc_AppendToPath(str, size, ".local/share/SuperCollider");
#endif

#endif
}
示例#5
0
/**
 ****************************************************************************
 * @brief Returns the application's data directory
 *
 *   This returns c:\documents and settings\[user]\application data\mysql on
 * on Windows and ~/.mysql on Linux
 *
 * @param param nil
 * @param data pointer to the Grt
 * 
 * @return the application's data directory
 *****************************************************************************/
MYX_GRT_VALUE * get_app_data_dir(MYX_GRT_VALUE *param, void *data)
{
  MYX_GRT_VALUE *value;
  char *data_dir;
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
  LPITEMIDLIST pidl;
  char path[MAX_PATH];

  SHGetFolderLocation(NULL, CSIDL_APPDATA, NULL, 0, &pidl);

  SHGetPathFromIDList(pidl, path);

  CoTaskMemFree(pidl);

  data_dir= g_strdup_printf("%s\\MySQL\\", path);

#elif defined(__APPLE__)
  data_dir= g_strdup_printf("%s/Library/Application Support/MySQL/", g_get_home_dir());
#else
  data_dir= g_strdup_printf("%s/.mysqlgui/", g_get_home_dir());
#endif

  value= myx_grt_value_from_string(data_dir);

  g_free(data_dir);

  return make_return_value(value);
}
示例#6
0
BOOL
LoadRdpSettingsFromFile(PRDPSETTINGS pRdpSettings,
                        LPWSTR lpFile)
{
    WCHAR pszPath[MAX_PATH];
    HANDLE hFile;
    BOOL bRet = FALSE;

    /* use default file */
    if (lpFile == NULL)
    {
        HRESULT hr;
        LPITEMIDLIST lpidl= NULL;

        hr = SHGetFolderLocation(NULL,
                                 CSIDL_PERSONAL,
                                 NULL,
                                 0,
                                 &lpidl);
        if (hr == S_OK)
        {
            if (SHGetPathFromIDListW(lpidl, pszPath))
            {
                wcscat(pszPath, L"\\Default.rdp");
                lpFile = pszPath;
                CoTaskMemFree(lpidl);
            }
        }
    }

    if (lpFile)
    {
        LPWSTR lpBuffer = NULL;

        hFile = OpenRdpFile(lpFile, FALSE);
        if (hFile)
        {
            lpBuffer = ReadRdpFile(hFile);
            if (lpBuffer)
            {
                ParseSettings(pRdpSettings, lpBuffer);

                HeapFree(GetProcessHeap(),
                         0,
                         lpBuffer);
                
                bRet = TRUE;
            }

            CloseRdpFile(hFile);
        }
    }

    return bRet;
}
TEST(IsNamespaceRoot, Root)
{
	LPITEMIDLIST pidl = NULL;
	HRESULT hr = SHGetFolderLocation(NULL, CSIDL_DESKTOP, NULL, 0, &pidl);
	ASSERT_TRUE(SUCCEEDED(hr));

	BOOL bRet = IsNamespaceRoot(pidl);
	EXPECT_EQ(TRUE, bRet);

	CoTaskMemFree(pidl);
}
示例#8
0
void CreateLnkOnDesktop(const LPWSTR connTitle)
{
	IShellLink   *SLink;
	IPersistFile *PF;
	HRESULT HRes;
	TCHAR desktop_path[MAX_PATH] = TEXT("");
	TCHAR pszFullLnkPath[MAX_PATH]; 

	CoInitialize(NULL);

	ITEMIDLIST* pidl1 = NULL;
    SHGetFolderLocation(NULL, CSIDL_CONNECTIONS, NULL, 0, &pidl1);
    IShellFolder *desktop, *ncfolder;
    SHGetDesktopFolder(&desktop);
    desktop->BindToObject(pidl1, NULL, IID_IShellFolder, (void**)&ncfolder);

    IEnumIDList *items;
    ncfolder->EnumObjects(NULL, SHCONTF_NONFOLDERS, &items);
    ITEMIDLIST* pidl2 = NULL;
    while (S_OK == items->Next(1, &pidl2, NULL))
    {
        STRRET sr = {STRRET_WSTR};
        ncfolder->GetDisplayNameOf(pidl2, SHGDN_NORMAL, &sr);

        TCHAR buf[MAX_PATH] = TEXT("");
        StrRetToBuf(&sr, pidl2, buf, MAX_PATH);

        if (0 == StrCmpI(buf, connTitle))
        {
            ITEMIDLIST* pidl3 = ILCombine(pidl1, pidl2);
			HRESULT HRes = CoCreateInstance(CLSID_ShellLink, 0, CLSCTX_INPROC_SERVER, IID_IShellLink, ( LPVOID*)&SLink);
            SLink->SetIDList(pidl3);
			SHGetFolderPath(NULL, CSIDL_DESKTOP, NULL, 0, desktop_path);
			StringCbPrintf(pszFullLnkPath, MAX_PATH * sizeof(TCHAR), TEXT("%s\\%s.lnk"), desktop_path, connTitle);
			HRes = SLink->QueryInterface(IID_IPersistFile, (LPVOID*)&PF);
			HRes = PF->Save((LPCOLESTR)pszFullLnkPath, TRUE);
			PF->Release();
			SLink->Release();
            ILFree(pidl3);
            ILFree(pidl2);
            break;
        }

        ILFree(pidl2);
        pidl2 = NULL;
    }
	ncfolder->Release();
	desktop->Release();

    ILFree(pidl1);

	CoUninitialize();
}
示例#9
0
HRESULT GetCsidlDisplayName(int csidl, TCHAR *szFolderName, UINT cchMax, DWORD uParsingFlags)
{
	LPITEMIDLIST pidl = NULL;
	HRESULT hr = SHGetFolderLocation(NULL, csidl, NULL, 0, &pidl);

	if(SUCCEEDED(hr))
	{
		hr = GetDisplayName(pidl, szFolderName, cchMax, uParsingFlags);
		CoTaskMemFree(pidl);
	}

	return hr;
}
示例#10
0
文件: recyclebin.c 项目: YokoZar/wine
static HRESULT erase_items(HWND parent,const LPCITEMIDLIST * apidl, UINT cidl, BOOL confirm)
{
    UINT i=0;
    HRESULT ret = S_OK;
    LPITEMIDLIST recyclebin;

    if(confirm)
    {
        WCHAR arg[MAX_PATH];
        WCHAR message[100];
        WCHAR caption[50];
        switch(cidl)
        {
        case 0:
            return S_OK;
        case 1:
            {
                WIN32_FIND_DATAW data;
                TRASH_UnpackItemID(&((*apidl)->mkid),&data);
                lstrcpynW(arg,data.cFileName,MAX_PATH);
                LoadStringW(shell32_hInstance,IDS_RECYCLEBIN_ERASEITEM,message,
                            sizeof(message)/sizeof(WCHAR));
                break;
            }
        default:
            {
                static const WCHAR format[]={'%','u','\0'};
                LoadStringW(shell32_hInstance,IDS_RECYCLEBIN_ERASEMULTIPLE,
                            message,sizeof(message)/sizeof(WCHAR));
                sprintfW(arg,format,cidl);
                break;
            }

        }
        LoadStringW(shell32_hInstance,IDS_RECYCLEBIN_ERASE_CAPTION,caption,
                    sizeof(caption)/sizeof(WCHAR));
        if(ShellMessageBoxW(shell32_hInstance,parent,message,caption,
                            MB_YESNO|MB_ICONEXCLAMATION,arg)!=IDYES)
            return ret;

    }
    SHGetFolderLocation(parent,CSIDL_BITBUCKET,0,0,&recyclebin);
    for (; i<cidl; i++)
    {
        if(SUCCEEDED(TRASH_EraseItem(apidl[i])))
            SHChangeNotify(SHCNE_DELETE,SHCNF_IDLIST,
                           ILCombine(recyclebin,apidl[i]),0);
    }
    ILFree(recyclebin);
    return S_OK;
}
示例#11
0
    std::string PlatformWin::GetApplicationDataDirectory()
    {
        LPITEMIDLIST pidl;

        if (SHGetFolderLocation(0, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, &pidl) == S_OK)
        {
            char cpath[MAX_PATH];
            SHGetPathFromIDListA( pidl, cpath );
            CoTaskMemFree(pidl);

            return std::string(cpath) + "\\" + std::string(APPLICATION_NAME);
        }
        throw Exception("Failed to access application data directory.");
    }
示例#12
0
    std::wstring PlatformWin::GetUserDocumentsDirectoryW()
    {
        LPITEMIDLIST pidl;

        if (SHGetFolderLocation(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, 0, &pidl) == S_OK)
        {
            wchar_t cpath[MAX_PATH];
            SHGetPathFromIDListW( pidl, cpath );
            CoTaskMemFree(pidl);

            return std::wstring(cpath) + L"\\" + ToWString(std::string(APPLICATION_NAME));
        }
        throw Exception("Failed to access user documents directory.");
    }
示例#13
0
/*
**  Name:ingres_remove_shortcuts
**	
**  Description:
**	Removes shorcuts from current user account.
**
**  Inputs:
**	hInstall	Handle to the installation.
**
**  Outputs:
**	None.
**	Returns:
**	    ERROR_SUCCESS
**	Exceptions:
**	    None.
**
**  Side Effects:
**	None.
**
**  History:
**	18-Mar-2007 (drivi01)
**	    Created.
**	16-Jun-2008 (drivi01)
**	    Rename "Ingres 2006 Documentation" directory to 
**	    "Ingres Documentation 9.2".
**	14-Nov-2008 (Drivi01)
**	    Update routine to pull documentation version from
**	    commonmm.c.
*/
UINT __stdcall 
ingres_remove_shortcuts(MSIHANDLE hInstall) 
{
	char pathBuf[MAX_PATH];
	char szPath[MAX_PATH], szPath2[MAX_PATH];	
	LPITEMIDLIST pidlProg, pidlComProg;

    	SHGetFolderLocation(NULL, CSIDL_PROGRAMS, NULL, 0, &pidlProg);
    	SHGetPathFromIDList(pidlProg, szPath);
	SHGetFolderLocation(NULL, CSIDL_COMMON_PROGRAMS, NULL, 0, &pidlComProg);
    	SHGetPathFromIDList(pidlComProg, szPath2);
	sprintf(pathBuf, "%s\\Ingres\\Ingres Documentation %s", szPath, ING_VERS);
	if (GetFileAttributes(pathBuf) != -1)
	{
		if (RemoveOneDir(pathBuf))
			SHChangeNotify(SHCNE_RMDIR, SHCNF_PATH, pathBuf, 0);
	}

	MsiSetTargetPath(hInstall, "ProgramMenuFolder", szPath2);

	return ERROR_SUCCESS;
	

}
示例#14
0
HRESULT CBandSiteMenu::_CreateBuiltInISFBand(UINT uID, REFIID riid, void** ppv)
{
    LPITEMIDLIST pidl;
    HRESULT hr;

    switch (uID)
    {
        case IDM_TASKBAR_TOOLBARS_DESKTOP:
        {
            if (m_DesktopPidl != NULL)
                m_DesktopPidl.Free();

            hr = SHGetFolderLocation(0, CSIDL_DESKTOP, NULL, 0, &m_DesktopPidl);
            if (FAILED_UNEXPECTEDLY(hr))
                return hr;

            pidl = m_DesktopPidl;
            break;
        }
        case IDM_TASKBAR_TOOLBARS_QUICKLAUNCH:
        {
            pidl = _GetQLaunchPidl(true);
            break;
        }
    }

    if (pidl == NULL)
        return E_FAIL;

    CComPtr<IShellFolderBand> pISFB;
    hr = CISFBand_CreateInstance(IID_IShellFolderBand, (PVOID*)&pISFB);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    hr = pISFB->InitializeSFB(NULL, pidl);
    if (FAILED_UNEXPECTEDLY(hr))
        return hr;

    /* HACK! We shouldn't pass ISFB_STATE_QLINKSMODE and CISFBand shouldn't handle it! */
    if (uID == IDM_TASKBAR_TOOLBARS_QUICKLAUNCH)
    {
        BANDINFOSFB bisfb = {ISFB_MASK_STATE, ISFB_STATE_QLINKSMODE, ISFB_STATE_QLINKSMODE};
        pISFB->SetBandInfoSFB(&bisfb);
    }

    return pISFB->QueryInterface(riid, ppv);
}
示例#15
0
static String _GetProfilePath()
{
  String sPath;

  ITEMIDLIST* pidl;
  HRESULT hr = SHGetFolderLocation(NULL, CSIDL_APPDATA, NULL, 0, &pidl);
  if (hr == S_OK) {
    TCHAR szPath[MAX_PATH];
    if (SHGetPathFromIDList(pidl, szPath)) {
      sPath = szPath;
      sPath.makeTrailingSlash();
    }
    CoTaskMemFree(pidl);
  }

  return sPath;
}
示例#16
0
BOOL
SaveRdpSettingsToFile(LPWSTR lpFile,
                      PRDPSETTINGS pRdpSettings)
{
    WCHAR pszPath[MAX_PATH];
    HANDLE hFile;
    BOOL bRet = FALSE;

    /* use default file */
    if (lpFile == NULL)
    {
        HRESULT hr;
        LPITEMIDLIST lpidl= NULL;

        hr = SHGetFolderLocation(NULL,
                                 CSIDL_PERSONAL,
                                 NULL,
                                 0,
                                 &lpidl);
        if (hr == S_OK)
        {
            if (SHGetPathFromIDListW(lpidl, pszPath))
            {
                wcscat(pszPath, L"\\Default.rdp");
                lpFile = pszPath;
                CoTaskMemFree(lpidl);
            }
        }
    }

    if (lpFile)
    {
        hFile = OpenRdpFile(lpFile, TRUE);
        if (hFile)
        {
            if (WriteRdpFile(hFile, pRdpSettings))
            {
                bRet = TRUE;
            }

            CloseRdpFile(hFile);
        }
    }

    return bRet;
}
示例#17
0
/*fid:
CSIDL_BITBUCKET   回收站    
CSIDL_CONTROLS   控制面板    
CSIDL_DESKTOP   Windows   桌面Desktop    
CSIDL_DESKTOPDIRECTORY   Desktop的目录    
CSIDL_DRIVES   我的电脑    
CSIDL_FONTS   字体目录    
CSIDL_NETHOOD   网上邻居    
CSIDL_NETWORK   网上邻居虚拟目录    
CSIDL_PERSONAL   我的文档    
CSIDL_PRINTERS   打印机    
CSIDL_PROGRAMS   程序组    
CSIDL_RECENT   最近打开的文档    
CSIDL_SENDTO   “发送到”菜单项    
CSIDL_STARTMENU   任务条启动菜单项    
CSIDL_STARTUP   启动目录    
CSIDL_TEMPLATES   文档模板
*/
CString GetSysFolderPath(int fid)
{
	CString path;
	LPITEMIDLIST pidl=0;
	HRESULT hr = SHGetFolderLocation(NULL,fid,NULL,NULL,&pidl);
	if (pidl)
	{
		TCHAR fpath[MAX_PATH]={0};
		if(SHGetPathFromIDList(pidl,fpath))
		{
			TCHAR ffpath[MAX_PATH]={0};
			GetShortPathName(fpath,ffpath,MAX_PATH);
			path = ffpath;
		}
	}
	return path;
}
示例#18
0
BOOL IsNamespaceRoot(LPCITEMIDLIST pidl)
{
	LPITEMIDLIST pidlDesktop	= NULL;
	BOOL bNamespaceRoot			= FALSE;
	HRESULT hr;

	hr = SHGetFolderLocation(NULL,CSIDL_DESKTOP,NULL,0,&pidlDesktop);

	if(SUCCEEDED(hr))
	{
		bNamespaceRoot = CompareIdls(pidl,pidlDesktop);

		CoTaskMemFree(pidlDesktop);
	}

	return bNamespaceRoot;
}
示例#19
0
char *askcdstring(const char *question, const char *default_str)
{
    LPMALLOC g_pMalloc;
    BROWSEINFO bi;
    LPITEMIDLIST pidlBrowse;
    browserInfo info;
    OSVERSIONINFOEX osvi;

    strncpy(info.question, question, 40);
    strncpy(info.default_str, default_str, MAX_PATH);

    /* Get the shell's allocator. */
    if (!SUCCEEDED(SHGetMalloc(&g_pMalloc))) return NULL;

    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
    GetVersionEx((OSVERSIONINFO *)&osvi);

    ZeroMemory(&bi, sizeof(bi));
    bi.hwndOwner = 0;
    if(osvi.dwMajorVersion >= 6) { /* future proof */
	/* CSIDL_DESKTOP gets mapped to the User's desktop in Vista
	   (a bug).  SHGetFolderLocation is Win2k or later */
	if (!SUCCEEDED(SHGetFolderLocation(NULL, CSIDL_DRIVES, NULL, 0,
					   (LPITEMIDLIST *) &bi.pidlRoot)))
	    return NULL;
    }  /* else it is 0, which is CSIDL_DESKTOP */
    bi.pszDisplayName = strbuf;
    bi.lpszTitle = question;
    bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI;
    bi.lpfn = (BFFCALLBACK) InitBrowseCallbackProc;
    bi.lParam = (LPARAM) &info;

    /* Browse for a folder and return its PIDL. */
    pidlBrowse = SHBrowseForFolder(&bi);
    if (pidlBrowse != NULL) {
	SHGetPathFromIDList(pidlBrowse, strbuf);
	g_pMalloc->lpVtbl->Free(g_pMalloc, pidlBrowse);
	if (strbuf[0])
	    return strbuf;
    }
    return NULL;
}
示例#20
0
bool OsShell::recycleBinContextMenu(int xPos, int yPos, void *parentWindow)
{
	ComInitializer comInitializer;

	PIDLIST_ABSOLUTE idlist = 0;
	if (!SUCCEEDED(SHGetFolderLocation(0, CSIDL_BITBUCKET, 0, 0, &idlist)))
		return false;

	IShellFolder * iFolder = 0;
	LPCITEMIDLIST list;
	HRESULT result = SHBindToParent(idlist, IID_IShellFolder, (void**)&iFolder, &list);
	if (!SUCCEEDED(result) || !list || !iFolder)
		return false;

	IContextMenu * imenu = 0;
	result = iFolder->GetUIObjectOf((HWND)parentWindow, 1u, &list, IID_IContextMenu, 0, (void**)&imenu);
	CoTaskMemFree(idlist);
	if (!SUCCEEDED(result) || !imenu)
		return false;
	CComInterfaceReleaser menuReleaser(imenu);

	HMENU hMenu = CreatePopupMenu();
	if (!hMenu)
		return false;
	if (SUCCEEDED(imenu->QueryContextMenu(hMenu, 0, 1, 0x7FFF, CMF_NORMAL)))
	{
		int iCmd = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, xPos, yPos, (HWND)parentWindow, NULL);
		if (iCmd > 0)
		{
			CMINVOKECOMMANDINFOEX info = { 0 };
			info.cbSize = sizeof(info);
			info.fMask = CMIC_MASK_UNICODE;
			info.hwnd = (HWND)parentWindow;
			info.lpVerb  = MAKEINTRESOURCEA(iCmd - 1);
			info.lpVerbW = MAKEINTRESOURCEW(iCmd - 1);
			info.nShow = SW_SHOWNORMAL;
			imenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
		}
	}
	DestroyMenu(hMenu);
	return true;
}
void CMyTreeView::AddDrive(const TCHAR *szDrive)
{
	LPITEMIDLIST	pidlMyComputer = NULL;
	HTREEITEM		hMyComputer;
	HRESULT			hr;

	hr = SHGetFolderLocation(NULL,CSIDL_DRIVES,NULL,0,&pidlMyComputer);

	if(hr == S_OK)
	{
		hMyComputer = LocateExistingItem(pidlMyComputer);

		if(hMyComputer != NULL)
		{
			AddItemInternal(hMyComputer,szDrive);
		}

		CoTaskMemFree(pidlMyComputer);
	}
}
示例#22
0
QString Application::UserDocumentsDirectory()
{
    QString qstr;
#ifdef _WINDOWS
    LPITEMIDLIST pidl;

    if (SHGetFolderLocation(0, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, 0, &pidl) != S_OK)
        return "";

    WCHAR str[MAX_PATH+1] = {};
    SHGetPathFromIDListW(pidl, str);
    CoTaskMemFree(pidl);

    qstr = WStringToQString(str) + '\\' + ApplicationName();
#else
    ///\todo Review. Is this desirable?
    qstr = UserDataDirectory();
#endif

    // Apply trailing slash
    if (!qstr.endsWith(QDir::separator()))
        qstr += QDir::separator();
    return qstr;
}
示例#23
0
int controlyPlugin::launchItem(QList<InputData>* id, CatItem* item)
{
	item = item; // Compiler warning

	if (id->count() == 1) {
		// no parameters, just the item itsef

		QString path = item->fullPath;

		if (path.contains(",@")) {
			// dll cpl item indexing containing items, e.g. 'main.cpl,@1'

			runProgram("control.exe", item->fullPath); //runProgram(cmd, args);
			// use toNativeSeparators()?
		} else if ((path.startsWith("csidl:", Qt::CaseInsensitive)) && (path.endsWith(".controly", Qt::CaseSensitive))) {
			// Constant special item ID list (CSIDL)

			// shell instance object (special shell extension folder), e.g. 'csidl:0x0014.controly' ('shellinstance:0x0014')
			QString folderId = path.mid(strlen("csidl:"), strlen(path.toAscii())-strlen("csidl:")-strlen(".controly")); // e.g. 0x0014 = CSIDL_FONTS;
			bool ok;
			int folderIdx = folderId.toLong(&ok, 16);
			if (ok) {
				LPITEMIDLIST pidl;
				HRESULT hres = SHGetFolderLocation(NULL, folderIdx, NULL, 0, &pidl);
				if (hres == S_OK) {
					SHELLEXECUTEINFO sei;
					memset(&sei, 0, sizeof(sei));
					sei.cbSize = sizeof(SHELLEXECUTEINFO);
					sei.fMask = SEE_MASK_IDLIST;
					sei.hwnd = NULL;
					sei.lpVerb = NULL;
					sei.lpFile = NULL;
					sei.lpParameters = NULL;
					sei.lpDirectory = NULL;
					sei.nShow = SW_SHOW;
					sei.hInstApp = NULL;
					sei.lpIDList = pidl;
					sei.hProcess = NULL;
					//it seems we don't need CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
					ShellExecuteEx(&sei);

					CoTaskMemFree((void*)pidl); // needs objbase.h/ole32.lib
				}
			}
		} else {
			// exe cpl item with command line parameters, e.g. 'rundll32.exe shell32.dll,Options_RunDLL 1'
			// or item defined via application name, e.g. 'control.exe /name Microsoft.WindowsUpdate'

			QStringList spl = path.split(".exe ");
			if (spl.size() == 2) {
				// split size currently is always 2, as assured above
				QString executable = spl[0] + ".exe";
				QString parameters = spl[1];
				runProgram(executable, parameters);
			} else {
				runProgram(path, "");
			}
		}

		return 1;
	}

	if (id->count() != 2)
		return 1;

	CatItem last = id->last().getTopResult();
	QSettings* set = *settings;
	if (set == NULL) return 1;
	if (last.shortName == "Options") {
		set->setValue("controly/OptionsCount", set->value("controly/OptionsCount",0).toInt() + 1);
		return MSG_CONTROL_OPTIONS;
	}
	else if (last.shortName == "Rebuild Index") {
		set->setValue("controly/RebuildCount", set->value("controly/RebuildCount",0).toInt() + 1);
		return MSG_CONTROL_REBUILD;
	}
	else if (last.shortName == "Exit") {
		set->setValue("controly/ExitCount", set->value("controly/ExitCount",0).toInt() + 1);
		return MSG_CONTROL_EXIT;
	}
	return 1;

}
示例#24
0
HRESULT DecodeFriendlyPath(const TCHAR *szFriendlyPath,TCHAR *szParsingPath,UINT cchMax)
{
	LPITEMIDLIST pidl = NULL;
	TCHAR szName[MAX_PATH];

	SHGetFolderLocation(NULL,CSIDL_CONTROLS,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_CONTROLS,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_BITBUCKET,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_BITBUCKET,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_DRIVES,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_DRIVES,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_NETWORK,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_NETWORK,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_CONNECTIONS,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_CONNECTIONS,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_PRINTERS,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_PRINTERS,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_FAVORITES,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_FAVORITES,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_MYPICTURES,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_MYPICTURES,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_MYMUSIC,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_MYMUSIC,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	SHGetFolderLocation(NULL,CSIDL_MYVIDEO,NULL,0,&pidl);
	GetDisplayName(pidl,szName,SIZEOF_ARRAY(szName),SHGDN_INFOLDER);
	CoTaskMemFree(pidl);

	if(lstrcmpi(szName,szFriendlyPath) == 0)
	{
		GetCsidlDisplayName(CSIDL_MYVIDEO,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	if(CompareString(LOCALE_INVARIANT,NORM_IGNORECASE,
		FRIENDLY_NAME_DESKTOP,-1,szFriendlyPath,-1) == CSTR_EQUAL)
	{
		GetCsidlDisplayName(CSIDL_DESKTOP,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	if(CompareString(LOCALE_INVARIANT,NORM_IGNORECASE,
		FRIENDLY_NAME_PICTURES,-1,szFriendlyPath,-1) == CSTR_EQUAL)
	{
		GetCsidlDisplayName(CSIDL_MYPICTURES,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	if(CompareString(LOCALE_INVARIANT,NORM_IGNORECASE,
		FRIENDLY_NAME_MUSIC,-1,szFriendlyPath,-1) == CSTR_EQUAL)
	{
		GetCsidlDisplayName(CSIDL_MYMUSIC,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	if(CompareString(LOCALE_INVARIANT,NORM_IGNORECASE,
		FRIENDLY_NAME_VIDEOS,-1,szFriendlyPath,-1) == CSTR_EQUAL)
	{
		GetCsidlDisplayName(CSIDL_MYVIDEO,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	if(CompareString(LOCALE_INVARIANT,NORM_IGNORECASE,
		FRIENDLY_NAME_DOCUMENTS,-1,szFriendlyPath,-1) == CSTR_EQUAL)
	{
		GetCsidlDisplayName(CSIDL_MYDOCUMENTS,szParsingPath,cchMax,SHGDN_FORPARSING);
		return S_OK;
	}

	return E_FAIL;
}
示例#25
0
HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
{
    WCHAR szPath[MAX_PATH] = {0}, szBuffer[MAX_PATH];
    DWORD dwSize, dwType, count;
    LONG ret;
    IShellFolder *pDesktop, *pRecycleBin;
    PIDLIST_ABSOLUTE pidlRecycleBin;
    PITEMID_CHILD pidl;
    HRESULT hr = S_OK;
    LPENUMIDLIST penumFiles;
    STRRET StrRet;

    TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags);

    if (!(dwFlags & SHERB_NOCONFIRMATION))
    {
        hr = SHGetDesktopFolder(&pDesktop);
        if (FAILED(hr))
            return hr;
        hr = SHGetFolderLocation(NULL, CSIDL_BITBUCKET, NULL, 0, &pidlRecycleBin);
        if (FAILED(hr))
        {
            pDesktop->Release();
            return hr;
        }
        hr = pDesktop->BindToObject(pidlRecycleBin, NULL, IID_PPV_ARG(IShellFolder, &pRecycleBin));
        CoTaskMemFree(pidlRecycleBin);
        pDesktop->Release();
        if (FAILED(hr))
            return hr;
        hr = pRecycleBin->EnumObjects(hwnd, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penumFiles);
        if (FAILED(hr))
        {
            pRecycleBin->Release();
            return hr;
        }

        count = 0;
        if (hr != S_FALSE)
        {
            while (penumFiles->Next(1, &pidl, NULL) == S_OK)
            {
                count++;
                pRecycleBin->GetDisplayNameOf(pidl, SHGDN_NORMAL, &StrRet);
                StrRetToBuf(&StrRet, pidl, szBuffer, _countof(szBuffer));
                CoTaskMemFree(pidl);
            }
            penumFiles->Release();
        }
        pRecycleBin->Release();

        switch (count)
        {
            case 0:
                /* no files, don't need confirmation */
                break;

            case 1:
                /* we have only one item inside the bin, so show a message box with its name */
                if (ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_DELETEITEM_TEXT), MAKEINTRESOURCEW(IDS_EMPTY_BITBUCKET),
                                   MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2, szBuffer) == IDNO)
                {
                    return S_OK;
                }
                break;

            default:
                /* we have more than one item, so show a message box with the count of the items */
                StringCbPrintfW(szBuffer, sizeof(szBuffer), L"%u", count);
                if (ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_DELETEMULTIPLE_TEXT), MAKEINTRESOURCEW(IDS_EMPTY_BITBUCKET),
                                   MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2, szBuffer) == IDNO)
                {
                    return S_OK;
                }
                break;
        }
    }

    if (dwFlags & SHERB_NOPROGRESSUI)
    {
        ret = EmptyRecycleBinW(pszRootPath);
    }
    else
    {
       /* FIXME
        * show a progress dialog
        */
        ret = EmptyRecycleBinW(pszRootPath);
    }

    if (!ret)
        return HRESULT_FROM_WIN32(GetLastError());

    if (!(dwFlags & SHERB_NOSOUND))
    {
        dwSize = sizeof(szPath);
        ret = RegGetValueW(HKEY_CURRENT_USER,
                           L"AppEvents\\Schemes\\Apps\\Explorer\\EmptyRecycleBin\\.Current",
                           NULL,
                           RRF_RT_REG_SZ,
                           &dwType,
                           (PVOID)szPath,
                           &dwSize);
        if (ret != ERROR_SUCCESS)
            return S_OK;

        if (dwType != REG_EXPAND_SZ) /* type dismatch */
            return S_OK;

        szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
        PlaySoundW(szPath, NULL, SND_FILENAME);
    }
    return S_OK;
}
示例#26
0
static
VOID
TestCommandLine(
_In_ INT ExpectedRet,
_In_ INT ExpectedCsidl,
_In_ DWORD ExpectedFlags,
_In_ PCWSTR ExpectedFileName,
_In_ PCWSTR PidlPath,
_Out_opt_ PUINT PWriteEnd)
{
    EXPLORER_INFO Info;
    UINT Ret;
    ULONG i;
    PDWORD InfoWords = (PDWORD) &Info;

    FillMemory(&Info, sizeof(Info), 0x55);
    Info.dwFlags = 0x00000000;
    Ret = SHExplorerParseCmdLine(&Info);

    // Special case for empty cmdline: Ret is the PIDL for the selected folder.
    if (ExpectedRet == -1)
        ok((LPITEMIDLIST) Ret == Info.pidl, "Ret = %x, expected %p\n", Ret, Info.pidl);
    else
        ok(Ret == ExpectedRet, "Ret = %x, expected %p\n", Ret, (PVOID) ExpectedRet);

    if (ExpectedFileName == NULL)
        ok(Info.FileName == InvalidPointer, "FileName = %p\n", Info.FileName);
    else
    {
        ok(Info.FileName != NULL && Info.FileName != InvalidPointer, "FileName = %p\n", Info.FileName);
        if (Info.FileName != NULL && Info.FileName != InvalidPointer)
        {
            ok(!wcscmp(Info.FileName, ExpectedFileName), "FileName = %ls, expected %ls\n", Info.FileName, ExpectedFileName);
            LocalFree(Info.FileName);
        }
    }

    ok(Info.dwFlags == ExpectedFlags, "dwFlags = %08lx, expected %08lx\n", Info.dwFlags, ExpectedFlags);

    if (ExpectedCsidl == PIDL_IS_UNTOUCHED)
        ok(Info.pidl == InvalidPointer, "pidl = %p\n", Info.pidl);
    else if (ExpectedCsidl == PIDL_IS_NULL)
        ok(Info.pidl == NULL, "pidl = %p\n", Info.pidl);
    else
    {
        PIDLIST_ABSOLUTE ExpectedPidl;
        HRESULT hr;

        ok(Info.pidl != NULL, "pidl = %p\n", Info.pidl);
        if (Info.pidl != NULL && Info.pidl != InvalidPointer)
        {
            WCHAR pidlPathName[MAX_PATH] = L"";

            if (Info.pidl != NULL && Info.pidl != (LPITEMIDLIST) 0x55555555)
            {
                SHGetPathFromIDListW(Info.pidl, pidlPathName);
            }

            if (ExpectedCsidl == PIDL_PATH_EQUALS_PATH)
            {
                ok(wcsicmp(pidlPathName, PidlPath) == 0, "Path from pidl does not match; pidlPathName=%S\n", pidlPathName);
            }
            else if (ExpectedCsidl == PIDL_IS_EMPTY)
            {
                ok(wcslen(pidlPathName) == 0, "Unexpected non-empty path from pidl; pidlPathName=%S\n", pidlPathName);
            }
            else
            {
                if (ExpectedCsidl == PIDL_IS_PATH)
                {
                    ExpectedPidl = SHSimpleIDListFromPath(PidlPath);
                    hr = ExpectedPidl == NULL ? E_FAIL : S_OK;
                    ok(ExpectedPidl != NULL, "SHSimpleIDListFromPath(%S) failed. pidlPathName=%S\n", PidlPath, pidlPathName);
                    if (SUCCEEDED(hr))
                    {
                        ok(ILIsEqual(Info.pidl, ExpectedPidl), "Unexpected pidl value %p; pidlPathName=%S PidlPath=%S\n", Info.pidl, pidlPathName, PidlPath);
                        ILFree(ExpectedPidl);
                    }
                }
                else
                {
                    hr = SHGetFolderLocation(NULL, ExpectedCsidl, NULL, 0, &ExpectedPidl);
                    ok(hr == S_OK, "SHGetFolderLocation returned %08lx\n", hr);
                    if (SUCCEEDED(hr))
                    {
                        BOOL eq = ILIsEqual(Info.pidl, ExpectedPidl);
                        ILFree(ExpectedPidl);

                        ok(eq, "Unexpected pidl value %p; pidlPathName=%S CSIDL=%d\n", Info.pidl, pidlPathName, ExpectedCsidl);
                    }
                }
            }

            if (Info.pidl != NULL && Info.pidl != (LPITEMIDLIST) 0x55555555)
                ILFree(Info.pidl);
        }
    }

    for (i = 0; i < sizeof(Info) / sizeof(DWORD); i++)
    {
        switch (i*4)
        {
        case 0x00: // FileName
        case 0x04: // pidl
        case 0x08: // dwFlags
        case 0x20: // pidlRoot
        case 0x34: // guidInproc (1/4)
        case 0x38: // guidInproc (2/4)
        case 0x3C: // guidInproc (3/4)
        case 0x40: // guidInproc (4/4)
            break;
        default:
            ok(InfoWords[i] == 0x55555555, "Word 0x%02lx has been set to 0x%08lx\n", i * 4, InfoWords[i]);
        }
    }

    if (PWriteEnd)
    {
        PBYTE data = (PBYTE)&Info;

        *PWriteEnd = 0;

        for (i = sizeof(Info); i > 0; i--)
        {
            if (data[i - 1] != 0x55)
            {
                *PWriteEnd = i;
                break;
            }
        }
    }
}
static
VOID
TestCommandLine(
    _In_ INT ExpectedRet,
    _In_ INT ExpectedCsidl,
    _In_ DWORD ExpectedFlags,
    _In_ PCWSTR ExpectedFileName,
    _In_ PCWSTR PidlPath)
{
    EXPLORER_INFO Info;
    PVOID Ret;
    ULONG i;

    FillMemory(&Info, sizeof(Info), 0x55);
    Info.dwFlags = 0x00000000;
    Ret = SHExplorerParseCmdLine(&Info);

    if (ExpectedRet == -1)
        ok(Ret == Info.pidl, "Ret = %p, expected %p\n", Ret, Info.pidl);
    else
        ok(Ret == (PVOID)ExpectedRet, "Ret = %p, expected %p\n", Ret, (PVOID)ExpectedRet);

    if (ExpectedFileName == NULL)
        ok(Info.FileName == InvalidPointer, "FileName = %p\n", Info.FileName);
    else
    {
        ok(Info.FileName != NULL && Info.FileName != InvalidPointer, "FileName = %p\n", Info.FileName);
        if (Info.FileName != NULL && Info.FileName != InvalidPointer)
        {
            ok(!wcscmp(Info.FileName, ExpectedFileName), "FileName = %ls, expected %ls\n", Info.FileName, ExpectedFileName);
            LocalFree(Info.FileName);
        }
    }

    if (ExpectedCsidl == PIDL_IS_UNTOUCHED)
        ok(Info.pidl == InvalidPointer, "pidl = %p\n", Info.pidl);
    else if (ExpectedCsidl == PIDL_IS_NULL)
        ok(Info.pidl == NULL, "pidl = %p\n", Info.pidl);
    else
    {
        PIDLIST_ABSOLUTE ExpectedPidl;
        HRESULT hr;

        ok(Info.pidl != NULL, "pidl = %p\n", Info.pidl);
        if (Info.pidl != NULL && Info.pidl != InvalidPointer)
        {
            if (ExpectedCsidl == PIDL_IS_PATH)
            {
                ExpectedPidl = SHSimpleIDListFromPath(PidlPath);
                hr = ExpectedPidl == NULL ? E_FAIL : S_OK;
                ok(ExpectedPidl != NULL, "SHSimpleIDListFromPath failed\n");
            }
            else
            {
                hr = SHGetFolderLocation(NULL, ExpectedCsidl, NULL, 0, &ExpectedPidl);
                ok(hr == S_OK, "SHGetFolderLocation returned %08lx\n", hr);
            }
            if (SUCCEEDED(hr))
            {
                ok(ILIsEqual(Info.pidl, ExpectedPidl), "Unexpected pidl value\n");
                ILFree(ExpectedPidl);
            }
            ILFree(Info.pidl);
        }
    }

    ok(Info.dwFlags == ExpectedFlags, "dwFlags = %08lx, expected %08lx\n", Info.dwFlags, ExpectedFlags);
    for (i = 0; i < sizeof(Info.Unknown) / sizeof(Info.Unknown[0]); i++)
        ok(Info.Unknown[i] == 0x55555555, "Unknown[%lu] = %08lx\n", i, Info.Unknown[i]);
}