Stubs for LookupPrivilege* added.
authorEmanuele Aliberti <ea@iol.it>
Sat, 17 Mar 2001 22:05:25 +0000 (22:05 +0000)
committerEmanuele Aliberti <ea@iol.it>
Sat, 17 Mar 2001 22:05:25 +0000 (22:05 +0000)
svn path=/trunk/; revision=1708

reactos/lib/advapi32/advapi32.edf
reactos/lib/advapi32/makefile
reactos/lib/advapi32/token/privilege.c [new file with mode: 0644]

index 8e00ddf..ff56f8a 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: advapi32.edf,v 1.11 2001/01/14 12:15:18 ea Exp $
+; $Id: advapi32.edf,v 1.12 2001/03/17 22:05:25 ea Exp $
 ;
 ; advapi32.def
 ;
@@ -195,12 +195,12 @@ LockServiceDatabase=LockServiceDatabase@4
 ;LookupAccountNameW=LookupAccountNameW@28
 LookupAccountSidA=LookupAccountSidA@28
 LookupAccountSidW=LookupAccountSidW@28
-;LookupPrivilegeDisplayNameA=LookupPrivilegeDisplayNameA@20
-;LookupPrivilegeDisplayNameW=LookupPrivilegeDisplayNameW@20
-;LookupPrivilegeNameA=LookupPrivilegeNameA@16
-;LookupPrivilegeNameW=LookupPrivilegeNameW@16
-;LookupPrivilegeValueA=LookupPrivilegeValueA@12
-;LookupPrivilegeValueW=LookupPrivilegeValueW@12
+LookupPrivilegeDisplayNameA=LookupPrivilegeDisplayNameA@20
+LookupPrivilegeDisplayNameW=LookupPrivilegeDisplayNameW@20
+LookupPrivilegeNameA=LookupPrivilegeNameA@16
+LookupPrivilegeNameW=LookupPrivilegeNameW@16
+LookupPrivilegeValueA=LookupPrivilegeValueA@12
+LookupPrivilegeValueW=LookupPrivilegeValueW@12
 ;LookupSecurityDescriptorPartsA=LookupSecurityDescriptorPartsA@28
 ;LookupSecurityDescriptorPartsW=LookupSecurityDescriptorPartsW@28
 ;LsaAddAccountRights=LsaAddAccountRights@16
index e125bad..b3a1f06 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.16 2000/11/20 19:59:08 ekohl Exp $
+# $Id: makefile,v 1.17 2001/03/17 22:05:25 ea Exp $
 #
 # Makefile for ReactOS advapi32.dll
 #
@@ -12,22 +12,39 @@ DLLTARGET=$(TARGETNAME).dll
 
 
 
-MISC_OBJECTS = misc/dllmain.o misc/shutdown.o \
-               misc/sysfunc.o 
+MISC_OBJECTS=\
+       misc/dllmain.o  \
+       misc/shutdown.o \
+       misc/sysfunc.o 
 
-REGISTRY_OBJECTS = reg/reg.o
+REGISTRY_OBJECTS=\
+       reg/reg.o
 
-SECURITY_OBJECTS = sec/lsa.o sec/sec.o sec/ac.o sec/sid.o
+SECURITY_OBJECTS=\
+       sec/lsa.o       \
+       sec/sec.o       \
+       sec/ac.o        \
+       sec/sid.o
 
-SERVICE_OBJECTS = service/scm.o service/sctrl.o service/undoc.o
+SERVICE_OBJECTS=\
+       service/scm.o   \
+       service/sctrl.o \
+       service/undoc.o
 
-TOKEN_OBJECTS = token/token.o
+TOKEN_OBJECTS=\
+       token/privilege.o       \
+       token/token.o
 
-RESOURCE_OBJECT = $(TARGETNAME).coff
+RESOURCE_OBJECT=\
+       $(TARGETNAME).coff
 
-OBJECTS = $(MISC_OBJECTS) $(REGISTRY_OBJECTS) $(SECURITY_OBJECTS) \
-          $(SERVICE_OBJECTS) $(TOKEN_OBJECTS) \
-         $(RESOURCE_OBJECT)
+OBJECTS=\
+       $(MISC_OBJECTS)         \
+       $(REGISTRY_OBJECTS)     \
+       $(SECURITY_OBJECTS)     \
+       $(SERVICE_OBJECTS)      \
+       $(TOKEN_OBJECTS)        \
+       $(RESOURCE_OBJECT)
 
 ifeq ($(DOSCLI),yes)
 CLEAN_FILES = misc\*.o reg\*.o sec\*.o service\*.o token\*.o \
@@ -57,9 +74,11 @@ $(TARGETNAME).dll: $(DLLMAIN) $(OBJECTS) $(TARGETNAME).def
                $(TARGETNAME).o \
                ../ntdll/ntdll.a \
                ../kernel32/kernel32.a \
-               -nostartfiles -nostdlib -Wl,--entry=_DllMain@12\
+               -nostartfiles \
+               -nostdlib \
                -mdll \
                -o junk.tmp \
+               -Wl,--entry=_DllMain@12\
                -Wl,--base-file,base.tmp 
        - $(RM) junk.tmp
        $(DLLTOOL) \
@@ -72,9 +91,11 @@ $(TARGETNAME).dll: $(DLLMAIN) $(OBJECTS) $(TARGETNAME).def
                $(TARGETNAME).o \
                ../ntdll/ntdll.a \
                ../kernel32/kernel32.a \
