Skip to content
Snippets Groups Projects
Commit c227edc5 authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

RtlFormatCurrentUserKeyPath: return path containing the user name

instead of .Default.
parent 90d65280
No related branches found
No related tags found
No related merge requests found
...@@ -28,14 +28,16 @@ ...@@ -28,14 +28,16 @@
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#include <stdio.h>
#include <string.h> #include <string.h>
#include "wine/debug.h"
#include "winreg.h"
#include "winerror.h" #include "winerror.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/library.h"
#include "wine/server.h" #include "wine/server.h"
#include "winternl.h" #include "winternl.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(reg); WINE_DEFAULT_DEBUG_CHANNEL(reg);
...@@ -579,17 +581,25 @@ NTSTATUS WINAPI NtUnloadKey( ...@@ -579,17 +581,25 @@ NTSTATUS WINAPI NtUnloadKey(
/****************************************************************************** /******************************************************************************
* RtlFormatCurrentUserKeyPath [NTDLL.@] * RtlFormatCurrentUserKeyPath [NTDLL.@]
*
* NOTE: under NT the user name part of the path is an SID.
*/ */
NTSTATUS WINAPI RtlFormatCurrentUserKeyPath( NTSTATUS WINAPI RtlFormatCurrentUserKeyPath( IN OUT PUNICODE_STRING KeyPath)
IN OUT PUNICODE_STRING KeyPath)
{ {
/* LPSTR Path = "\\REGISTRY\\USER\\S-1-5-21-0000000000-000000000-0000000000-500";*/ const char *user = wine_get_user_name();
LPSTR Path = "\\REGISTRY\\USER\\.DEFAULT"; char *buffer;
ANSI_STRING AnsiPath; ANSI_STRING AnsiPath;
NTSTATUS ret;
if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, strlen(user)+16 )))
return STATUS_NO_MEMORY;
FIXME("(%p) stub\n",KeyPath); strcpy( buffer, "\\Registry\\User\\" );
RtlInitAnsiString(&AnsiPath, Path); strcat( buffer, user );
return RtlAnsiStringToUnicodeString(KeyPath, &AnsiPath, TRUE); RtlInitAnsiString( &AnsiPath, buffer );
ret = RtlAnsiStringToUnicodeString(KeyPath, &AnsiPath, TRUE);
RtlFreeAnsiString( &AnsiPath );
return ret;
} }
/****************************************************************************** /******************************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment