ReactOS  0.4.13-dev-544-gede3fdd
shellpath.c File Reference
#include <wine/config.h>
#include <windef.h>
#include <winbase.h>
#include <shlobj.h>
#include <undocshell.h>
#include <shlwapi.h>
#include <sddl.h>
#include <strsafe.h>
#include <wine/debug.h>
#include <wine/unicode.h>
#include <shlwapi_undoc.h>
#include <userenv.h>
#include "pidl.h"
#include "shell32_main.h"
#include "shresdef.h"
Include dependency graph for shellpath.c:

Go to the source code of this file.

Classes

struct  CSIDL_DATA
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COBJMACROS
 
#define CSIDL_CONTACTS   0x0043
 
#define CSIDL_DOWNLOADS   0x0047
 
#define CSIDL_LINKS   0x004d
 
#define CSIDL_APPDATA_LOCALLOW   0x004e
 
#define CSIDL_SAVED_GAMES   0x0062
 
#define CSIDL_SEARCHES   0x0063
 

Typedefs

typedef enum _CSIDL_Type CSIDL_Type
 

Enumerations

enum  _CSIDL_Type {
  CSIDL_Type_User, CSIDL_Type_AllUsers, CSIDL_Type_CurrVer, CSIDL_Type_Disallowed,
  CSIDL_Type_NonExistent, CSIDL_Type_WindowsPath, CSIDL_Type_SystemPath, CSIDL_Type_SystemX86Path
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
BOOL WINAPI PathAppendAW (LPVOID lpszPath1, LPCVOID lpszPath2)
 
static LPSTR PathGetExtensionA (LPCSTR lpszPath)
 
static LPWSTR PathGetExtensionW (LPCWSTR lpszPath)
 
LPVOID WINAPI SHPathGetExtensionW (LPCWSTR lpszPath, DWORD void1, DWORD void2)
 
BOOL WINAPI PathRemoveFileSpecAW (LPVOID lpszPath)
 
static void PathGetShortPathA (LPSTR pszPath)
 
static void PathGetShortPathW (LPWSTR pszPath)
 
VOID WINAPI PathGetShortPathAW (LPVOID pszPath)
 
BOOL WINAPI PathIsRootAW (LPCVOID lpszPath)
 
static BOOL PathIsExeA (LPCSTR lpszPath)
 
BOOL PathIsExeW (LPCWSTR lpszPath)
 
BOOL WINAPI PathIsExeAW (LPCVOID path)
 
BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
 
BOOL WINAPI IsLFNDriveA (LPCSTR lpszPath)
 
BOOL WINAPI IsLFNDriveW (LPCWSTR lpszPath)
 
BOOL WINAPI IsLFNDriveAW (LPCVOID lpszPath)
 
static BOOL PathMakeUniqueNameA (LPSTR lpszBuffer, DWORD dwBuffSize, LPCSTR lpszShortName, LPCSTR lpszLongName, LPCSTR lpszPathName)
 
static BOOL PathMakeUniqueNameW (LPWSTR lpszBuffer, DWORD dwBuffSize, LPCWSTR lpszShortName, LPCWSTR lpszLongName, LPCWSTR lpszPathName)
 
BOOL WINAPI PathMakeUniqueNameAW (LPVOID lpszBuffer, DWORD dwBuffSize, LPCVOID lpszShortName, LPCVOID lpszLongName, LPCVOID lpszPathName)
 
BOOL WINAPI PathYetAnotherMakeUniqueName (LPWSTR buffer, LPCWSTR path, LPCWSTR shortname, LPCWSTR longname)
 
int WINAPI PathCleanupSpec (LPCWSTR lpszPathW, LPWSTR lpszFileW)
 
static BOOL PathQualifyA (LPCSTR pszPath)
 
static BOOL PathQualifyW (LPCWSTR pszPath)
 
BOOL WINAPI PathQualifyAW (LPCVOID pszPath)
 
static BOOL PathResolveA (LPSTR path, LPCSTR *paths, DWORD flags)
 
static BOOL PathResolveW (LPWSTR path, LPCWSTR *paths, DWORD flags)
 
BOOL WINAPI PathResolveAW (LPVOID path, LPCVOID *paths, DWORD flags)
 
static LONG PathProcessCommandA (LPCSTR lpszPath, LPSTR lpszBuff, DWORD dwBuffSize, DWORD dwFlags)
 
static LONG PathProcessCommandW (LPCWSTR lpszPath, LPWSTR lpszBuff, DWORD dwBuffSize, DWORD dwFlags)
 
LONG WINAPI PathProcessCommandAW (LPCVOID lpszPath, LPVOID lpszBuff, DWORD dwBuffSize, DWORD dwFlags)
 
static HRESULT _SHExpandEnvironmentStrings (LPCWSTR szSrc, LPWSTR szDest)
 
static HRESULT _SHGetUserShellFolderPath (HKEY rootKey, LPCWSTR userPrefix, LPCWSTR value, LPWSTR path)
 
BOOL _SHGetUserProfileDirectoryW (HANDLE hToken, LPWSTR szPath, LPDWORD lpcchPath)
 
static HRESULT _SHGetDefaultValue (BYTE folder, LPWSTR pszPath)
 
static HRESULT _SHGetCurrentVersionPath (DWORD dwFlags, BYTE folder, LPWSTR pszPath)
 
static LPWSTR _GetUserSidStringFromToken (HANDLE Token)
 
static HRESULT _SHGetUserProfilePath (HANDLE hToken, DWORD dwFlags, BYTE folder, LPWSTR pszPath)
 
static HRESULT _SHGetAllUsersProfilePath (DWORD dwFlags, BYTE folder, LPWSTR pszPath)
 
static HRESULT _SHOpenProfilesKey (PHKEY pKey)
 
static HRESULT _SHGetProfilesValue (HKEY profilesKey, LPCWSTR szValueName, LPWSTR szValue, LPCWSTR szDefault)
 
HRESULT WINAPI SHGetFolderPathW (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
 
HRESULT WINAPI SHGetFolderPathAndSubDirA (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCSTR pszSubPath, LPSTR pszPath)
 
HRESULT WINAPI SHGetFolderPathAndSubDirW (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
 
HRESULT WINAPI SHGetFolderPathA (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath)
 
static HRESULT _SHRegisterFolders (HKEY hRootKey, HANDLE hToken, LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[], UINT foldersLen)
 
static HRESULT _SHRegisterUserShellFolders (BOOL bDefault)
 
static HRESULT _SHRegisterCommonShellFolders (void)
 
HRESULT SHELL_RegisterShellFolders (void)
 
BOOL WINAPI SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR szPath, int nFolder, BOOL bCreate)
 
BOOL WINAPI SHGetSpecialFolderPathW (HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
 
HRESULT WINAPI SHGetFolderLocation (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
 
HRESULT WINAPI SHGetSpecialFolderLocation (HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
 

Variables

static const BOOL is_win64 = sizeof(void *) > sizeof(int)
 
static const WCHAR szCurrentVersion [] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0'}
 
static const WCHAR Administrative_ToolsW [] = {'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}
 
static const WCHAR AppDataW [] = {'A','p','p','D','a','t','a','\0'}
 
static const WCHAR AppData_LocalLowW [] = {'A','p','p','D','a','t','a','\\','L','o','c','a','l','L','o','w','\0'}
 
static const WCHAR Application_DataW [] = {'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}
 
static const WCHAR CacheW [] = {'C','a','c','h','e','\0'}
 
static const WCHAR CD_BurningW [] = {'C','D',' ','B','u','r','n','i','n','g','\0'}
 
static const WCHAR Common_Administrative_ToolsW [] = {'C','o','m','m','o','n',' ','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}
 
static const WCHAR Common_AppDataW [] = {'C','o','m','m','o','n',' ','A','p','p','D','a','t','a','\0'}
 
static const WCHAR Common_DesktopW [] = {'C','o','m','m','o','n',' ','D','e','s','k','t','o','p','\0'}
 
static const WCHAR Common_DocumentsW [] = {'C','o','m','m','o','n',' ','D','o','c','u','m','e','n','t','s','\0'}
 
static const WCHAR Common_FavoritesW [] = {'C','o','m','m','o','n',' ','F','a','v','o','r','i','t','e','s','\0'}
 
static const WCHAR CommonFilesDirW [] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r','\0'}
 
static const WCHAR CommonFilesDirX86W [] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}
 
static const WCHAR CommonMusicW [] = {'C','o','m','m','o','n','M','u','s','i','c','\0'}
 
static const WCHAR CommonPicturesW [] = {'C','o','m','m','o','n','P','i','c','t','u','r','e','s','\0'}
 
static const WCHAR Common_ProgramsW [] = {'C','o','m','m','o','n',' ','P','r','o','g','r','a','m','s','\0'}
 
static const WCHAR Common_StartUpW [] = {'C','o','m','m','o','n',' ','S','t','a','r','t','U','p','\0'}
 
static const WCHAR Common_Start_MenuW [] = {'C','o','m','m','o','n',' ','S','t','a','r','t',' ','M','e','n','u','\0'}
 
static const WCHAR Common_TemplatesW [] = {'C','o','m','m','o','n',' ','T','e','m','p','l','a','t','e','s','\0'}
 
static const WCHAR CommonVideoW [] = {'C','o','m','m','o','n','V','i','d','e','o','\0'}
 
static const WCHAR ContactsW [] = {'C','o','n','t','a','c','t','s','\0'}
 
static const WCHAR CookiesW [] = {'C','o','o','k','i','e','s','\0'}
 
static const WCHAR DesktopW [] = {'D','e','s','k','t','o','p','\0'}
 
static const WCHAR DocumentsW [] = {'D','o','c','u','m','e','n','t','s','\0'}
 
static const WCHAR DownloadsW [] = {'D','o','w','n','l','o','a','d','s','\0'}
 
static const WCHAR FavoritesW [] = {'F','a','v','o','r','i','t','e','s','\0'}
 
static const WCHAR FontsW [] = {'F','o','n','t','s','\0'}
 
static const WCHAR HistoryW [] = {'H','i','s','t','o','r','y','\0'}
 
static const WCHAR LinksW [] = {'L','i','n','k','s','\0'}
 
static const WCHAR Local_AppDataW [] = {'L','o','c','a','l',' ','A','p','p','D','a','t','a','\0'}
 
static const WCHAR Local_Settings_Application_DataW [] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}
 
static const WCHAR Local_Settings_CD_BurningW [] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\\','M','i','c','r','o','s','o','f','t','\\','C','D',' ','B','u','r','n','i','n','g','\0'}
 
static const WCHAR Local_Settings_HistoryW [] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','H','i','s','t','o','r','y','\0'}
 
static const WCHAR Local_Settings_Temporary_Internet_FilesW [] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','T','e','m','p','o','r','a','r','y',' ','I','n','t','e','r','n','e','t',' ','F','i','l','e','s','\0'}
 
static const WCHAR Microsoft_Windows_GameExplorerW [] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','G','a','m','e','E','x','p','l','o','r','e','r','\0'}
 
static const WCHAR Microsoft_Windows_LibrariesW [] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','L','i','b','r','a','r','i','e','s','\0'}
 
static const WCHAR Microsoft_Windows_RingtonesW [] = {'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','R','i','n','g','t','o','n','e','s','\0'}
 
static const WCHAR MusicW [] = {'M','u','s','i','c','\0'}
 
static const WCHAR Music_PlaylistsW [] = {'M','u','s','i','c','\\','P','l','a','y','l','i','s','t','s','\0'}
 
static const WCHAR Music_Sample_MusicW [] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','M','u','s','i','c','\0'}
 
static const WCHAR Music_Sample_PlaylistsW [] = {'M','u','s','i','c','\\','S','a','m','p','l','e',' ','P','l','a','y','l','i','s','t','s','\0'}
 
static const WCHAR My_MusicW [] = {'M','y',' ','M','u','s','i','c','\0'}
 
static const WCHAR My_PicturesW [] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'}
 
static const WCHAR My_VideoW [] = {'M','y',' ','V','i','d','e','o','\0'}
 
static const WCHAR NetHoodW [] = {'N','e','t','H','o','o','d','\0'}
 
static const WCHAR OEM_LinksW [] = {'O','E','M',' ','L','i','n','k','s','\0'}
 
static const WCHAR PersonalW [] = {'P','e','r','s','o','n','a','l','\0'}
 
static const WCHAR PicturesW [] = {'P','i','c','t','u','r','e','s','\0'}
 
static const WCHAR Pictures_Sample_PicturesW [] = {'P','i','c','t','u','r','e','s','\\','S','a','m','p','l','e',' ','P','i','c','t','u','r','e','s','\0'}
 
static const WCHAR Pictures_Slide_ShowsW [] = {'P','i','c','t','u','r','e','s','\\','S','l','i','d','e',' ','S','h','o','w','s','\0'}
 
static const WCHAR PrintHoodW [] = {'P','r','i','n','t','H','o','o','d','\0'}
 
static const WCHAR Program_FilesW [] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\0'}
 
static const WCHAR Program_Files_Common_FilesW [] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\\','C','o','m','m','o','n',' ','F','i','l','e','s','\0'}
 
static const WCHAR Program_Files_x86W [] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s',' ','(','x','8','6',')','\0'}
 
static const WCHAR Program_Files_x86_Common_FilesW [] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s',' ','(','x','8','6',')','\\','C','o','m','m','o','n',' ','F','i','l','e','s','\0'}
 
static const WCHAR ProgramFilesDirW [] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r','\0'}
 
static const WCHAR ProgramFilesDirX86W [] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}
 
static const WCHAR ProgramsW [] = {'P','r','o','g','r','a','m','s','\0'}
 
static const WCHAR PublicW [] = {'P','u','b','l','i','c',0}
 
static const WCHAR RecentW [] = {'R','e','c','e','n','t','\0'}
 
static const WCHAR ResourcesW [] = {'R','e','s','o','u','r','c','e','s','\0'}
 
static const WCHAR Saved_GamesW [] = {'S','a','v','e','d',' ','G','a','m','e','s','\0'}
 
static const WCHAR SearchesW [] = {'S','e','a','r','c','h','e','s','\0'}
 
static const WCHAR SendToW [] = {'S','e','n','d','T','o','\0'}
 
static const WCHAR StartUpW [] = {'S','t','a','r','t','U','p','\0'}
 
static const WCHAR Start_MenuW [] = {'S','t','a','r','t',' ','M','e','n','u','\0'}
 
static const WCHAR Start_Menu_ProgramsW [] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\0'}
 
static const WCHAR Start_Menu_Admin_ToolsW [] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}
 
static const WCHAR Start_Menu_StartupW [] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\','S','t','a','r','t','U','p','\0'}
 
static const WCHAR TemplatesW [] = {'T','e','m','p','l','a','t','e','s','\0'}
 
static const WCHAR UsersW [] = {'U','s','e','r','s','\0'}
 
static const WCHAR UsersPublicW [] = {'U','s','e','r','s','\\','P','u','b','l','i','c','\0'}
 
static const WCHAR VideosW [] = {'V','i','d','e','o','s','\0'}
 
static const WCHAR Videos_Sample_VideosW [] = {'V','i','d','e','o','s','\\','S','a','m','p','l','e',' ','V','i','d','e','o','s','\0'}
 
static const WCHAR DefaultW [] = {'.','D','e','f','a','u','l','t','\0'}
 
static const WCHAR AllUsersProfileW [] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%','\0'}
 
static const WCHAR PublicProfileW [] = {'%','P','U','B','L','I','C','%',0}
 
static const WCHAR UserProfileW [] = {'%','U','S','E','R','P','R','O','F','I','L','E','%','\0'}
 
static const WCHAR SystemDriveW [] = {'%','S','y','s','t','e','m','D','r','i','v','e','%','\0'}
 
static const WCHAR ProfileListW [] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',' ','N','T','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','P','r','o','f','i','l','e','L','i','s','t',0}
 
static const WCHAR ProfilesDirectoryW [] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0}
 
static const WCHAR AllUsersProfileValueW [] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}
 
static const WCHAR szSHFolders [] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}
 
static const WCHAR szSHUserFolders [] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}
 