-               -nostartfiles -nostdlib -Wl,--entry=_DllMain@12\
+               -nostartfiles \
+               -nostdlib \
                -mdll \
                -o $(TARGETNAME).dll \
+               -Wl,--entry=_DllMain@12\
                -Wl,--image-base,0x77dc0000 \
                -Wl,--file-alignment,0x1000 \
                -Wl,--section-alignment,0x1000 \
diff --git a/reactos/lib/advapi32/token/privilege.c b/reactos/lib/advapi32/token/privilege.c
new file mode 100644 (file)
index 0000000..3d54a86
--- /dev/null
@@ -0,0 +1,177 @@
+/* $Id: privilege.c,v 1.1 2001/03/17 22:05:25 ea Exp $ 
+ *
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS system libraries
+ * FILE:            lib/advapi32/token/privilege.c
+ * PURPOSE:         advapi32.dll token's privilege handling
+ * PROGRAMMER:      E.Aliberti
+ * UPDATE HISTORY:
+ *     20010317 ea     stubs
+ */
+#include <windows.h>
+#include <ddk/ntddk.h>
+
+
+/**********************************************************************
+ *     LookupPrivilegeValueA                           EXPORTED
+ *     LookupPrivilegeValueW                           EXPORTED
+ */
+BOOL STDCALL LookupPrivilegeValueA (
+       LPCSTR  lpSystemName, 
+       LPCSTR  lpName, 
+       PLUID   lpLuid 
+       )
+{
+       BOOL            rv = FALSE;
+       DWORD           le = ERROR_SUCCESS;
+
+       ANSI_STRING     SystemNameA;
+       UNICODE_STRING  SystemNameW;
+       ANSI_STRING     NameA;
+       UNICODE_STRING  NameW;
+
+       HANDLE          ProcessHeap = GetProcessHeap ();
+
+
+       /* Remote system? */
+       if (NULL != lpSystemName)
+       {
+               RtlInitAnsiString (
+                       & SystemNameA,
+                       (LPSTR) lpSystemName
+                       );
+               RtlAnsiStringToUnicodeString (
+                       & SystemNameW,
+                       & SystemNameA,
+                       TRUE
+                       );
+       }
+       /* Check the privilege name is not NULL */
+       if (NULL != lpName)
+       {
+               RtlInitAnsiString (
+                       & NameA,
+                       (LPSTR) lpName
+                       );
+               RtlAnsiStringToUnicodeString (
+                       & NameW,
+                       & NameA,
+                       TRUE
+                       );
+       }
+       else
+       {
+               SetLastError (ERROR_INVALID_PARAMETER);
+               return (FALSE);
+       }
+       /* 
+        * Forward the call to the UNICODE version
+        * of this API.
+        */
+       if (FALSE == (rv = LookupPrivilegeValueW (
+                               (lpSystemName ? SystemNameW.Buffer : NULL), 
+                               NameW.Buffer, 
+                               lpLuid 
+                               )
+                       )
+               )
+       {
+               le = GetLastError ();
+       }
+       /* Remote system? */
+       if (NULL != lpSystemName)
+       {
+               RtlFreeHeap (
+                       ProcessHeap,
+                       0,
+                       SystemNameW.Buffer
+                       );
+       }
+       /* Name */
+       RtlFreeHeap (
+               ProcessHeap,
+               0,
+              NameW.Buffer
+              );
+       /*
+        * Set the last error, if any reported by
+        * the UNICODE call.
+        */
+       if (ERROR_SUCCESS != le)
+       {
+               SetLastError (le);
+       }
+       return (rv);
+}
+
+BOOL STDCALL LookupPrivilegeValueW (
+       LPCWSTR lpSystemName, 
+       LPCWSTR lpName, 
+       PLUID   lpLuid 
+       )
+{
+       SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+       return (FALSE);
+}
+
+
+/**********************************************************************
+ *     LookupPrivilegeDisplayNameA                     EXPORTED
+ *     LookupPrivilegeDisplayNameW                     EXPORTED
+ */
+BOOL STDCALL LookupPrivilegeDisplayNameA (
+       LPCSTR  lpSystemName, 
+       LPCSTR  lpName, 
+       LPSTR   lpDisplayName, 
+       LPDWORD cbDisplayName, 
+       LPDWORD lpLanguageId 
+       )
+{
+       SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+       return (FALSE);
+}
+       
+
+BOOL STDCALL LookupPrivilegeDisplayNameW (
+       LPCWSTR lpSystemName, 
+       LPCWSTR lpName, 
+       LPWSTR  lpDisplayName, 
+       LPDWORD cbDisplayName, 
+       LPDWORD lpLanguageId 
+       )
+{
+       SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+       return (FALSE);
+}
+
+
+/**********************************************************************
+ *     LookupPrivilegeNameA                            EXPORTED
+ *     LookupPrivilegeNameW                            EXPORTED
+ */
+BOOL STDCALL LookupPrivilegeNameA (
+       LPCSTR  lpSystemName, 
+       PLUID   lpLuid, 
+       LPSTR   lpName, 
+       LPDWORD cbName 
+       ) 
+{
+       SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+       return (FALSE);
+}
+
+BOOL STDCALL LookupPrivilegeNameW (
+       LPCWSTR lpSystemName, 
+       PLUID   lpLuid, 
+       LPWSTR  lpName, 
+       LPDWORD cbName 
+       ) 
+{
+       SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+       return (FALSE);
+}
+
+/* EOF */