correcting RtlConvertSidToUnicodeString, stub for VerSetConditionMask --- juergen.schmied@debitel.net
Index: wine/dlls/ntdll/ntdll.spec =================================================================== RCS file: /home/wine/wine/dlls/ntdll/ntdll.spec,v retrieving revision 1.60 diff -d -u -r1.60 ntdll.spec --- wine/dlls/ntdll/ntdll.spec 23 Mar 2002 18:48:12 -0000 1.60 +++ wine/dlls/ntdll/ntdll.spec 7 May 2002 18:58:13 -0000 @@ -310,7 +310,7 @@ @ stub RtlConvertExclusiveToShared @ stdcall -ret64 RtlConvertLongToLargeInteger(long) RtlConvertLongToLargeInteger @ stub RtlConvertSharedToExclusive -@ stdcall RtlConvertSidToUnicodeString(ptr ptr)RtlConvertSidToUnicodeString +@ stdcall RtlConvertSidToUnicodeString(ptr ptr long)RtlConvertSidToUnicodeString @ stub RtlConvertUiListToApiList @ stdcall -ret64 RtlConvertUlongToLargeInteger(long) RtlConvertUlongToLargeInteger @ stub RtlCopyLuid @@ -1013,6 +1013,7 @@ @ stub RtlCreatePropertySet @ stub RtlSetPropertySetClassId @ stdcall NtPowerInformation(long long long long long) NtPowerInformation +@ stdcall -ret64 VerSetConditionMask(long long long long)VerSetConditionMask ################## # Wine extensions Index: wine/dlls/ntdll/nt.c =================================================================== RCS file: /home/wine/wine/dlls/ntdll/nt.c,v retrieving revision 1.39 diff -d -u -r1.39 nt.c --- wine/dlls/ntdll/nt.c 1 May 2002 22:02:02 -0000 1.39 +++ wine/dlls/ntdll/nt.c 7 May 2002 18:58:11 -0000 @@ -737,3 +762,18 @@ return STATUS_SUCCESS; } + +/****************************************************************************** + * VerSetConditionMask (NTDLL.@) + */ +LONGLONG WINAPI VerSetConditionMask( LONGLONG dwlConditionMask, DWORD dwTypeBitMask, BYTE dwConditionMask) +{ + FIXME("%llx %lu %u\n", dwlConditionMask, dwTypeBitMask, dwConditionMask); + return dwlConditionMask; +} + Index: wine/dlls/ntdll/sec.c =================================================================== RCS file: /home/wine/wine/dlls/ntdll/sec.c,v retrieving revision 1.21 diff -d -u -r1.21 sec.c --- wine/dlls/ntdll/sec.c 9 Mar 2002 23:39:09 -0000 1.21 +++ wine/dlls/ntdll/sec.c 7 May 2002 18:58:16 -0000 @@ -23,6 +23,8 @@ #include <time.h> #include <ctype.h> #include <math.h> +#include <pwd.h> +#include <unistd.h> #include "windef.h" #include "winbase.h" #include "wine/exception.h" @@ -721,23 +723,43 @@ /****************************************************************************** * RtlConvertSidToUnicodeString (NTDLL.@) + * + * The returned SID is used to access the USER registry hive usually + * + * the native function returns something like + * "S-1-5-21-0000000000-000000000-0000000000-500"; */ NTSTATUS WINAPI RtlConvertSidToUnicodeString( - PUNICODE_STRING UnicodeSID, - PSID *pSid) + PUNICODE_STRING String, + PSID Sid, + BOOLEAN AllocateString) { -/* LPSTR GenSID = "S-1-5-21-0000000000-000000000-0000000000-500"; */ + const char *p; + ANSI_STRING AnsiStr; + ULONG Length; - LPSTR GenSID = ".Default"; /* usually the returned SID is used to */ - /* access "\\REGISTRY\\USER\\.DEFAULT" */ + struct passwd *pwd = getpwuid( getuid() ); + p = (pwd) ? pwd->pw_name : ".Default"; - ANSI_STRING AnsiStr; + FIXME("(%p %p %u)\n", String, Sid, AllocateString); - FIXME("(%p %p)\n", UnicodeSID, pSid); - if (UnicodeSID) - TRACE("%p(<OUT>) (%u %u)\n", - UnicodeSID->Buffer, UnicodeSID->Length, UnicodeSID->MaximumLength); + Length = strlen(p); - RtlInitAnsiString(&AnsiStr, GenSID); - return RtlAnsiStringToUnicodeString(UnicodeSID, &AnsiStr, TRUE); + if (AllocateString) + { + String->Buffer = RtlAllocateHeap(GetProcessHeap(), 0, Length + sizeof(WCHAR)); + if (String->Buffer == NULL) return STATUS_NO_MEMORY; + String->MaximumLength = Length + sizeof(WCHAR); + } + else + { + if (Length > String->MaximumLength) return STATUS_BUFFER_TOO_SMALL; + } + RtlInitAnsiString(&AnsiStr, p); + RtlAnsiStringToUnicodeString(String, &AnsiStr, TRUE); + + TRACE("%s (%u %u)\n",debugstr_w(String->Buffer),String->Length,String->MaximumLength); + return STATUS_SUCCESS; } + +