RtlFormatCurrentUserKeyPath: return path containing the user name

instead of .Default.
This commit is contained in:
Alexandre Julliard 2002-09-13 17:45:07 +00:00
parent 90d6528099
commit c227edc5c3
1 changed files with 20 additions and 10 deletions

View File

@ -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(
/****************************************************************************** /******************************************************************************
* 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;
FIXME("(%p) stub\n",KeyPath); if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, strlen(user)+16 )))
RtlInitAnsiString(&AnsiPath, Path); return STATUS_NO_MEMORY;
return RtlAnsiStringToUnicodeString(KeyPath, &AnsiPath, TRUE);
strcpy( buffer, "\\Registry\\User\\" );
strcat( buffer, user );
RtlInitAnsiString( &AnsiPath, buffer );
ret = RtlAnsiStringToUnicodeString(KeyPath, &AnsiPath, TRUE);
RtlFreeAnsiString( &AnsiPath );
return ret;
} }
/****************************************************************************** /******************************************************************************