static const WCHAR szDefaultProfileDirW [] = {'u','s','e','r','s',0}
 
static const WCHAR szKnownFolderDescriptions [] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','F','o','l','d','e','r','D','e','s','c','r','i','p','t','i','o','n','s','\0'}
 
static const WCHAR szKnownFolderRedirections [] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s',0}
 
static const WCHAR AllUsersW [] = {'P','u','b','l','i','c',0}
 
static const CSIDL_DATA CSIDL_Data []
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 29 of file shellpath.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 30 of file shellpath.c.

◆ CSIDL_APPDATA_LOCALLOW

#define CSIDL_APPDATA_LOCALLOW   0x004e

Definition at line 664 of file shellpath.c.

◆ CSIDL_CONTACTS

#define CSIDL_CONTACTS   0x0043

Definition at line 661 of file shellpath.c.

◆ CSIDL_DOWNLOADS

#define CSIDL_DOWNLOADS   0x0047

Definition at line 662 of file shellpath.c.

◆ CSIDL_LINKS

#define CSIDL_LINKS   0x004d

Definition at line 663 of file shellpath.c.

◆ CSIDL_SAVED_GAMES

#define CSIDL_SAVED_GAMES   0x0062

Definition at line 665 of file shellpath.c.

◆ CSIDL_SEARCHES

#define CSIDL_SEARCHES   0x0063

Definition at line 666 of file shellpath.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 28 of file shellpath.c.

Typedef Documentation

◆ CSIDL_Type

Enumeration Type Documentation

◆ _CSIDL_Type

Enumerator
CSIDL_Type_User 
CSIDL_Type_AllUsers 
CSIDL_Type_CurrVer 
CSIDL_Type_Disallowed 
CSIDL_Type_NonExistent 
CSIDL_Type_WindowsPath 
CSIDL_Type_SystemPath 
CSIDL_Type_SystemX86Path 

Definition at line 648 of file shellpath.c.

Function Documentation

◆ _GetUserSidStringFromToken()

static LPWSTR _GetUserSidStringFromToken ( HANDLE  Token)
static

Definition at line 1705 of file shellpath.c.

1706 {
1707  char InfoBuffer[64];
1708  PTOKEN_USER UserInfo;
1709  DWORD InfoSize;
1710  LPWSTR SidStr;
1711 
1712  UserInfo = (PTOKEN_USER) InfoBuffer;
1713  if (! GetTokenInformation(Token, TokenUser, InfoBuffer, sizeof(InfoBuffer),
1714  &InfoSize))
1715  {
1717  return NULL;
1718  UserInfo = HeapAlloc(GetProcessHeap(), 0, InfoSize);
1719  if (UserInfo == NULL)
1720  return NULL;
1721  if (! GetTokenInformation(Token, TokenUser, UserInfo, InfoSize,
1722  &InfoSize))
1723  {
1724  HeapFree(GetProcessHeap(), 0, UserInfo);
1725  return NULL;
1726  }
1727  }
1728 
1729  if (! ConvertSidToStringSidW(UserInfo->User.Sid, &SidStr))
1730  SidStr = NULL;
1731 
1732  if (UserInfo != (PTOKEN_USER) InfoBuffer)
1733  HeapFree(GetProcessHeap(), 0, UserInfo);
1734 
1735  return SidStr;
1736 }
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE Token
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
Definition: security.c:3259
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
struct _TOKEN_USER * PTOKEN_USER
SID_AND_ATTRIBUTES User
Definition: setypes.h:956
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by _SHGetUserProfilePath().

◆ _SHExpandEnvironmentStrings()

static HRESULT _SHExpandEnvironmentStrings ( LPCWSTR  szSrc,
LPWSTR  szDest 
)
static

Definition at line 1932 of file shellpath.c.

1936 {
1937  HRESULT hr;
1938 #ifndef __REACTOS__
1939  WCHAR szTemp[MAX_PATH], szProfilesPrefix[MAX_PATH] = { 0 };
1940  HKEY key = NULL;
1941 #else
1942  WCHAR szTemp[MAX_PATH];
1943 #endif
1944 
1945  TRACE("%s, %p\n", debugstr_w(szSrc), szDest);
1946 
1947  if (!szSrc || !szDest) return E_INVALIDARG;
1948 
1949  /* short-circuit if there's nothing to expand */
1950  if (szSrc[0] != '%')
1951  {
1952  strcpyW(szDest, szSrc);
1953  hr = S_OK;
1954  goto end;
1955  }
1956 #ifndef __REACTOS__
1957  /* Get the profile prefix, we'll probably be needing it */
1959  if (SUCCEEDED(hr))
1960  {
1961  WCHAR def_val[MAX_PATH];
1962 
1963  /* get the system drive */
1964  GetSystemDirectoryW(def_val, MAX_PATH);
1965  strcpyW( def_val + 3, szDefaultProfileDirW );
1966 
1967  hr = _SHGetProfilesValue(key, ProfilesDirectoryW, szProfilesPrefix, def_val );
1968  }
1969 #else
1970  hr = S_OK;
1971 #endif
1972 
1973  *szDest = 0;
1974  strcpyW(szTemp, szSrc);
1975  while (SUCCEEDED(hr) && szTemp[0] == '%')
1976  {
1978  {
1979 #ifndef __REACTOS__
1981 
1982  strcpyW(szDest, szProfilesPrefix);
1985  PathAppendW(szDest, szAllUsers);
1986 #else
1987  DWORD cchSize = cchDest;
1988  if (!GetAllUsersProfileDirectoryW(szDest, &cchSize))
1989  goto fallback_expand;
1990 #endif
1991  PathAppendW(szDest, szTemp + strlenW(AllUsersProfileW));
1992  }
1993 #ifndef __REACTOS__
1994  else if (!strncmpiW(szTemp, PublicProfileW, strlenW(PublicProfileW)))
1995  {
1996  WCHAR szAllUsers[MAX_PATH], def_val[MAX_PATH];
1997 
1998  GetSystemDirectoryW(def_val, MAX_PATH);
1999  strcpyW( def_val + 3, UsersPublicW );
2000 
2002  PathAppendW(szDest, szAllUsers);
2003  PathAppendW(szDest, szTemp + strlenW(PublicProfileW));
2004  }
2005 #endif
2006  else if (!strncmpiW(szTemp, UserProfileW, strlenW(UserProfileW)))
2007  {
2008 #ifndef __REACTOS__
2010  DWORD userLen = MAX_PATH;
2011 
2012  strcpyW(szDest, szProfilesPrefix);
2013  GetUserNameW(userName, &userLen);
2014  PathAppendW(szDest, userName);
2015 #else
2016  DWORD cchSize = cchDest;
2017  if (!_SHGetUserProfileDirectoryW(hToken, szDest, &cchSize))
2018  goto fallback_expand;
2019 #endif
2020  PathAppendW(szDest, szTemp + strlenW(UserProfileW));
2021  }
2022  else if (!strncmpiW(szTemp, SystemDriveW, strlenW(SystemDriveW)))
2023  {
2024 #ifndef __REACTOS__
2025  GetSystemDirectoryW(szDest, MAX_PATH);
2026 #else
2027  if (!GetSystemDirectoryW(szDest, cchDest))
2028  goto fallback_expand;
2029 #endif
2030  strcpyW(szDest + 3, szTemp + strlenW(SystemDriveW) + 1);
2031  }
2032  else
2033 #ifdef __REACTOS__
2034 fallback_expand:
2035 #endif
2036  {
2037 #ifndef __REACTOS__
2038  DWORD ret = ExpandEnvironmentStringsW(szTemp, szDest, MAX_PATH);
2039 #else
2040  DWORD ret = SHExpandEnvironmentStringsForUserW(hToken, szTemp, szDest, cchDest);
2041 #endif
2042 
2043 #ifndef __REACTOS__
2044  if (ret > MAX_PATH)
2045 #else
2046  if (ret > cchDest)
2047 #endif
2049  else if (ret == 0)
2051  else if (!strcmpW( szTemp, szDest )) break; /* nothing expanded */
2052  }
2053  if (SUCCEEDED(hr)) strcpyW(szTemp, szDest);
2054  }
2055 end:
2056 #ifndef __REACTOS__
2057  if (key)
2058  RegCloseKey(key);
2059 #endif
2060  TRACE("returning 0x%08x (input was %s, output is %s)\n", hr,
2061  debugstr_w(szSrc), debugstr_w(szDest));
2062  return hr;
2063 }
static const WCHAR PublicProfileW[]
Definition: shellpath.c:630
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static const WCHAR UserProfileW[]
Definition: shellpath.c:632
HRESULT hr
Definition: shlfolder.c:183
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint GLuint end
Definition: gl.h:1545
static const WCHAR ProfilesDirectoryW[]
Definition: shellpath.c:636
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static const WCHAR PublicW[]
Definition: shellpath.c:604
BOOL _SHGetUserProfileDirectoryW(HANDLE hToken, LPWSTR szPath, LPDWORD lpcchPath)
Definition: shellpath.c:1507
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR AllUsersProfileW[]
Definition: shellpath.c:628
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR UsersPublicW[]
Definition: shellpath.c:623
static HRESULT _SHOpenProfilesKey(PHKEY pKey)
Definition: shellpath.c:1867
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
Definition: misc.c:291
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR szAllUsers[]
Definition: msipriv.h:1138
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR SystemDriveW[]
Definition: shellpath.c:633
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345
#define S_OK
Definition: intsafe.h:59
static const WCHAR szDefaultProfileDirW[]
Definition: shellpath.c:641
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
BOOL WINAPI GetAllUsersProfileDirectoryW(_Out_opt_ LPWSTR lpProfileDir, _Inout_ LPDWORD lpcchSize)
Definition: profile.c:1227
static const WCHAR AllUsersW[]
Definition: shellpath.c:646
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
static HRESULT _SHGetProfilesValue(HKEY profilesKey, LPCWSTR szValueName, LPWSTR szValue, LPCWSTR szDefault)
Definition: shellpath.c:1882
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
static const WCHAR userName[]
Definition: wnet.c:2015
static const WCHAR AllUsersProfileValueW[]
Definition: shellpath.c:637
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: path.c:42

Referenced by _SHGetUserShellFolderPath(), and SHGetFolderPathAndSubDirW().

◆ _SHGetAllUsersProfilePath()

static HRESULT _SHGetAllUsersProfilePath ( DWORD  dwFlags,
BYTE  folder,
LPWSTR  pszPath 
)
static

Definition at line 1827 of file shellpath.c.

