Author: ekohl
Date: Sun Dec 14 07:16:16 2008
New Revision: 38078
URL:
http://svn.reactos.org/svn/reactos?rev=38078&view=rev
Log:
- SEH-protect LsaClose, LsaDelete and LsaOpenPolicy.
- Move the code of LsaOpenPolicy into LsarOpenPolicy and make LsaOpenPolicy call
LsarOpenPolicy.
Modified:
trunk/reactos/dll/win32/advapi32/sec/lsa.c
trunk/reactos/dll/win32/lsasrv/lsarpc.c
Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/lsa…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] Sun Dec 14 07:16:16 2008
@@ -78,13 +78,21 @@
NTSTATUS WINAPI
LsaClose(LSA_HANDLE ObjectHandle)
{
+ NTSTATUS Status;
+
TRACE("LsaClose(0x%p) called\n", ObjectHandle);
- /* This is our fake handle, don't go too much long way */
- if (ObjectHandle == (LSA_HANDLE)0xcafe)
- return STATUS_SUCCESS;
-
- return LsarClose((PLSAPR_HANDLE)&ObjectHandle);
+ _SEH2_TRY
+ {
+ Status = LsarClose((PLSAPR_HANDLE)&ObjectHandle);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ _SEH2_END;
+
+ return Status;
}
@@ -94,9 +102,21 @@
NTSTATUS WINAPI
LsaDelete(LSA_HANDLE ObjectHandle)
{
+ NTSTATUS Status;
+
TRACE("LsaDelete(0x%p) called\n", ObjectHandle);
- return LsarDelete((LSAPR_HANDLE)ObjectHandle);
+ _SEH2_TRY
+ {
+ Status = LsarDelete((LSAPR_HANDLE)ObjectHandle);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ _SEH2_END;
+
+ return Status;
}
@@ -365,13 +385,32 @@
IN ACCESS_MASK DesiredAccess,
IN OUT PLSA_HANDLE PolicyHandle)
{
- TRACE("(%s,%p,0x%08x,%p) stub\n",
+ NTSTATUS Status;
+
+ TRACE("LsaOpenPolicy (%s,%p,0x%08x,%p)\n",
SystemName?debugstr_w(SystemName->Buffer):"(null)",
ObjectAttributes, DesiredAccess, PolicyHandle);
- if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
- return STATUS_SUCCESS;
-}
+ _SEH2_TRY
+ {
+ *PolicyHandle = NULL;
+
+ Status = LsarOpenPolicy(SystemName->Buffer,
+ (PLSAPR_OBJECT_ATTRIBUTES)ObjectAttributes,
+ DesiredAccess,
+ PolicyHandle);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ _SEH2_END;
+
+ TRACE("LsaOpenPolicy() done (Status: 0x%08lx)\n", Status);
+
+ return Status;
+}
+
/*
* @unimplemented
Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Sun Dec 14 07:16:16 2008
@@ -162,8 +162,8 @@
/* Function 0 */
-NTSTATUS LsarClose(
- LSAPR_HANDLE *ObjectHandle)
+NTSTATUS
+LsarClose(LSAPR_HANDLE *ObjectHandle)
{
#if 0
PLSAR_POLICY_HANDLE Policy = NULL;
@@ -183,14 +183,24 @@
return Status;
#endif
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
+
+ TRACE("LsarClose called!\n");
+
+ /* This is our fake handle, don't go too much long way */
+ if (*ObjectHandle == (LSA_HANDLE)0xcafe)
+ Status = STATUS_SUCCESS;
+
+
+ TRACE("LsarClose done (Status: 0x%08lx)!\n", Status);
+
+ return Status;
}
/* Function 1 */
-NTSTATUS LsarDelete(
- LSAPR_HANDLE ObjectHandle)
+NTSTATUS
+LsarDelete(LSAPR_HANDLE ObjectHandle)
{
/* Deprecated */
return STATUS_NOT_SUPPORTED;
@@ -252,16 +262,13 @@
ACCESS_MASK DesiredAccess,
LSAPR_HANDLE *PolicyHandle)
{
- ERR("LsarOpenPolicy called!\n");
+ TRACE("LsarOpenPolicy called!\n");
*PolicyHandle = (LSAPR_HANDLE)0xcafe;
- ERR("LsarOpenPolicy done!\n");
+ TRACE("LsarOpenPolicy done!\n");
return STATUS_SUCCESS;
-
-// UNIMPLEMENTED;
-// return STATUS_NOT_IMPLEMENTED;
}