Source code of Windows XP (NT5)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
//+-------------------------------------------------------------------------
//
// Microsoft Windows
//
// Copyright (C) Microsoft Corporation, 1997 - 1999
//
// File: idlhelp.cpp
//
//--------------------------------------------------------------------------
#include "pch.h"
#pragma hdrstop
#include <shsemip.h> // ILFree(), etc
#include "idlhelp.h"
#include "folder.h"
HRESULT IsOfflineFilesFolderID( LPCITEMIDLIST pidl ) { LPITEMIDLIST pidlOfflineFilesFolder; HRESULT hr = COfflineFilesFolder::CreateIDList(&pidlOfflineFilesFolder); if (SUCCEEDED(hr)) { if (ILIsEqual(pidlOfflineFilesFolder, pidl)) hr = S_OK; else hr = S_FALSE;
ILFree(pidlOfflineFilesFolder); } return hr; }
HRESULT BindToObject( IShellFolder *psf, REFIID riid, LPCITEMIDLIST pidl, void **ppvOut ) { HRESULT hr = NOERROR; IShellFolder *psfRelease = NULL;
if (!psf) { hr = SHGetDesktopFolder(&psf); if (SUCCEEDED(hr)) { psfRelease = psf; } }
if (SUCCEEDED(hr)) { if (!pidl || ILIsEmpty(pidl)) hr = psf->QueryInterface(riid, ppvOut); else hr = psf->BindToObject(pidl, NULL, riid, ppvOut); }
if (psfRelease) psfRelease->Release();
return hr; }
HRESULT BindToIDListParent( LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast ) { HRESULT hr;
LPITEMIDLIST pidlParent = ILClone(pidl); if (pidlParent) { ILRemoveLastID(pidlParent); hr = ::BindToObject(NULL, riid, (LPCITEMIDLIST)pidlParent, ppv); if (SUCCEEDED(hr)) { if (ppidlLast) *ppidlLast = ILFindLastID(pidl); } ILFree(pidlParent); } else hr = E_OUTOFMEMORY;
return hr; }
|