1829 {
1830  HRESULT hr;
1831 
1832  TRACE("0x%08x,0x%02x,%p\n", dwFlags, folder, pszPath);
1833 
1834  if (folder >= ARRAY_SIZE(CSIDL_Data))
1835  return E_INVALIDARG;
1837  return E_INVALIDARG;
1838  if (!pszPath)
1839  return E_INVALIDARG;
1840 
1842 #ifndef __REACTOS__
1843  hr = _SHGetDefaultValue(folder, pszPath);
1844 #else
1845  hr = _SHGetDefaultValue(NULL, folder, pszPath);
1846 #endif
1847  else
1848  {
1849 #ifndef __REACTOS__
1851 #else
1853 #endif
1854  CSIDL_Data[folder].szValueName, pszPath);
1855  if (FAILED(hr))
1856 #ifndef __REACTOS__
1857  hr = _SHGetDefaultValue(folder, pszPath);
1858 #else
1859  hr = _SHGetDefaultValue(NULL, folder, pszPath);
1860 #endif
1861  }
1862  TRACE("returning 0x%08x (output path is %s)\n", hr, debugstr_w(pszPath));
1863  return hr;
1864 }
Definition: fci.c:115
HRESULT hr
Definition: shlfolder.c:183
static const CSIDL_DATA CSIDL_Data[]
Definition: shellpath.c:678
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1543
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ARRAY_SIZE(a)
Definition: main.h:24
static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix, LPCWSTR value, LPWSTR path)
Definition: shellpath.c:1424
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by _SHRegisterFolders(), and SHGetFolderPathAndSubDirW().

◆ _SHGetCurrentVersionPath()

static HRESULT _SHGetCurrentVersionPath ( DWORD  dwFlags,
BYTE  folder,
LPWSTR  pszPath 
)
static

Definition at line 1636 of file shellpath.c.

1638 {
1639  HRESULT hr;
1640 
1641  TRACE("0x%08x,0x%02x,%p\n", dwFlags, folder, pszPath);
1642 
1643  if (folder >= ARRAY_SIZE(CSIDL_Data))
1644  return E_INVALIDARG;
1646  return E_INVALIDARG;
1647  if (!pszPath)
1648  return E_INVALIDARG;
1649 
1651 #ifndef __REACTOS__
1652  hr = _SHGetDefaultValue(folder, pszPath);
1653 #else
1654  hr = _SHGetDefaultValue(NULL, folder, pszPath);
1655 #endif
1656  else
1657  {
1658  HKEY hKey;
1659 
1661  hr = E_FAIL;
1662  else
1663  {
1664  DWORD dwType, dwPathLen = MAX_PATH * sizeof(WCHAR);
1665 
1666  if (RegQueryValueExW(hKey, CSIDL_Data[folder].szValueName, NULL,
1667  &dwType, (LPBYTE)pszPath, &dwPathLen) ||
1668  (dwType != REG_SZ && dwType != REG_EXPAND_SZ))
1669  {
1670 #ifndef __REACTOS__
1671  hr = _SHGetDefaultValue(folder, pszPath);
1672 #else
1673  hr = _SHGetDefaultValue(NULL, folder, pszPath);
1674 #endif
1675  dwType = REG_EXPAND_SZ;
1676  switch (folder)
1677  {
1680  /* these two should never be set on 32-bit setups */
1681  if (!is_win64)
1682  {
1683  BOOL is_wow64;
1685  if (!is_wow64) break;
1686  }
1687  /* fall through */
1688  default:
1689  RegSetValueExW(hKey, CSIDL_Data[folder].szValueName, 0, dwType,
1690  (LPBYTE)pszPath, (strlenW(pszPath)+1)*sizeof(WCHAR));
1691  }
1692  }
1693  else
1694  {
1695  pszPath[dwPathLen / sizeof(WCHAR)] = '\0';
1696  hr = S_OK;
1697  }
1698  RegCloseKey(hKey);
1699  }
1700  }
1701  TRACE("returning 0x%08x (output path is %s)\n", hr, debugstr_w(pszPath));
1702  return hr;
1703 }
Definition: fci.c:115
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
HRESULT hr
Definition: shlfolder.c:183
static const CSIDL_DATA CSIDL_Data[]
Definition: shellpath.c:678
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static const WCHAR szCurrentVersion[]
Definition: shellpath.c:528
#define E_FAIL
Definition: ddrawi.h:102
#define CSIDL_PROGRAM_FILESX86
Definition: shlobj.h:2044
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
static const BOOL is_win64
Definition: shellpath.c:54
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:2004
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1168
static BOOL is_wow64
Definition: loader.c:55
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1543
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
#define CSIDL_PROGRAM_FILES_COMMONX86
Definition: shlobj.h:2046
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by SHGetFolderPathAndSubDirW().

◆ _SHGetDefaultValue()

static HRESULT _SHGetDefaultValue ( BYTE  folder,
LPWSTR  pszPath 
)
static

Definition at line 1543 of file shellpath.c.

1547 {
1548  HRESULT hr;
1549  WCHAR resourcePath[MAX_PATH];
1550 
1551  TRACE("0x%02x,%p\n", folder, pszPath);
1552 
1553  if (folder >= ARRAY_SIZE(CSIDL_Data))
1554  return E_INVALIDARG;
1555 
1556  if (!pszPath)
1557  return E_INVALIDARG;
1558 
1559 #ifdef __REACTOS__
1560  if (hToken != NULL && hToken != (HANDLE)-1)
1561  {
1562  FIXME("unsupported for user other than current or default\n");
1563  }
1564 #endif
1565 
1566  if (!is_win64)
1567  {
1568  BOOL is_wow64;
1569 
1570  switch (folder)
1571  {
1572  case CSIDL_PROGRAM_FILES:
1576  break;
1581  break;
1582  }
1583  }
1584 
1585  switch (CSIDL_Data[folder].type)
1586  {
1587  case CSIDL_Type_User:
1588  strcpyW(pszPath, UserProfileW);
1589  break;
1590  case CSIDL_Type_AllUsers:
1591 #ifndef __REACTOS__
1592  strcpyW(pszPath, PublicProfileW);
1593 #else
1594  strcpyW(pszPath, AllUsersProfileW);
1595 #endif
1596  break;
1597  case CSIDL_Type_CurrVer:
1598  strcpyW(pszPath, SystemDriveW);
1599  break;
1600  default:
1601  ; /* no corresponding env. var, do nothing */
1602  }
1603 
1604  hr = S_OK;
1605  if (CSIDL_Data[folder].szDefaultPath)
1606  {
1607  if (IS_INTRESOURCE(CSIDL_Data[folder].szDefaultPath))
1608  {
1610  LOWORD(CSIDL_Data[folder].szDefaultPath), resourcePath, MAX_PATH))
1611  {
1612  PathAppendW(pszPath, resourcePath);
1613  }
1614  else
1615  {
1616  ERR("(%d,%s), LoadString failed, missing translation?\n", folder,
1617  debugstr_w(pszPath));
1618  hr = E_FAIL;
1619  }
1620  }
1621  else
1622  {
1623  PathAppendW(pszPath, CSIDL_Data[folder].szDefaultPath);
1624  }
1625  }
1626  TRACE("returning 0x%08x\n", hr);
1627  return hr;
1628 }
static const WCHAR PublicProfileW[]
Definition: shellpath.c:630
Definition: fci.c:115
static const WCHAR UserProfileW[]
Definition: shellpath.c:632
HRESULT hr
Definition: shlfolder.c:183
static const CSIDL_DATA CSIDL_Data[]
Definition: shellpath.c:678
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define CSIDL_PROGRAM_FILES
Definition: shlobj.h:2040
#define E_FAIL
Definition: ddrawi.h:102
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
#define CSIDL_PROGRAM_FILESX86
Definition: shlobj.h:2044
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR AllUsersProfileW[]
Definition: shellpath.c:628
#define E_INVALIDARG
Definition: ddrawi.h:101
static const BOOL is_win64
Definition: shellpath.c:54
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsWow64Process(IN HANDLE hProcess, OUT PBOOL Wow64Process)
Definition: proc.c:2004
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR SystemDriveW[]
Definition: shellpath.c:633
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1168
static BOOL is_wow64
Definition: loader.c:55
#define MAX_PATH
Definition: compat.h:26
#define CSIDL_PROGRAM_FILES_COMMONX86
Definition: shlobj.h:2046
#define CSIDL_PROGRAM_FILES_COMMON
Definition: shlobj.h:2045
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define ARRAY_SIZE(a)
Definition: main.h:24
#define LOWORD(l)
Definition: pedump.c:82

Referenced by _SHGetAllUsersProfilePath(), _SHGetCurrentVersionPath(), and _SHGetUserProfilePath().

◆ _SHGetProfilesValue()

static HRESULT _SHGetProfilesValue ( HKEY  profilesKey,
LPCWSTR  szValueName,
LPWSTR  szValue,
LPCWSTR  szDefault 
)
static

Definition at line 1882 of file shellpath.c.

1884 {
1885  HRESULT hr;
1886  DWORD type, dwPathLen = MAX_PATH * sizeof(WCHAR);
1887  LONG lRet;
1888 
1889  TRACE("%p,%s,%p,%s\n", profilesKey, debugstr_w(szValueName), szValue,
1890  debugstr_w(szDefault));
1891  lRet = RegQueryValueExW(profilesKey, szValueName, NULL, &type,
1892  (LPBYTE)szValue, &dwPathLen);
1893  if (!lRet && (type == REG_SZ || type == REG_EXPAND_SZ) && dwPathLen
1894  && *szValue)
1895  {
1896  dwPathLen /= sizeof(WCHAR);
1897  szValue[dwPathLen] = '\0';
1898  hr = S_OK;
1899  }
1900  else
1901  {
1902  /* Missing or invalid value, set a default */
1903  lstrcpynW(szValue, szDefault, MAX_PATH);
1904  TRACE("Setting missing value %s to %s\n", debugstr_w(szValueName),
1905  debugstr_w(szValue));
1906  lRet = RegSetValueExW(profilesKey, szValueName, 0, REG_EXPAND_SZ,
1907  (LPBYTE)szValue,
1908  (strlenW(szValue) + 1) * sizeof(WCHAR));
1909  if (lRet)
1910  hr = HRESULT_FROM_WIN32(lRet);
1911  else
1912  hr = S_OK;
1913  }
1914  TRACE("returning 0x%08x (output value is %s)\n", hr, debugstr_w(szValue));
1915  return hr;
1916 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define lstrcpynW
Definition: compat.h:397
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_SZ
Definition: layer.c:22

Referenced by _SHExpandEnvironmentStrings().

◆ _SHGetUserProfileDirectoryW()

BOOL _SHGetUserProfileDirectoryW ( HANDLE  hToken,
LPWSTR  szPath,
LPDWORD  lpcchPath 
)

Definition at line 1507 of file shellpath.c.

1508 {
1509  BOOL result;
1510  if (!hToken)
1511  {
1513  result = GetUserProfileDirectoryW(hToken, szPath, lpcchPath);
1514  CloseHandle(hToken);
1515  }
1516  else if ((INT) hToken == -1)
1517  {
1519  }
1520  else
1521  {
1522  result = GetUserProfileDirectoryW(hToken, szPath, lpcchPath);
1523  }
1524  TRACE("_SHGetUserProfileDirectoryW returning %S\n", szPath);
1525  return result;
1526 }
BOOL WINAPI GetDefaultUserProfileDirectoryW(_Out_opt_ LPWSTR lpProfileDir, _Inout_ LPDWORD lpcchSize)
Definition: profile.c:1360
#define CloseHandle
Definition: compat.h:398
BOOL WINAPI GetUserProfileDirectoryW(_In_ HANDLE hToken, _Out_opt_ LPWSTR lpProfileDir, _Inout_ LPDWORD lpcchSize)
Definition: profile.c:1709
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define TOKEN_QUERY
Definition: setypes.h:874
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1168
LPCWSTR szPath
Definition: env.c:35
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
GLuint64EXT * result
Definition: glext.h:11304

Referenced by _SHExpandEnvironmentStrings().

◆ _SHGetUserProfilePath()

static HRESULT _SHGetUserProfilePath ( HANDLE  hToken,
DWORD  dwFlags,
BYTE  folder,
LPWSTR  pszPath 
)
static

Definition at line 1746 of file shellpath.c.

1748 {
1749  const WCHAR *szValueName;
1750  WCHAR buffer[40];
1751  HRESULT hr;
1752 
1753  TRACE("%p,0x%08x,0x%02x,%p\n", hToken, dwFlags, folder, pszPath);
1754 
1755  if (folder >= ARRAY_SIZE(CSIDL_Data))
1756  return E_INVALIDARG;
1758  return E_INVALIDARG;
1759  if (!pszPath)
1760  return E_INVALIDARG;
1761 
1763  {
1764 #ifndef __REACTOS__
1765  hr = _SHGetDefaultValue(folder, pszPath);
1766 #else
1767  hr = _SHGetDefaultValue(hToken, folder, pszPath);
1768 #endif
1769  }
1770  else
1771  {
1772  LPCWSTR userPrefix = NULL;
1773  HKEY hRootKey;
1774 
1775  if (hToken == (HANDLE)-1)
1776  {
1777  hRootKey = HKEY_USERS;
1778  userPrefix = DefaultW;
1779  }
1780  else if (hToken == NULL)
1781  hRootKey = HKEY_CURRENT_USER;
1782  else
1783  {
1784  hRootKey = HKEY_USERS;
1785  userPrefix = _GetUserSidStringFromToken(hToken);
1786  if (userPrefix == NULL)
1787  {
1788  hr = E_FAIL;
1789  goto error;
1790  }
1791  }
1792 
1793  /* For CSIDL_Type_User we also use the GUID if no szValueName is provided */
1794  szValueName = CSIDL_Data[folder].szValueName;
1795  if (!szValueName)
1796  {
1798  szValueName = &buffer[0];
1799  }
1800 
1801 #ifndef __REACTOS__
1802  hr = _SHGetUserShellFolderPath(hRootKey, userPrefix, szValueName, pszPath);
1803  if (FAILED(hr) && hRootKey != HKEY_LOCAL_MACHINE)
1804  hr = _SHGetUserShellFolderPath(HKEY_LOCAL_MACHINE, NULL, szValueName, pszPath);
1805  if (FAILED(hr))
1806  hr = _SHGetDefaultValue(folder, pszPath);
1807 #else
1808  hr = _SHGetUserShellFolderPath(hRootKey, hToken, userPrefix, szValueName, pszPath);
1809  if (FAILED(hr) && hRootKey != HKEY_LOCAL_MACHINE)
1810  hr = _SHGetUserShellFolderPath(HKEY_LOCAL_MACHINE, hToken, NULL, szValueName, pszPath);
1811  if (FAILED(hr))
1812  hr = _SHGetDefaultValue(hToken, folder, pszPath);
1813 #endif
1814  if (userPrefix != NULL && userPrefix != DefaultW)
1815  LocalFree((HLOCAL) userPrefix);
1816  }
1817 error:
1818  TRACE("returning 0x%08x (output path is %s)\n", hr, debugstr_w(pszPath));
1819  return hr;
1820 }
#define HKEY_USERS
Definition: winreg.h:13
Definition: fci.c:115
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static const CSIDL_DATA CSIDL_Data[]
Definition: shellpath.c:678
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
struct CFFOLDER folder
Definition: fdi.c:110
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1543
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ARRAY_SIZE(a)
Definition: main.h:24
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
static LPWSTR _GetUserSidStringFromToken(HANDLE Token)
Definition: shellpath.c:1705
LPCWSTR szValueName
Definition: shellpath.c:673
static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix, LPCWSTR value, LPWSTR path)
Definition: shellpath.c:1424
static const WCHAR DefaultW[]
Definition: shellpath.c:627
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by _SHRegisterFolders(), and SHGetFolderPathAndSubDirW().

