Skip to content

Commit

Permalink
Save NSUserDefaults to local app data, not roaming app data.
Browse files Browse the repository at this point in the history
App preferences writes with kCFPreferencesAnyHost, which means we cannot
use the host parameter to differentiate roaming vs local.

The correct way to roam would be through ubiquitous store (which would
have to be covered separately based on need).

Fix microsoft#1167
  • Loading branch information
Raj Seshasankaran committed Oct 18, 2016
1 parent 212dba2 commit 478026d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Frameworks/CoreFoundation/Base.subproj/CFPlatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ CF_INLINE CFIndex strlen_UniChar(const UniChar* p) {
* or if the bundle name cannot be obtained:
* <nFolder_path>\Apple Computer\
* where nFolder_path is obtained by calling SHGetFolderPath with nFolder
* (for example, with CSIDL_APPDATA or CSIDL_LOCAL_APPDATA).
* (CSIDL_LOCAL_APPDATA).
*
* The CFMutableStringRef result must be released by the caller.
*
Expand All @@ -505,8 +505,9 @@ CF_EXPORT CFMutableStringRef _CFCreateApplicationRepositoryPath(CFAllocatorRef a
CFMutableStringRef result = NULL;
CFStringRef str = NULL;

// WINOBJC: make sure that nFolder is CSIDL_APPDATA or CSIDL_LOCAL_APPDATA and return the app data folder for the app.
Wrappers::HString path = GetAppDataPath(nFolder == CSIDL_LOCAL_APPDATA);
// In Reference platform, CFPreferences does not roam, so ignore nFolder

Wrappers::HString path = GetAppDataPath(true);
if (path.IsValid()) {
unsigned int rawLength;
const wchar_t* rawPath = WindowsGetStringRawBuffer(path.Get(), &rawLength);
Expand Down

0 comments on commit 478026d

Please sign in to comment.