advapi32 from CW
Duane Clark
dclark at akamail.com
Sun Jan 27 19:06:23 CST 2002
Modified files:
dlls/advapi32 : registry.c
dlls/advapi32 : advapi32.spec
dlls/advapi32 : security.c
Log message:
Codeweavers
Minor error handling change in registry.
Implement CheckTokenMembership and GetAce.
-------------- next part --------------
Index: dlls/advapi32/registry.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/registry.c,v
retrieving revision 1.30
diff -u -r1.30 registry.c
--- dlls/advapi32/registry.c 2001/12/05 22:18:48 1.30
+++ dlls/advapi32/registry.c 2002/01/27 23:09:03
@@ -86,6 +86,7 @@
UNICODE_STRING classW;
ANSI_STRING nameA, classA;
NTSTATUS status;
+ DWORD err = GetLastError();
if (reserved) return ERROR_INVALID_PARAMETER;
if (!(access & KEY_ALL_ACCESS) || (access & ~KEY_ALL_ACCESS)) return ERROR_ACCESS_DENIED;
@@ -108,6 +109,7 @@
RtlFreeUnicodeString( &classW );
}
}
+ SetLastError(err);
return RtlNtStatusToDosError( status );
}
@@ -180,6 +182,7 @@
OBJECT_ATTRIBUTES attr;
STRING nameA;
NTSTATUS status;
+ DWORD err = GetLastError();
attr.Length = sizeof(attr);
attr.RootDirectory = hkey;
@@ -194,6 +197,7 @@
{
status = NtOpenKey( retkey, access, &attr );
}
+ SetLastError(err);
return RtlNtStatusToDosError( status );
}
@@ -659,6 +663,7 @@
ANSI_STRING nameA;
WCHAR *dataW = NULL;
NTSTATUS status;
+ DWORD error = GetLastError();
if (GetVersion() & 0x80000000) /* win95 */
{
@@ -674,7 +679,11 @@
{
DWORD lenW;
RtlMultiByteToUnicodeSize( &lenW, data, count );
- if (!(dataW = HeapAlloc( GetProcessHeap(), 0, lenW ))) return ERROR_OUTOFMEMORY;
+ if (!(dataW = HeapAlloc( GetProcessHeap(), 0, lenW )))
+ {
+ SetLastError(error);
+ return ERROR_OUTOFMEMORY;
+ }
RtlMultiByteToUnicodeN( dataW, lenW, NULL, data, count );
count = lenW;
data = (BYTE *)dataW;
@@ -687,6 +696,8 @@
status = NtSetValueKey( hkey, &NtCurrentTeb()->StaticUnicodeString, 0, type, data, count );
}
if (dataW) HeapFree( GetProcessHeap(), 0, dataW );
+
+ SetLastError(error);
return RtlNtStatusToDosError( status );
}
Index: dlls/advapi32/advapi32.spec
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/advapi32.spec,v
retrieving revision 1.18
diff -u -r1.18 advapi32.spec
--- dlls/advapi32/advapi32.spec 2002/01/10 19:29:40 1.18
+++ dlls/advapi32/advapi32.spec 2002/01/27 23:09:03
@@ -89,7 +89,7 @@
@ stdcall EqualSid(ptr ptr) EqualSid
@ stub FindFirstFreeAce
@ stdcall FreeSid(ptr) FreeSid
-@ stub GetAce
+@ stdcall GetAce(ptr long ptr) GetAce
@ stub GetAclInformation
@ stdcall GetFileSecurityA(str long ptr long ptr) GetFileSecurityA
@ stdcall GetFileSecurityW(wstr long ptr long ptr) GetFileSecurityW
@@ -323,3 +323,4 @@
@ stub I_ScSetServiceBitsA
@ stub EnumServiceGroupA
@ stub EnumServiceGroupW
+@ stdcall CheckTokenMembership(long ptr ptr) CheckTokenMembership
Index: dlls/advapi32/security.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/security.c,v
retrieving revision 1.35
diff -u -r1.35 security.c
--- dlls/advapi32/security.c 2001/08/09 21:16:55 1.35
+++ dlls/advapi32/security.c 2002/01/27 23:09:04
@@ -91,6 +91,24 @@
}
/******************************************************************************
+ * CheckTokenMembership [ADVAPI32.@]
+ *
+ * PARAMS
+ * TokenHandle []
+ * SidToCheck []
+ * IsMember []
+ */
+BOOL WINAPI
+CheckTokenMembership( HANDLE TokenHandle, PSID SidToCheck,
+ PBOOL IsMember )
+{
+ FIXME("(0x%08x %p %p) stub!\n", TokenHandle, SidToCheck, IsMember);
+
+ *IsMember = TRUE;
+ return(TRUE);
+}
+
+/******************************************************************************
* GetTokenInformation [ADVAPI32.@]
*
* PARAMS
@@ -918,4 +936,12 @@
{
FIXME("(%s,%s,%p,%p,%p,%p,%p), stub.\n",system,account,sid,cbSid,ReferencedDomainName,cbReferencedDomainName,name_use);
return FALSE;
+}
+
+/******************************************************************************
+ * GetAce [ADVAPI32.@]
+ */
+BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce )
+{
+ CallWin32ToNt(RtlGetAce(pAcl, dwAceIndex, pAce));
}
More information about the wine-patches
mailing list