◆ _SHGetUserShellFolderPath()

static HRESULT _SHGetUserShellFolderPath ( HKEY  rootKey,
LPCWSTR  userPrefix,
LPCWSTR  value,
LPWSTR  path 
)
static

Definition at line 1424 of file shellpath.c.

1429 {
1430  HRESULT hr;
1431  WCHAR shellFolderPath[MAX_PATH], userShellFolderPath[MAX_PATH];
1432  LPCWSTR pShellFolderPath, pUserShellFolderPath;
1433  HKEY userShellFolderKey, shellFolderKey;
1434  DWORD dwType, dwPathLen;
1435 
1436  TRACE("%p,%s,%s,%p\n",rootKey, debugstr_w(userPrefix), debugstr_w(value),
1437  path);
1438 
1439  if (userPrefix)
1440  {
1441  strcpyW(shellFolderPath, userPrefix);
1442  PathAddBackslashW(shellFolderPath);
1443  strcatW(shellFolderPath, szSHFolders);
1444  pShellFolderPath = shellFolderPath;
1445  strcpyW(userShellFolderPath, userPrefix);
1446  PathAddBackslashW(userShellFolderPath);
1447  strcatW(userShellFolderPath, szSHUserFolders);
1448  pUserShellFolderPath = userShellFolderPath;
1449  }
1450  else
1451  {
1452  pUserShellFolderPath = szSHUserFolders;
1453  pShellFolderPath = szSHFolders;
1454  }
1455 
1456  if (RegCreateKeyW(rootKey, pShellFolderPath, &shellFolderKey))
1457  {
1458  TRACE("Failed to create %s\n", debugstr_w(pShellFolderPath));
1459  return E_FAIL;
1460  }
1461  if (RegCreateKeyW(rootKey, pUserShellFolderPath, &userShellFolderKey))
1462  {
1463  TRACE("Failed to create %s\n",
1464  debugstr_w(pUserShellFolderPath));
1465  RegCloseKey(shellFolderKey);
1466  return E_FAIL;
1467  }
1468 
1469  dwPathLen = MAX_PATH * sizeof(WCHAR);
1470  if (!RegQueryValueExW(userShellFolderKey, value, NULL, &dwType,
1471  (LPBYTE)path, &dwPathLen) && (dwType == REG_EXPAND_SZ || dwType == REG_SZ))
1472  {
1473  LONG ret;
1474 
1475  path[dwPathLen / sizeof(WCHAR)] = '\0';
1476  if (dwType == REG_EXPAND_SZ && path[0] == '%')
1477  {
1478  WCHAR szTemp[MAX_PATH];
1479 
1480 #ifndef __REACTOS__
1482 #else
1483  hr = _SHExpandEnvironmentStrings(hToken, path, szTemp, _countof(szTemp));
1484  if (FAILED(hr))
1485  goto end;
1486 #endif
1487  lstrcpynW(path, szTemp, MAX_PATH);
1488  }
1489  ret = RegSetValueExW(shellFolderKey, value, 0, REG_SZ, (LPBYTE)path,
1490  (strlenW(path) + 1) * sizeof(WCHAR));
1491  if (ret != ERROR_SUCCESS)
1493  else
1494  hr = S_OK;
1495  }
1496  else
1497  hr = E_FAIL;
1498 #ifdef __REACTOS__
1499 end:
1500 #endif
1501  RegCloseKey(shellFolderKey);
1502  RegCloseKey(userShellFolderKey);
1503  TRACE("returning 0x%08x\n", hr);
1504  return hr;
1505 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
Definition: shellpath.c:1932
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define _countof(array)
Definition: fontsub.cpp:30
GLuint GLuint end
Definition: gl.h:1545
#define E_FAIL
Definition: ddrawi.h:102
#define lstrcpynW
Definition: compat.h:397
static const WCHAR szSHUserFolders[]
Definition: shellpath.c:640
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
Definition: services.c:325
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
static const WCHAR szSHFolders[]
Definition: shellpath.c:639
#define REG_SZ
Definition: layer.c:22

Referenced by _SHGetAllUsersProfilePath(), and _SHGetUserProfilePath().

◆ _SHOpenProfilesKey()

static HRESULT _SHOpenProfilesKey ( PHKEY  pKey)
static

Definition at line 1867 of file shellpath.c.

1868 {
1869  LONG lRet;
1870  DWORD disp;
1871 
1873  KEY_ALL_ACCESS, NULL, pKey, &disp);
1874  return HRESULT_FROM_WIN32(lRet);
1875 }
disp
Definition: i386-dis.c:3181
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
static const WCHAR ProfileListW[]
Definition: shellpath.c:635
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by _SHExpandEnvironmentStrings().

◆ _SHRegisterCommonShellFolders()

static HRESULT _SHRegisterCommonShellFolders ( void  )
static

Definition at line 2510 of file shellpath.c.

2511 {
2512  static const UINT folders[] = {
2525  };
2526  HRESULT hr;
2527 
2528  TRACE("\n");
2530  szSHFolders, folders, ARRAY_SIZE(folders));
2531  TRACE("returning 0x%08x\n", hr);
2532  return hr;
2533 }
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2027
#define CSIDL_COMMON_FAVORITES
Definition: shlobj.h:2033
static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[], UINT foldersLen)
Definition: shellpath.c:2356
#define CSIDL_COMMON_STARTUP
Definition: shlobj.h:2026
#define CSIDL_COMMON_PICTURES
Definition: shlobj.h:2053
#define CSIDL_COMMON_TEMPLATES
Definition: shlobj.h:2047
static const WCHAR szSHUserFolders[]
Definition: shellpath.c:640
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2025
smooth NULL
Definition: ftsmooth.c:416
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2024
#define CSIDL_COMMON_ADMINTOOLS
Definition: shlobj.h:2049
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define CSIDL_COMMON_VIDEO
Definition: shlobj.h:2054
#define CSIDL_COMMON_APPDATA
Definition: shlobj.h:2037
#define CSIDL_COMMON_MUSIC
Definition: shlobj.h:2052
#define ARRAY_SIZE(a)
Definition: main.h:24
#define CSIDL_COMMON_DOCUMENTS
Definition: shlobj.h:2048
unsigned int UINT
Definition: ndis.h:50
static const WCHAR szSHFolders[]
Definition: shellpath.c:639
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by SHELL_RegisterShellFolders().

◆ _SHRegisterFolders()

static HRESULT _SHRegisterFolders ( HKEY  hRootKey,
HANDLE  hToken,
LPCWSTR  szUserShellFolderPath,
LPCWSTR  szShellFolderPath,
const UINT  folders[],
UINT  foldersLen 
)
static

Definition at line 2356 of file shellpath.c.

2359 {
2360  const WCHAR *szValueName;
2361  WCHAR buffer[40];
2362  UINT i;
2363  WCHAR path[MAX_PATH];
2364  HRESULT hr = S_OK;
2365  HKEY hUserKey = NULL, hKey = NULL;
2366  DWORD dwType, dwPathLen;
2367  LONG ret;
2368 
2369  TRACE("%p,%p,%s,%p,%u\n", hRootKey, hToken,
2370  debugstr_w(szUserShellFolderPath), folders, foldersLen);
2371 
2372  ret = RegCreateKeyW(hRootKey, szUserShellFolderPath, &hUserKey);
2373  if (ret)
2375  else
2376  {
2377  ret = RegCreateKeyW(hRootKey, szShellFolderPath, &hKey);
2378  if (ret)
2380  }
2381  for (i = 0; SUCCEEDED(hr) && i < foldersLen; i++)
2382  {
2383  dwPathLen = MAX_PATH * sizeof(WCHAR);
2384 
2385  /* For CSIDL_Type_User we also use the GUID if no szValueName is provided */
2386  szValueName = CSIDL_Data[folders[i]].szValueName;
2387  if (!szValueName && CSIDL_Data[folders[i]].type == CSIDL_Type_User)
2388  {
2389  StringFromGUID2( CSIDL_Data[folders[i]].id, buffer, 39 );
2390  szValueName = &buffer[0];
2391  }
2392 
2393  if (RegQueryValueExW(hUserKey, szValueName, NULL,
2394  &dwType, (LPBYTE)path, &dwPathLen) || (dwType != REG_SZ &&
2395  dwType != REG_EXPAND_SZ))
2396  {
2397  *path = '\0';
2398  if (CSIDL_Data[folders[i]].type == CSIDL_Type_User)
2399  _SHGetUserProfilePath(hToken, SHGFP_TYPE_DEFAULT, folders[i],
2400  path);
2401  else if (CSIDL_Data[folders[i]].type == CSIDL_Type_AllUsers)
2403  else if (CSIDL_Data[folders[i]].type == CSIDL_Type_WindowsPath)
2404  {
2406  if (CSIDL_Data[folders[i]].szDefaultPath &&
2407  !IS_INTRESOURCE(CSIDL_Data[folders[i]].szDefaultPath))
2408  {
2410  strcatW(path, CSIDL_Data[folders[i]].szDefaultPath);
2411  }
2412  }
2413  else
2414  hr = E_FAIL;
2415  if (*path)
2416  {
2417  ret = RegSetValueExW(hUserKey, szValueName, 0, REG_EXPAND_SZ,
2418  (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR));
2419  if (ret)
2421  else
2422  {
2423  hr = SHGetFolderPathW(NULL, folders[i] | CSIDL_FLAG_CREATE,
2424  hToken, SHGFP_TYPE_DEFAULT, path);
2425  ret = RegSetValueExW(hKey, szValueName, 0, REG_SZ,
2426  (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR));
2427  if (ret)
2429  }
2430  }
2431  }
2432  }
2433  if (hUserKey)
2434  RegCloseKey(hUserKey);
2435  if (hKey)
2436  RegCloseKey(hKey);
2437 
2438  TRACE("returning 0x%08x\n", hr);
2439  return hr;
2440 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
HRESULT hr
Definition: shlfolder.c:183
static const CSIDL_DATA CSIDL_Data[]
Definition: shellpath.c:678
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
#define E_FAIL
Definition: ddrawi.h:102
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1746
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1827
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
#define S_OK
Definition: intsafe.h:59
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
Definition: services.c:325
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
unsigned int UINT
Definition: ndis.h:50
#define CSIDL_FLAG_CREATE
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085
LPCWSTR szValueName
Definition: shellpath.c:673
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define REG_SZ
Definition: layer.c:22

Referenced by _SHRegisterCommonShellFolders(), and _SHRegisterUserShellFolders().

◆ _SHRegisterUserShellFolders()

static HRESULT _SHRegisterUserShellFolders ( BOOL  bDefault)
static

Definition at line 2442 of file shellpath.c.

2443 {
2444  static const UINT folders[] = {
2448  CSIDL_APPDATA,
2449  CSIDL_STARTUP,
2450  CSIDL_RECENT,
2451  CSIDL_SENDTO,
2453  CSIDL_MYMUSIC,
2454  CSIDL_MYVIDEO,
2456  CSIDL_NETHOOD,
2461  CSIDL_COOKIES,
2462  CSIDL_HISTORY,
2464  CSIDL_FONTS,
2466 /* Cannot use #if _WIN32_WINNT >= 0x0600 because _WIN32_WINNT == 0x0600 here. */
2467 #ifndef __REACTOS__
2470  CSIDL_LINKS,
2474 #endif
2475  };
2476  WCHAR userShellFolderPath[MAX_PATH], shellFolderPath[MAX_PATH];
2477  LPCWSTR pUserShellFolderPath, pShellFolderPath;
2478  HRESULT hr = S_OK;
2479  HKEY hRootKey;
2480  HANDLE hToken;
2481 
2482  TRACE("%s\n", bDefault ? "TRUE" : "FALSE");
2483  if (bDefault)
2484  {
2485  hToken = (HANDLE)-1;
2486  hRootKey = HKEY_USERS;
2487  strcpyW(userShellFolderPath, DefaultW);
2488  PathAddBackslashW(userShellFolderPath);
2489  strcatW(userShellFolderPath, szSHUserFolders);
2490  pUserShellFolderPath = userShellFolderPath;
2491  strcpyW(shellFolderPath, DefaultW);
2492  PathAddBackslashW(shellFolderPath);
2493  strcatW(shellFolderPath, szSHFolders);
2494  pShellFolderPath = shellFolderPath;
2495  }
2496  else
2497  {
2498  hToken = NULL;
2499  hRootKey = HKEY_CURRENT_USER;
2500  pUserShellFolderPath = szSHUserFolders;
2501  pShellFolderPath = szSHFolders;
2502  }
2503 
2504  hr = _SHRegisterFolders(hRootKey, hToken, pUserShellFolderPath,
2505  pShellFolderPath, folders, ARRAY_SIZE(folders));
2506  TRACE("returning 0x%08x\n", hr);
2507  return hr;
2508 }
#define HKEY_USERS
Definition: winreg.h:13
#define CSIDL_COOKIES
Definition: shlobj.h:2035
#define CSIDL_MYVIDEO
Definition: shlobj.h:2017
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CSIDL_MYPICTURES
Definition: shlobj.h:2041
#define CSIDL_CONTACTS
Definition: shellpath.c:661
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken, LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[], UINT foldersLen)
Definition: shellpath.c:2356
#define CSIDL_HISTORY
Definition: shlobj.h:2036
#define CSIDL_FONTS
Definition: shlobj.h:2022
#define CSIDL_INTERNET_CACHE
Definition: shlobj.h:2034
static const WCHAR szSHUserFolders[]
Definition: shellpath.c:640
#define CSIDL_RECENT
Definition: shlobj.h:2011
#define CSIDL_FAVORITES
Definition: shlobj.h:2009
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
smooth NULL
Definition: ftsmooth.c:416
#define CSIDL_SEARCHES
Definition: shellpath.c:666
#define TRACE(s)
Definition: solgame.cpp:4
#define CSIDL_ADMINTOOLS
Definition: shlobj.h:2050
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2030
#define CSIDL_SENDTO
Definition: shlobj.h:2012
#define CSIDL_APPDATA
Definition: shlobj.h:2028
#define MAX_PATH
Definition: compat.h:26
static HANDLE
Definition: shellpath.c:88
#define CSIDL_STARTUP
Definition: shlobj.h:2010
#define CSIDL_LINKS
Definition: shellpath.c:663
#define CSIDL_APPDATA_LOCALLOW
Definition: shellpath.c:664
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define CSIDL_DOWNLOADS
Definition: shellpath.c:662
#define ARRAY_SIZE(a)
Definition: main.h:24
#define CSIDL_PRINTHOOD
Definition: shlobj.h:2029
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
unsigned int UINT
Definition: ndis.h:50
#define CSIDL_SAVED_GAMES
Definition: shellpath.c:665
#define CSIDL_NETHOOD
Definition: shlobj.h:2021
static const WCHAR szSHFolders[]
Definition: shellpath.c:639
#define CSIDL_PERSONAL
Definition: shlobj.h:2008
#define CSIDL_STARTMENU
Definition: shlobj.h:2014
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2018
#define CSIDL_PROGRAMS
Definition: shlobj.h:2005
#define CSIDL_TEMPLATES
Definition: shlobj.h:2023
static const WCHAR DefaultW[]
Definition: shellpath.c:627
#define CSIDL_MYMUSIC
Definition: shlobj.h:2016

