Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 95 of file desktop.c.
Referenced by AddItemW(), CreateGroupW(), DeleteGroupW(), and DeleteItemW().
{ WCHAR szPath[MAX_PATH]; DWORD dwLength; DWORD dwType; HKEY hKey; LONG Error; DPRINT ("GetProgramsPath() called\n"); Error = RegOpenKeyExW (HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders", 0, KEY_QUERY_VALUE, &hKey); if (Error != ERROR_SUCCESS) { DPRINT1 ("RegOpenKeyExW() failed\n"); SetLastError((DWORD)Error); return FALSE; } dwLength = MAX_PATH * sizeof(WCHAR); Error = RegQueryValueExW (hKey, bCommonPath ? L"Common Programs" : L"Programs", 0, &dwType, (LPBYTE)szPath, &dwLength); if (Error != ERROR_SUCCESS) { DPRINT1 ("RegQueryValueExW() failed\n"); RegCloseKey (hKey); SetLastError((DWORD)Error); return FALSE; } RegCloseKey (hKey); if (dwType == REG_EXPAND_SZ) { ExpandEnvironmentStringsW (szPath, lpProgramsPath, MAX_PATH); } else { wcscpy (lpProgramsPath, szPath); } DPRINT ("GetProgramsPath() done\n"); return TRUE; }