Referenced by SHELL_RegisterShellFolders().

◆ IsLFNDriveA()

BOOL WINAPI IsLFNDriveA ( LPCSTR  lpszPath)

Definition at line 235 of file shellpath.c.

236 {
237  DWORD fnlen;
238 
239  if (!GetVolumeInformationA(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
240  return FALSE;
241  return fnlen > 12;
242 }
BOOL WINAPI GetVolumeInformationA(IN LPCSTR lpRootPathName, IN LPSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:32
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by IsLFNDriveAW().

◆ IsLFNDriveAW()

BOOL WINAPI IsLFNDriveAW ( LPCVOID  lpszPath)

Definition at line 259 of file shellpath.c.

260 {
261  if (SHELL_OsIsUnicode())
262  return IsLFNDriveW(lpszPath);
263  return IsLFNDriveA(lpszPath);
264 }
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL WINAPI IsLFNDriveW(LPCWSTR lpszPath)
Definition: shellpath.c:247
BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath)
Definition: shellpath.c:235

◆ IsLFNDriveW()

BOOL WINAPI IsLFNDriveW ( LPCWSTR  lpszPath)

Definition at line 247 of file shellpath.c.

248 {
249  DWORD fnlen;
250 
251  if (!GetVolumeInformationW(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
252  return FALSE;
253  return fnlen > 12;
254 }
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226

Referenced by IsLFNDriveAW().

◆ PathAppendAW()

BOOL WINAPI PathAppendAW ( LPVOID  lpszPath1,
LPCVOID  lpszPath2 
)

Definition at line 63 of file shellpath.c.

66 {
67  if (SHELL_OsIsUnicode())
68  return PathAppendW(lpszPath1, lpszPath2);
69  return PathAppendA(lpszPath1, lpszPath2);
70 }
BOOL WINAPI PathAppendA(LPSTR lpszPath, LPCSTR lpszAppend)
Definition: path.c:101
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121

◆ PathCleanupSpec()

int WINAPI PathCleanupSpec ( LPCWSTR  lpszPathW,
LPWSTR  lpszFileW 
)

Definition at line 358 of file shellpath.c.

359 {
360  int i = 0;
361  DWORD rc = 0;
362  int length = 0;
363 
364  if (SHELL_OsIsUnicode())
365  {
366  LPWSTR p = lpszFileW;
367 
368  TRACE("Cleanup %s\n",debugstr_w(lpszFileW));
369 
370  if (lpszPathW)
371  length = strlenW(lpszPathW);
372 
373  while (*p)
374  {
375  int gct = PathGetCharTypeW(*p);
376  if (gct == GCT_INVALID || gct == GCT_WILD || gct == GCT_SEPARATOR)
377  {
378  lpszFileW[i]='-';
379  rc |= PCS_REPLACEDCHAR;
380  }
381  else
382  lpszFileW[i]=*p;
383  i++;
384  p++;
385  if (length + i == MAX_PATH)
386  {
387  rc |= PCS_FATAL | PCS_PATHTOOLONG;
388  break;
389  }
390  }
391  lpszFileW[i]=0;
392  }
393  else
394  {
395  LPSTR lpszFileA = (LPSTR)lpszFileW;
396  LPCSTR lpszPathA = (LPCSTR)lpszPathW;
397  LPSTR p = lpszFileA;
398 
399  TRACE("Cleanup %s\n",debugstr_a(lpszFileA));
400 
401  if (lpszPathA)
402  length = strlen(lpszPathA);
403 
404  while (*p)
405  {
406  int gct = PathGetCharTypeA(*p);
407  if (gct == GCT_INVALID || gct == GCT_WILD || gct == GCT_SEPARATOR)
408  {
409  lpszFileA[i]='-';
410  rc |= PCS_REPLACEDCHAR;
411  }
412  else
413  lpszFileA[i]=*p;
414  i++;
415  p++;
416  if (length + i == MAX_PATH)
417  {
418  rc |= PCS_FATAL | PCS_PATHTOOLONG;
419  break;
420  }
421  }
422  lpszFileA[i]=0;
423  }
424  return rc;
425 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
UINT WINAPI PathGetCharTypeW(WCHAR ch)
Definition: path.c:3015
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
static LPSTR
Definition: shellpath.c:88
char * LPSTR
Definition: xmlstorage.h:182
#define PCS_FATAL
Definition: shlobj.h:323
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PCS_PATHTOOLONG
Definition: shlobj.h:327
#define GCT_WILD
Definition: shlwapi.h:778
#define GCT_INVALID
Definition: shlwapi.h:775
#define debugstr_w
Definition: kernel32.h:32
const char * LPCSTR
Definition: xmlstorage.h:183
UINT WINAPI PathGetCharTypeA(UCHAR ch)
Definition: path.c:3005
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define MAX_PATH
Definition: compat.h:26
#define GCT_SEPARATOR
Definition: shlwapi.h:779
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PCS_REPLACEDCHAR
Definition: shlobj.h:324
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ PathFileExistsAW()

BOOL WINAPI PathFileExistsAW ( LPCVOID  lpszPath)

Definition at line 225 of file shellpath.c.

226 {
227  if (SHELL_OsIsUnicode())
228  return PathFileExistsW (lpszPath);
229  return PathFileExistsA (lpszPath);
230 }
BOOL WINAPI PathFileExistsA(LPCSTR lpszPath)
Definition: path.c:1734
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756

◆ PathGetExtensionA()

static LPSTR PathGetExtensionA ( LPCSTR  lpszPath)
static

Definition at line 79 of file shellpath.c.

80 {
81  TRACE("(%s)\n",lpszPath);
82 
83  lpszPath = PathFindExtensionA(lpszPath);
84  return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
85 }
char * LPSTR
Definition: xmlstorage.h:182
#define TRACE(s)
Definition: solgame.cpp:4
LPSTR WINAPI PathFindExtensionA(LPCSTR lpszPath)
Definition: path.c:417

Referenced by PathIsExeA().

◆ PathGetExtensionW()

static LPWSTR PathGetExtensionW ( LPCWSTR  lpszPath)
static

Definition at line 90 of file shellpath.c.

91 {
92  TRACE("(%s)\n",debugstr_w(lpszPath));
93 
94  lpszPath = PathFindExtensionW(lpszPath);
95  return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
96 }
#define debugstr_w
Definition: kernel32.h:32
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by PathIsExeW(), and SHPathGetExtensionW().

◆ PathGetShortPathA()

static void PathGetShortPathA ( LPSTR  pszPath)
static

Definition at line 123 of file shellpath.c.

124 {
125  CHAR path[MAX_PATH];
126 
127  TRACE("%s\n", pszPath);
128 
129  if (GetShortPathNameA(pszPath, path, MAX_PATH))
130  {
131  lstrcpyA(pszPath, path);
132  }
133 }
char CHAR
Definition: xmlstorage.h:175
#define TRACE(s)
Definition: solgame.cpp:4
DWORD WINAPI GetShortPathNameA(IN LPCSTR lpszLongPath, OUT LPSTR lpszShortPath, IN DWORD cchBuffer)
Definition: path.c:1751
#define MAX_PATH
Definition: compat.h:26
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
Definition: services.c:325

Referenced by PathGetShortPathAW().

◆ PathGetShortPathAW()

VOID WINAPI PathGetShortPathAW ( LPVOID  pszPath)

Definition at line 153 of file shellpath.c.

154 {
155  if(SHELL_OsIsUnicode())
156  PathGetShortPathW(pszPath);
157  PathGetShortPathA(pszPath);
158 }
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
static void PathGetShortPathW(LPWSTR pszPath)
Definition: shellpath.c:138
static void PathGetShortPathA(LPSTR pszPath)
Definition: shellpath.c:123

◆ PathGetShortPathW()

static void PathGetShortPathW ( LPWSTR  pszPath)
static

Definition at line 138 of file shellpath.c.

139 {
141 
142  TRACE("%s\n", debugstr_w(pszPath));
143 
144  if (GetShortPathNameW(pszPath, path, MAX_PATH))
145  {
146  lstrcpyW(pszPath, path);
147  }
148 }
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD WINAPI GetShortPathNameW(IN LPCWSTR lpszLongPath, OUT LPWSTR lpszShortPath, IN DWORD cchBuffer)
Definition: path.c:1832
#define MAX_PATH
Definition: compat.h:26
#define lstrcpyW
Definition: compat.h:406
Definition: services.c:325

Referenced by PathGetShortPathAW().

◆ PathIsExeA()

static BOOL PathIsExeA ( LPCSTR  lpszPath)
static

Definition at line 177 of file shellpath.c.

178 {
179  LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
180  int i;
181  static const char * const lpszExtensions[] =
182  {"exe", "com", "pif", "cmd", "bat", "scf", "scr", NULL };
183 
184  TRACE("path=%s\n",lpszPath);
185 
186  for(i=0; lpszExtensions[i]; i++)
187  if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE;
188 
189  return FALSE;
190 }
#define TRUE
Definition: types.h:120
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define TRACE(s)
Definition: solgame.cpp:4
static LPSTR PathGetExtensionA(LPCSTR lpszPath)
Definition: shellpath.c:79

Referenced by PathIsExeAW().

◆ PathIsExeAW()

BOOL WINAPI PathIsExeAW ( LPCVOID  path)

Definition at line 215 of file shellpath.c.

216 {
217  if (SHELL_OsIsUnicode())
218  return PathIsExeW (path);
219  return PathIsExeA(path);
220 }
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL PathIsExeW(LPCWSTR lpszPath)
Definition: shellpath.c:195
static BOOL PathIsExeA(LPCSTR lpszPath)
Definition: shellpath.c:177
Definition: services.c:325

◆ PathIsExeW()

BOOL PathIsExeW ( LPCWSTR  lpszPath)

Definition at line 195 of file shellpath.c.

196 {
197  LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
198  int i;
199  static const WCHAR lpszExtensions[][4] =
200  {{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'},
201  {'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'},
202  {'s','c','r','\0'}, {'\0'} };
203 
204  TRACE("path=%s\n",debugstr_w(lpszPath));
205 
206  for(i=0; lpszExtensions[i][0]; i++)
207  if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
208 
209  return FALSE;
210 }
#define TRUE
Definition: types.h:120
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define strcmpiW(s1, s2)
Definition: unicode.h:39
static LPWSTR PathGetExtensionW(LPCWSTR lpszPath)
Definition: shellpath.c:90

Referenced by CFileDefExt::InitGeneralPage(), COpenWithMenu::Initialize(), and PathIsExeAW().

◆ PathIsRootAW()

BOOL WINAPI PathIsRootAW ( LPCVOID  lpszPath)

Definition at line 167 of file shellpath.c.

168 {
169  if (SHELL_OsIsUnicode())
170  return PathIsRootW(lpszPath);
171  return PathIsRootA(lpszPath);
172 }
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
Definition: path.c:1621
BOOL WINAPI PathIsRootA(LPCSTR lpszPath)
Definition: path.c:1581

◆ PathMakeUniqueNameA()

static BOOL PathMakeUniqueNameA ( LPSTR  lpszBuffer,
DWORD  dwBuffSize,
LPCSTR  lpszShortName,
LPCSTR  lpszLongName,
LPCSTR  lpszPathName 
)
static

Definition at line 272 of file shellpath.c.

278 {
279  FIXME("%p %u %s %s %s stub\n",
280  lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
281  debugstr_a(lpszLongName), debugstr_a(lpszPathName));
282  return TRUE;
283 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31

Referenced by PathMakeUniqueNameAW().

◆ PathMakeUniqueNameAW()

BOOL WINAPI PathMakeUniqueNameAW ( LPVOID  lpszBuffer,
DWORD  dwBuffSize,
LPCVOID  lpszShortName,
LPCVOID  lpszLongName,
LPCVOID  lpszPathName 
)

Definition at line 304 of file shellpath.c.

310 {
311  if (SHELL_OsIsUnicode())
312  return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
313  return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
314 }
static BOOL PathMakeUniqueNameW(LPWSTR lpszBuffer, DWORD dwBuffSize, LPCWSTR lpszShortName, LPCWSTR lpszLongName, LPCWSTR lpszPathName)
Definition: shellpath.c:288
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
static BOOL PathMakeUniqueNameA(LPSTR lpszBuffer, DWORD dwBuffSize, LPCSTR lpszShortName, LPCSTR lpszLongName, LPCSTR lpszPathName)
Definition: shellpath.c:272

◆ PathMakeUniqueNameW()

static BOOL PathMakeUniqueNameW ( LPWSTR  lpszBuffer,
DWORD  dwBuffSize,
LPCWSTR  lpszShortName,
LPCWSTR  lpszLongName,
LPCWSTR  lpszPathName 
)
static

Definition at line 288 of file shellpath.c.

294 {
295  FIXME("%p %u %s %s %s stub\n",
296  lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
297  debugstr_w(lpszLongName), debugstr_w(lpszPathName));
298  return TRUE;
299 }
#define TRUE
Definition: types.h:120
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

Referenced by PathMakeUniqueNameAW().

◆ PathProcessCommandA()

static LONG PathProcessCommandA ( LPCSTR  lpszPath,
LPSTR  lpszBuff,
DWORD  dwBuffSize,
DWORD  dwFlags 
)
static

Definition at line 481 of file shellpath.c.

486 {
487  FIXME("%s %p 0x%04x 0x%04x stub\n",
488  lpszPath, lpszBuff, dwBuffSize, dwFlags);
489  if(!lpszPath) return -1;
490  if(lpszBuff) strcpy(lpszBuff, lpszPath);
491  return strlen(lpszPath);
492 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by PathProcessCommandAW().

◆ PathProcessCommandAW()

LONG WINAPI PathProcessCommandAW ( LPCVOID  lpszPath,
LPVOID  lpszBuff,
DWORD  dwBuffSize,
DWORD  dwFlags 
)

Definition at line 513 of file shellpath.c.

518 {
519  if (SHELL_OsIsUnicode())
520  return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags);
521  return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags);
522 }
static LONG PathProcessCommandA(LPCSTR lpszPath, LPSTR lpszBuff, DWORD dwBuffSize, DWORD dwFlags)
Definition: shellpath.c:481
static LONG PathProcessCommandW(LPCWSTR lpszPath, LPWSTR lpszBuff, DWORD dwBuffSize, DWORD dwFlags)
Definition: shellpath.c:497
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

◆ PathProcessCommandW()

static LONG PathProcessCommandW ( LPCWSTR  lpszPath,
LPWSTR  lpszBuff,
DWORD  dwBuffSize,
DWORD  dwFlags 
)
static

Definition at line 497 of file shellpath.c.

502 {
503  FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n",
504  debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
505  if(!lpszPath) return -1;
506  if(lpszBuff) strcpyW(lpszBuff, lpszPath);
507  return strlenW(lpszPath);
508 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219

Referenced by PathProcessCommandAW().

◆ PathQualifyA()

static BOOL PathQualifyA ( LPCSTR  pszPath)
static

Definition at line 430 of file shellpath.c.

431 {
432  FIXME("%s\n",pszPath);
433  return FALSE;
434 }
#define FIXME(fmt,...)
Definition: debug.h:110

Referenced by PathQualifyAW().

◆ PathQualifyAW()

BOOL WINAPI PathQualifyAW ( LPCVOID  pszPath)

Definition at line 448 of file shellpath.c.

449 {
450  if (SHELL_OsIsUnicode())
451  return PathQualifyW(pszPath);
452  return PathQualifyA(pszPath);
453 }
static BOOL PathQualifyA(LPCSTR pszPath)
Definition: shellpath.c:430
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
static BOOL PathQualifyW(LPCWSTR pszPath)
Definition: shellpath.c:439

◆ PathQualifyW()

static BOOL PathQualifyW ( LPCWSTR  pszPath)
static

Definition at line 439 of file shellpath.c.

440 {
441  FIXME("%s\n",debugstr_w(pszPath));
442  return FALSE;
443 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

Referenced by PathQualifyAW().

◆ PathRemoveFileSpecAW()

BOOL WINAPI PathRemoveFileSpecAW ( LPVOID  lpszPath)

Definition at line 109 of file shellpath.c.

110 {
111  if (SHELL_OsIsUnicode())
112  return PathRemoveFileSpecW(lpszPath);
113  return PathRemoveFileSpecA(lpszPath);
114 }
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:624
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
BOOL WINAPI PathRemoveFileSpecA(LPSTR lpszPath)
Definition: path.c:581

◆ PathResolveA()

static BOOL PathResolveA ( LPSTR  path,
LPCSTR paths,
DWORD  flags 
)
static

Definition at line 455 of file shellpath.c.

456 {
457  FIXME("(%s,%p,0x%08x),stub!\n", debugstr_a(path), paths, flags);
458  return FALSE;
459 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
GLbitfield flags
Definition: glext.h:7161
GLsizei const GLuint * paths
Definition: glext.h:11717
Definition: services.c:325

Referenced by PathResolveAW().

◆ PathResolveAW()

BOOL WINAPI PathResolveAW ( LPVOID  path,
LPCVOID paths,
DWORD  flags 
)

Definition at line 470 of file shellpath.c.

471 {
472  if (SHELL_OsIsUnicode())
473  return PathResolveW(path, (LPCWSTR*)paths, flags);
474  else
475  return PathResolveA(path, (LPCSTR*)paths, flags);
476 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
const char * LPCSTR
Definition: xmlstorage.h:183
static BOOL PathResolveW(LPWSTR path, LPCWSTR *paths, DWORD flags)
Definition: shellpath.c:461
GLbitfield flags
Definition: glext.h:7161
GLsizei const GLuint * paths
Definition: glext.h:11717
Definition: services.c:325
static BOOL PathResolveA(LPSTR path, LPCSTR *paths, DWORD flags)
Definition: shellpath.c:455

◆ PathResolveW()

static BOOL PathResolveW ( LPWSTR  path,
LPCWSTR paths,
DWORD  flags 
)
static

Definition at line 461 of file shellpath.c.

462 {
463  FIXME("(%s,%p,0x%08x),stub!\n", debugstr_w(path), paths, flags);
464  return FALSE;
465 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
GLsizei const GLuint * paths
Definition: glext.h:11717
Definition: services.c:325

Referenced by PathResolveAW().

◆ PathYetAnotherMakeUniqueName()

BOOL WINAPI PathYetAnotherMakeUniqueName ( LPWSTR  buffer,
LPCWSTR  path,
LPCWSTR  shortname,
LPCWSTR  longname 
)

Definition at line 319 of file shellpath.c.

320 {
321  WCHAR pathW[MAX_PATH], retW[MAX_PATH];
322  const WCHAR *file, *ext;
323  int i = 2;
324 
325  TRACE("(%p, %s, %s, %s)\n", buffer, debugstr_w(path), debugstr_w(shortname), debugstr_w(longname));
326 
327  file = longname ? longname : shortname;
328  PathCombineW(pathW, path, file);
329  strcpyW(retW, pathW);
330  PathRemoveExtensionW(pathW);
331 
333 
334  /* now try to make it unique */
335  while (PathFileExistsW(retW))
336  {
337  static const WCHAR fmtW[] = {'%','s',' ','(','%','d',')','%','s',0};
338 
339  sprintfW(retW, fmtW, pathW, i, ext);
340  i++;
341  }
342 
343  strcpyW(buffer, retW);
344  TRACE("ret - %s\n", debugstr_w(buffer));
345 
346  return TRUE;
347 }
#define TRUE
Definition: types.h:120
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:818
#define debugstr_w
Definition: kernel32.h:32
char ext[3]
Definition: mkdosfs.c:358
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
Definition: services.c:325
#define sprintfW
Definition: unicode.h:58
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
Definition: path.c:189
Definition: fci.c:126

Referenced by BrsFolder_NewFolder(), CNewMenu::CreateNewFolder(), CDefaultContextMenu::DoCreateNewFolder(), loadShell32(), and CNewMenu::NewItemByNonCommand().

◆ SHELL_RegisterShellFolders()

HRESULT SHELL_RegisterShellFolders ( void  )

Definition at line 2538 of file shellpath.c.

2539 {
2540  HRESULT hr;
2541 
2543  if (SUCCEEDED(hr))
2545  if (SUCCEEDED(hr))
2547  return hr;
2548 }
static HRESULT _SHRegisterCommonShellFolders(void)
Definition: shellpath.c:2510
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
static HRESULT _SHRegisterUserShellFolders(BOOL bDefault)
Definition: shellpath.c:2442
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by DllRegisterServer().

◆ SHGetFolderLocation()

HRESULT WINAPI SHGetFolderLocation ( HWND  hwndOwner,
int  nFolder,
HANDLE  hToken,
DWORD  dwReserved,
LPITEMIDLIST ppidl 
)

Definition at line 2598 of file shellpath.c.

2604 {
2606 
2607  TRACE("%p 0x%08x %p 0x%08x %p\n",
2608  hwndOwner, nFolder, hToken, dwReserved, ppidl);
2609 
2610  if (!ppidl)
2611  return E_INVALIDARG;
2612  if (dwReserved)
2613  return E_INVALIDARG;
2614 
2615  /* The virtual folders' locations are not user-dependent */
2616  *ppidl = NULL;
2617  switch (nFolder & CSIDL_FOLDER_MASK)
2618  {
2619  case CSIDL_DESKTOP:
2620  *ppidl = _ILCreateDesktop();
2621  break;
2622 
2623  case CSIDL_PERSONAL:
2624  *ppidl = _ILCreateMyDocuments();
2625  break;
2626 
2627  case CSIDL_INTERNET:
2628  *ppidl = _ILCreateIExplore();
2629  break;
2630 
2631  case CSIDL_CONTROLS:
2632  *ppidl = _ILCreateControlPanel();
2633  break;
2634 
2635  case CSIDL_PRINTERS:
2636  *ppidl = _ILCreatePrinters();
2637  break;
2638 
2639  case CSIDL_BITBUCKET:
2640  *ppidl = _ILCreateBitBucket();
2641  break;
2642 
2643  case CSIDL_DRIVES:
2644  *ppidl = _ILCreateMyComputer();
2645  break;
2646 
2647  case CSIDL_NETWORK:
2648  *ppidl = _ILCreateNetwork();
2649  break;
2650 
2651  default:
2652  {
2654 
2655  hr = SHGetFolderPathW(hwndOwner, nFolder, hToken,
2657  if (SUCCEEDED(hr))
2658  {
2659  DWORD attributes=0;
2660 
2661  TRACE("Value=%s\n", debugstr_w(szPath));
2662  hr = SHILCreateFromPathW(szPath, ppidl, &attributes);
2663  }
2665  {
2666  /* unlike SHGetFolderPath, SHGetFolderLocation in shell32
2667  * version 6.0 returns E_FAIL for nonexistent paths
2668  */
2669  hr = E_FAIL;
2670  }
2671  }
2672  }
2673  if(*ppidl)
2674  hr = S_OK;
2675 
2676  TRACE("-- (new pidl %p)\n",*ppidl);
2677  return hr;
2678 }
LPITEMIDLIST _ILCreateDesktop(void)
Definition: pidl.c:1588
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
LPITEMIDLIST _ILCreatePrinters(void)
Definition: pidl.c:1636
#define CSIDL_DESKTOP
Definition: shlobj.h:2003
_In_ int nFolder
Definition: shlobj.h:1435
#define CSIDL_BITBUCKET
Definition: shlobj.h:2013
#define E_FAIL
Definition: ddrawi.h:102
#define CSIDL_CONTROLS
Definition: shlobj.h:2006
#define CSIDL_FOLDER_MASK
Definition: shlobj.h:2061
#define CSIDL_PRINTERS
Definition: shlobj.h:2007
#define CSIDL_DRIVES
Definition: shlobj.h:2019
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST _ILCreateMyComputer(void)
Definition: pidl.c:1599
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
LPITEMIDLIST _ILCreateNetwork(void)
Definition: pidl.c:1655
#define S_OK
Definition: intsafe.h:59
LPCWSTR szPath
Definition: env.c:35
#define CSIDL_INTERNET
Definition: shlobj.h:2004
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:392
#define CSIDL_PERSONAL
Definition: shlobj.h:2008
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085
LPITEMIDLIST _ILCreateIExplore(void)
Definition: pidl.c:1611
LPITEMIDLIST _ILCreateMyDocuments(void)
Definition: pidl.c:1605
LPITEMIDLIST _ILCreateControlPanel(void)
Definition: pidl.c:1617
#define CSIDL_NETWORK
Definition: shlobj.h:2020
LPITEMIDLIST _ILCreateBitBucket(void)
Definition: pidl.c:1661
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CBandSiteMenu::_CreateBuiltInISFBand(), ILIsParentOrSpecialParent(), CExplorerBand::InitializeExplorerBand(), CExplorerBand::InsertSubitems(), LoadRdpSettingsFromFile(), loadShell32(), CShellMenuCallback::OnGetSubMenu(), SaveRdpSettingsToFile(), SHCreateFromDesktop(), SHEmptyRecycleBinW(), SHGetSpecialFolderLocation(), TestCommandLine(), and TestCompareIDList().

◆ SHGetFolderPathA()

HRESULT WINAPI SHGetFolderPathA ( HWND  hwndOwner,
int  nFolder,
HANDLE  hToken,
DWORD  dwFlags,
LPSTR  pszPath 
)

Definition at line 2326 of file shellpath.c.

2332 {
2333  WCHAR szTemp[MAX_PATH];
2334  HRESULT hr;
2335 
2336  TRACE("%p,%d,%p,%#x,%p\n", hwndOwner, nFolder, hToken, dwFlags, pszPath);
2337 
2338  if (pszPath)
2339  *pszPath = '\0';
2340  hr = SHGetFolderPathW(hwndOwner, nFolder, hToken, dwFlags, szTemp);
2341  if (SUCCEEDED(hr) && pszPath)
2342  WideCharToMultiByte(CP_ACP, 0, szTemp, -1, pszPath, MAX_PATH, NULL,
2343  NULL);
2344 
2345  return hr;
2346 }
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
_In_ int nFolder
Definition: shlobj.h:1435
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by init_functionpointers(), loadShell32(), SHGetSpecialFolderPathA(), test_profile_items(), test_SHGetFolderPathA(), and test_SHGetFolderPathAndSubDirA().

◆ SHGetFolderPathAndSubDirA()

HRESULT WINAPI SHGetFolderPathAndSubDirA ( HWND  hwndOwner,
int  nFolder,
HANDLE  hToken,
DWORD  dwFlags,
LPCSTR  pszSubPath,
LPSTR  pszPath 
)

Definition at line 2098 of file shellpath.c.

2105 {
2106  int length;
2107  HRESULT hr = S_OK;
2108  LPWSTR pszSubPathW = NULL;
2109  LPWSTR pszPathW = NULL;
2110 
2111  TRACE("%p,%#x,%p,%#x,%s,%p\n", hwndOwner, nFolder, hToken, dwFlags, debugstr_a(pszSubPath), pszPath);
2112 
2113  if(pszPath) {
2114  pszPathW = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
2115  if(!pszPathW) {
2117  goto cleanup;
2118  }
2119  }
2120  TRACE("%08x,%08x,%s\n",nFolder, dwFlags, debugstr_w(pszSubPathW));
2121 
2122  /* SHGetFolderPathAndSubDirW does not distinguish if pszSubPath isn't
2123  * set (null), or an empty string.therefore call it without the parameter set
2124  * if pszSubPath is an empty string
2125  */
2126  if (pszSubPath && pszSubPath[0]) {
2127  length = MultiByteToWideChar(CP_ACP, 0, pszSubPath, -1, NULL, 0);
2128  pszSubPathW = HeapAlloc(GetProcessHeap(), 0, length * sizeof(WCHAR));
2129  if(!pszSubPathW) {
2131  goto cleanup;
2132  }
2133  MultiByteToWideChar(CP_ACP, 0, pszSubPath, -1, pszSubPathW, length);
2134  }
2135 
2136  hr = SHGetFolderPathAndSubDirW(hwndOwner, nFolder, hToken, dwFlags, pszSubPathW, pszPathW);
2137 
2138  if (SUCCEEDED(hr) && pszPath)
2139  WideCharToMultiByte(CP_ACP, 0, pszPathW, -1, pszPath, MAX_PATH, NULL, NULL);
2140 
2141 cleanup:
2142  HeapFree(GetProcessHeap(), 0, pszPathW);
2143  HeapFree(GetProcessHeap(), 0, pszSubPathW);
2144  return hr;
2145 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
_In_ int nFolder
Definition: shlobj.h:1435
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define MAX_PATH
Definition: compat.h:26
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define S_OK
Definition: intsafe.h:59
#define MultiByteToWideChar
Definition: compat.h:100
char * cleanup(char *str)
Definition: wpickclick.c:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2150
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_SHGetFolderPathAndSubDirA().

◆ SHGetFolderPathAndSubDirW()

HRESULT WINAPI SHGetFolderPathAndSubDirW ( HWND  hwndOwner,
int  nFolder,
HANDLE  hToken,
DWORD  dwFlags,
LPCWSTR  pszSubPath,
LPWSTR  pszPath 
)

Definition at line 2150 of file shellpath.c.

2157 {
2158  HRESULT hr;
2159  WCHAR szBuildPath[MAX_PATH], szTemp[MAX_PATH];
2161  CSIDL_Type type;
2162  int ret;
2163 
2164  TRACE("%p,%#x,%p,%#x,%s,%p\n", hwndOwner, nFolder, hToken, dwFlags, debugstr_w(pszSubPath), pszPath);
2165 
2166  /* Windows always NULL-terminates the resulting path regardless of success
2167  * or failure, so do so first
2168  */
2169  if (pszPath)
2170  *pszPath = '\0';
2171 
2172  if (folder >= ARRAY_SIZE(CSIDL_Data))
2173  return E_INVALIDARG;
2175  return E_INVALIDARG;
2176  szTemp[0] = 0;
2178  switch (type)
2179  {
2180  case CSIDL_Type_Disallowed:
2181  hr = E_INVALIDARG;
2182  break;
2184  hr = S_FALSE;
2185  break;
2187  GetWindowsDirectoryW(szTemp, MAX_PATH);
2188  if (CSIDL_Data[folder].szDefaultPath &&
2189  !IS_INTRESOURCE(CSIDL_Data[folder].szDefaultPath) &&
2190  *CSIDL_Data[folder].szDefaultPath)
2191  {
2192  PathAddBackslashW(szTemp);
2193  strcatW(szTemp, CSIDL_Data[folder].szDefaultPath);
2194  }
2195  hr = S_OK;
2196  break;
2197  case CSIDL_Type_SystemPath:
2198  GetSystemDirectoryW(szTemp, MAX_PATH);
2199  if (CSIDL_Data[folder].szDefaultPath &&
2200  !IS_INTRESOURCE(CSIDL_Data[folder].szDefaultPath) &&
2201  *CSIDL_Data[folder].szDefaultPath)
2202  {
2203  PathAddBackslashW(szTemp);
2204  strcatW(szTemp, CSIDL_Data[folder].szDefaultPath);
2205  }
2206  hr = S_OK;
2207  break;
2210  if (CSIDL_Data[folder].szDefaultPath &&
2211  !IS_INTRESOURCE(CSIDL_Data[folder].szDefaultPath) &&
2212  *CSIDL_Data[folder].szDefaultPath)
2213  {
2214  PathAddBackslashW(szTemp);
2215  strcatW(szTemp, CSIDL_Data[folder].szDefaultPath);
2216  }
2217  hr = S_OK;
2218  break;
2219  case CSIDL_Type_CurrVer:
2221  break;
2222  case CSIDL_Type_User:
2223  hr = _SHGetUserProfilePath(hToken, dwFlags, folder, szTemp);
2224  break;
2225  case CSIDL_Type_AllUsers:
2227  break;
2228  default:
2229  FIXME("bogus type %d, please fix\n", type);
2230  hr = E_INVALIDARG;
2231  break;
2232  }
2233 
2234  /* Expand environment strings if necessary */
2235  if (*szTemp == '%')
2236 #ifndef __REACTOS__
2237  hr = _SHExpandEnvironmentStrings(szTemp, szBuildPath);
2238 #else
2239  hr = _SHExpandEnvironmentStrings(hToken, szTemp, szBuildPath, _countof(szBuildPath));
2240 #endif
2241  else
2242  strcpyW(szBuildPath, szTemp);
2243 
2244  if (FAILED(hr)) goto end;
2245 
2246  if(pszSubPath) {
2247  /* make sure the new path does not exceed the buffer length
2248  * and remember to backslash and terminate it */
2249  if(MAX_PATH < (lstrlenW(szBuildPath) + lstrlenW(pszSubPath) + 2)) {
2251  goto end;
2252  }
2253  PathAppendW(szBuildPath, pszSubPath);
2254  PathRemoveBackslashW(szBuildPath);
2255  }
2256  /* Copy the path if it's available before we might return */
2257  if (SUCCEEDED(hr) && pszPath)
2258  strcpyW(pszPath, szBuildPath);
2259 
2260  /* if we don't care about existing directories we are ready */
2261  if(nFolder & CSIDL_FLAG_DONT_VERIFY) goto end;
2262 
2263  if (PathFileExistsW(szBuildPath)) goto end;
2264 
2265  /* not existing but we are not allowed to create it. The return value
2266  * is verified against shell32 version 6.0.
2267  */
2268  if (!(nFolder & CSIDL_FLAG_CREATE))
2269  {
2271  goto end;
2272  }
2273 
2274  /* create directory/directories */
2275  ret = SHCreateDirectoryExW(hwndOwner, szBuildPath, NULL);
2276  if (ret && ret != ERROR_ALREADY_EXISTS)
2277  {
2278  ERR("Failed to create directory %s.\n", debugstr_w(szBuildPath));
2279  hr = E_FAIL;
2280  goto end;
2281  }
2282 
2283  TRACE("Created missing system directory %s\n", debugstr_w(szBuildPath));
2284 
2285  /* create desktop.ini for custom icon */
2286  if (CSIDL_Data[folder].nShell32IconIndex)
2287  {
2288  static const WCHAR s_szFormat[] = L"%%SystemRoot%%\\system32\\shell32.dll,%d";
2289  WCHAR szIconLocation[MAX_PATH];
2291 
2292  /* make the directory a system folder */
2293  dwAttributes = GetFileAttributesW(szBuildPath);
2295  SetFileAttributesW(szBuildPath, dwAttributes);
2296 
2297  /* build the desktop.ini file path */
2298  PathAppendW(szBuildPath, L"desktop.ini");
2299 
2300  /* build the icon location */
2301  StringCchPrintfW(szIconLocation, _countof(szIconLocation), s_szFormat,
2302  CSIDL_Data[folder].nShell32IconIndex);
2303 
2304  /* write desktop.ini */
2305  WritePrivateProfileStringW(L".ShellClassInfo", L"IconResource", szIconLocation, szBuildPath);
2306 
2307  /* flush! */
2308  WritePrivateProfileStringW(NULL, NULL, NULL, szBuildPath);
2309 
2310  /* make the desktop.ini a system and hidden file */
2311  dwAttributes = GetFileAttributesW(szBuildPath);
2313  SetFileAttributesW(szBuildPath, dwAttributes);
2314  }
2315 
2316 end:
2317  TRACE("returning 0x%08x (final path is %s)\n", hr, debugstr_w(szBuildPath));
2318  return hr;
2319 }
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:944
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
Definition: fci.c:115
HRESULT hr
Definition: shlfolder.c:183
static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest)
Definition: shellpath.c:1932
#define CSIDL_FLAG_DONT_VERIFY
Definition: shlobj.h:2064
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
static HRESULT _SHGetCurrentVersionPath(DWORD dwFlags, BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1636
#define _countof(array)
Definition: fontsub.cpp:30
static const CSIDL_DATA CSIDL_Data[]
Definition: shellpath.c:678
_In_ int nFolder
Definition: shlobj.h:1435
enum _CSIDL_Type CSIDL_Type
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define lstrlenW
Definition: compat.h:407
#define E_FAIL
Definition: ddrawi.h:102
DWORD dwAttributes
Definition: vdmdbg.h:34
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
#define CSIDL_FOLDER_MASK
Definition: shlobj.h:2061
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756
struct CFFOLDER folder
Definition: fdi.c:110
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HRESULT _SHGetUserProfilePath(HANDLE hToken, DWORD dwFlags, BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1746
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder, LPWSTR pszPath)
Definition: shellpath.c:1827
static const WCHAR L[]
Definition: oid.c:1250
UINT WINAPI GetSystemWow64DirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2420
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPWSTR WINAPI PathRemoveBackslashW(LPWSTR lpszPath)
Definition: path.c:862
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define ARRAY_SIZE(a)
Definition: main.h:24
int WINAPI SHCreateDirectoryExW(HWND hWnd, LPCWSTR path, LPSECURITY_ATTRIBUTES sec)
Definition: shlfileop.cpp:846
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define CSIDL_FLAG_CREATE
CSIDL_Type type
Definition: shellpath.c:672
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define ERROR_FILENAME_EXCED_RANGE
Definition: winerror.h:263

Referenced by CBandSiteMenu::_GetQLaunchPidl(), CreateShortcuts(), SHGetFolderPathAndSubDirA(), SHGetFolderPathW(), and ThemePageDlgProc().

◆ SHGetFolderPathW()

HRESULT WINAPI SHGetFolderPathW ( HWND  hwndOwner,
int  nFolder,
HANDLE  hToken,
DWORD  dwFlags,
LPWSTR  pszPath 
)

Definition at line 2085 of file shellpath.c.

2091 {
2092  HRESULT hr = SHGetFolderPathAndSubDirW(hwndOwner, nFolder, hToken, dwFlags, NULL, pszPath);
2095  return hr;
2096 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
_In_ int nFolder
Definition: shlobj.h:1435
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
LONG HRESULT
Definition: typedefs.h:77
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2150

Referenced by _SHRegisterFolders(), AutoStartupApplications(), BrsFolder_NewFolder(), CJournaledTestList::CJournaledTestList(), create_ie_menu(), create_profile_directory(), FILEDLG95_InitControls(), FillDefaultSettings(), format_filelist_filename(), LoadThemes(), OnAddStartMenuItems(), OnAdvancedStartMenuItems(), OnClearRecentItems(), RegisterTypeLibraries(), set_installer_properties(), Settings_GetOutputPath(), SHGetFolderLocation(), SHGetFolderPathA(), SHGetSpecialFolderPathW(), test_namespace(), and testRegStoreSavedCerts().

◆ SHGetSpecialFolderLocation()

HRESULT WINAPI SHGetSpecialFolderLocation ( HWND  hwndOwner,
INT  nFolder,
LPITEMIDLIST ppidl 
)

Definition at line 2687 of file shellpath.c.

2691 {
2693 
2694  TRACE("(%p,0x%x,%p)\n", hwndOwner,nFolder,ppidl);
2695 
2696  if (!ppidl)
2697  return E_INVALIDARG;
2698 
2699  hr = SHGetFolderLocation(hwndOwner, nFolder, NULL, 0, ppidl);
2700  return hr;
2701 }
HRESULT hr
Definition: shlfolder.c:183
_In_ int nFolder
Definition: shlobj.h:1435
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
Definition: shellpath.c:2598

Referenced by _GetDocumentsPidl(), ebrowser_browse_to_desktop(), FILEDLG95_InitControls(), FILEDLG95_LOOKIN_Init(), FILEDLG95_OnWMCommand(), filedlg_collect_places_pidls(), GetFavoritesFolder(), GetMergedFolder(), IShellBrowserImpl_Construct(), loadShell32(), CShellBrowser::OnOrganizeFavorites(), PidlBrowse(), CAddressEditBox::PopulateComboBox(), RSHELL_CStartMenu_CreateInstance(), SHAddToRecentDocs(), SHCloneSpecialIDList(), SHExplorerParseCmdLine(), SpecialFolderPath::SpecialFolderPath(), START_TEST(), test_ACListISF_FAVORITES(), test_ACListISF_MYCOMPUTER(), test_get_file_info_iconlist(), test_namespace(), test_parameters(), test_printers_folder(), test_SHCreateShellItem(), test_SHCreateShellItemArray(), test_ShellItemBindToHandler(), test_ShellItemGetAttributes(), test_SHGetIDListFromObject(), test_SHGetNameFromIDList(), test_SHGetPathFromIDList(), VariantToIdlist(), and WshCollection_Item().

◆ SHGetSpecialFolderPathA()

BOOL WINAPI SHGetSpecialFolderPathA ( HWND  hwndOwner,
LPSTR  szPath,
int  nFolder,
BOOL  bCreate 
)

Definition at line 2553 of file shellpath.c.

2558 {
2559  return SHGetFolderPathA(hwndOwner, nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0), NULL, 0,
2560  szPath) == S_OK;
2561 }
_In_ int nFolder
Definition: shlobj.h:1435
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1435
HRESULT WINAPI SHGetFolderPathA(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath)
Definition: shellpath.c:2326
LPCWSTR szPath
Definition: env.c:35
#define CSIDL_FLAG_CREATE

Referenced by init_strings(), loadShell32(), main(), test_BindToObject(), test_find_file(), and test_GetDisplayName().

◆ SHGetSpecialFolderPathW()

BOOL WINAPI SHGetSpecialFolderPathW ( HWND  hwndOwner,
LPWSTR  szPath,
int  nFolder,
BOOL  bCreate 
)

Definition at line 2566 of file shellpath.c.

2571 {
2572  return SHGetFolderPathW(hwndOwner, nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0), NULL, 0,
2573  szPath) == S_OK;
2574 }
_In_ int nFolder
Definition: shlobj.h:1435
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1435
LPCWSTR szPath
Definition: env.c:35
#define CSIDL_FLAG_CREATE
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085

Referenced by cache_containers_init(), delhist_on_command(), CDesktopFolder::FinalConstruct(), get_csidl_dir(), GetStorageDirectory(), CFSFolder::InitializeEx(), InitPropertyBag_IPropertyBag_Read(), profile_items_callback(), test_FolderShortcut(), test_ITEMIDLIST_format(), test_ParseDisplayName(), test_SHCreateShellItemArray(), and test_SHGetPathFromIDList().

◆ SHPathGetExtensionW()

LPVOID WINAPI SHPathGetExtensionW ( LPCWSTR  lpszPath,
DWORD  void1,
DWORD  void2 
)

Definition at line 101 of file shellpath.c.

102 {
103  return PathGetExtensionW(lpszPath);
104 }
static LPWSTR PathGetExtensionW(LPCWSTR lpszPath)
Definition: shellpath.c:90

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ Administrative_ToolsW

const WCHAR Administrative_ToolsW[] = {'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}
static

Definition at line 529 of file shellpath.c.

◆ AllUsersProfileValueW

const WCHAR AllUsersProfileValueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}
static

Definition at line 637 of file shellpath.c.

Referenced by _SHExpandEnvironmentStrings().

◆ AllUsersProfileW

const WCHAR AllUsersProfileW[] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%','\0'}
static

Definition at line 628 of file shellpath.c.

Referenced by _SHExpandEnvironmentStrings(), and _SHGetDefaultValue().

◆ AllUsersW

const WCHAR AllUsersW[] = {'P','u','b','l','i','c',0}
static

Definition at line 646 of file shellpath.c.

Referenced by _SHExpandEnvironmentStrings().

◆ AppData_LocalLowW

const WCHAR AppData_LocalLowW[] = {'A','p','p','D','a','t','a','\\','L','o','c','a','l','L','o','w','\0'}
static

Definition at line 532 of file shellpath.c.

◆ AppDataW

const WCHAR AppDataW[] = {'A','p','p','D','a','t','a','\0'}
static

Definition at line 530 of file shellpath.c.

◆ Application_DataW

const WCHAR Application_DataW[] = {'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}
static

Definition at line 533 of file shellpath.c.

◆ CacheW

const WCHAR CacheW[] = {'C','a','c','h','e','\0'}
static

Definition at line 535 of file shellpath.c.

◆ CD_BurningW

const WCHAR CD_BurningW[] = {'C','D',' ','B','u','r','n','i','n','g','\0'}
static

Definition at line 536 of file shellpath.c.

◆ Common_Administrative_ToolsW

const WCHAR Common_Administrative_ToolsW[] = {'C','o','m','m','o','n',' ','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'}
static

Definition at line 537 of file shellpath.c.

◆ Common_AppDataW

const WCHAR Common_AppDataW[] = {'C','o','m','m','o','n',' ','A','p','p','D','a','t','a','\0'}
static

Definition at line 538 of file shellpath.c.

◆ Common_DesktopW

const WCHAR Common_DesktopW[] = {'C','o','m','m','o','n',' ','D','e','s','k','t','o','p','\0'}
static

Definition at line 539 of file shellpath.c.

◆ Common_DocumentsW

const WCHAR Common_DocumentsW[] = {'C','o','m','m','o','n',' ','D','o','c','u','m','e','n','t','s','\0'}
static

Definition at line 540 of file shellpath.c.

◆ Common_FavoritesW

const WCHAR Common_FavoritesW[] = {'C','o','m','m','o','n',' ','F','a','v','o','r','i','t','e','s','\0'}
static

Definition at line 541 of file shellpath.c.

◆ Common_ProgramsW

const WCHAR Common_ProgramsW[] = {'C','o','m','m','o','n',' ','P','r','o','g','r','a','m','s','\0'}
static

Definition at line 546 of file shellpath.c.

◆ Common_Start_MenuW

const WCHAR Common_Start_MenuW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t',' ','M','e','n','u','\0'}
static

Definition at line 548 of file shellpath.c.

◆ Common_StartUpW

const WCHAR Common_StartUpW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t','U','p','\0'}
static

Definition at line 547 of file shellpath.c.

◆ Common_TemplatesW

const WCHAR Common_TemplatesW[] = {'C','o','m','m','o','n',' ','T','e','m','p','l','a','t','e','s','\0'}
static

Definition at line 549 of file shellpath.c.

◆ CommonFilesDirW

const WCHAR CommonFilesDirW[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r','\0'}
static

Definition at line 542 of file shellpath.c.

◆ CommonFilesDirX86W

const WCHAR CommonFilesDirX86W[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',' ','(','x','8','6',')','\0'}
static

Definition at line 543 of file shellpath.c.

◆ CommonMusicW

const WCHAR CommonMusicW[] = {'C','o','m','m','o','n','M','u','s','i','c','\0'}
static

Definition at line 544 of file shellpath.c.

◆ CommonPicturesW

const WCHAR CommonPicturesW[] = {'C','o','m','m','o','n','P','i','c','t','u','r','e','s','\0'}
static

Definition at line 545 of file shellpath.c.

◆ CommonVideoW

const WCHAR CommonVideoW[] = {'C','o','m','m','o','n','V','i','d','e','o','\0'}
static

Definition at line 550 of file shellpath.c.

◆ ContactsW

const WCHAR ContactsW[] = {'C','o','n','t','a','c','t','s','\0'}
static

Definition at line 552 of file shellpath.c.

◆ CookiesW

const WCHAR CookiesW[] = {'C','o','o','k','i','e','s','\0'}
static

Definition at line 554 of file shellpath.c.

◆ CSIDL_Data

◆ DefaultW

const WCHAR DefaultW[] = {'.','D','e','f','a','u','l','t','\0'}
static

Definition at line 627 of file shellpath.c.

Referenced by _SHGetUserProfilePath(), and _SHRegisterUserShellFolders().

◆ DesktopW

const WCHAR DesktopW[] = {'D','e','s','k','t','o','p','\0'}
static

Definition at line 555 of file shellpath.c.

Referenced by test_getuserobjectinformation().

◆ DocumentsW

const WCHAR DocumentsW[] = {'D','o','c','u','m','e','n','t','s','\0'}
static

Definition at line 557 of file shellpath.c.

◆ DownloadsW

const WCHAR DownloadsW[] = {'D','o','w','n','l','o','a','d','s','\0'}
static

Definition at line 558 of file shellpath.c.

◆ FavoritesW

const WCHAR FavoritesW[] = {'F','a','v','o','r','i','t','e','s','\0'}
static

Definition at line 560 of file shellpath.c.

◆ FontsW

const WCHAR FontsW[] = {'F','o','n','t','s','\0'}
static

Definition at line 561 of file shellpath.c.

◆ HistoryW

const WCHAR HistoryW[] = {'H','i','s','t','o','r','y','\0'}
static

Definition at line 562 of file shellpath.c.

◆ is_win64

◆ LinksW

const WCHAR LinksW[] = {'L','i','n','k','s','\0'}
static

Definition at line 564 of file shellpath.c.

◆ Local_AppDataW

const WCHAR Local_AppDataW[] = {'L','o','c','a','l',' ','A','p','p','D','a','t','a','\0'}
static

Definition at line 566 of file shellpath.c.

◆ Local_Settings_Application_DataW

const WCHAR Local_Settings_Application_DataW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'}
static

Definition at line 568 of file shellpath.c.

◆ Local_Settings_CD_BurningW

const WCHAR Local_Settings_CD_BurningW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\\','M','i','c','r','o','s','o','f','t','\\','C','D',' ','B','u','r','n','i','n','g','\0'}
static

Definition at line 570 of file shellpath.c.

◆ Local_Settings_HistoryW

const WCHAR Local_Settings_HistoryW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\','H','i','s','t','o','r','y','\0'}
static

Definition at line