Commit in reactos on MAIN
apps/utils/Makefile+1-11.12 -> 1.13
drivers/fs/cdfs/common.c+3-31.7 -> 1.8
lib/advapi32/sec/misc.c+37-51.27 -> 1.28
lib/user32/misc/display.c+24-71.13 -> 1.14
ntoskrnl/io/bootlog.c+3-31.5 -> 1.6
subsys/win32k/objects/dc.c+17-11.150 -> 1.151
                     /gdiobj.c+4-11.74 -> 1.75
+89-21
7 modified files
* Implement EnumDisplayDevicesA
* Better implementation of LookupAccountSidA/W stubs
* Allow enumeration of display settings in CLI mode
* Add route app to compile/install target
* Correct debug messages

Patch by Herv� Poussineau.

reactos/apps/utils
Makefile 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- Makefile	21 Nov 2004 23:00:18 -0000	1.12
+++ Makefile	12 Dec 2004 21:25:04 -0000	1.13
@@ -11,7 +11,7 @@
 # cabman cat net objdir partinfo pice ps sc stats
 UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount consw rundll32 ps
 
-UTIL_NET_APPS = arp finger ipconfig netstat ping telnet whois
+UTIL_NET_APPS = arp finger ipconfig netstat ping route telnet whois
 
 
 all: $(UTIL_APPS) $(UTIL_NET_APPS)

reactos/drivers/fs/cdfs
common.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- common.c	10 Nov 2003 18:07:36 -0000	1.7
+++ common.c	12 Dec 2004 21:25:04 -0000	1.8
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: common.c,v 1.7 2003/11/10 18:07:36 ekohl Exp $
+/* $Id: common.c,v 1.8 2004/12/12 21:25:04 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -146,8 +146,8 @@
   DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, "
 	 "InputBuffer %x, InputBufferSize %x, OutputBuffer %x, " 
 	 "POutputBufferSize %x (%x)\n", DeviceObject, CtlCode, 
-	 InputBuffer, InputBufferSize, OutputBuffer, pOutputBufferSize, 
-	 pOutputBufferSize ? *pOutputBufferSize : 0);
+	 InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize, 
+	 OutputBufferSize ? *OutputBufferSize : 0);
 
   KeInitializeEvent (&Event, NotificationEvent, FALSE);
 

reactos/lib/advapi32/sec
misc.c 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- misc.c	21 Nov 2004 20:14:36 -0000	1.27
+++ misc.c	12 Dec 2004 21:25:04 -0000	1.28
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.27 2004/11/21 20:14:36 gdalsnes Exp $
+/* $Id: misc.c,v 1.28 2004/12/12 21:25:04 weiden Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -548,9 +548,25 @@
 		   LPDWORD cchReferencedDomainName,
 		   PSID_NAME_USE peUse)
 {
+  DWORD NameLength;
+  DWORD DomainLength;
+  
   DPRINT1("LookupAccountSidA is unimplemented, but returns success\n");
-  lstrcpynA(lpName, "Administrator", *cchName);
-  lstrcpynA(lpReferencedDomainName, "ReactOS", *cchReferencedDomainName);
+  
+  /* Calculate length needed */
+  NameLength = strlen("Administrator") + 1;
+  DomainLength = strlen("BUILTIN") + 1;
+  
+  if (*cchName < NameLength || *cchReferencedDomainName < DomainLength)
+  {
+    *cchName = NameLength;
+    *cchReferencedDomainName = DomainLength;
+    SetLastError(ERROR_INSUFFICIENT_BUFFER);
+    return FALSE;
+  }
+  
+  if (lpName) lstrcpynA(lpName, "Administrator", *cchName);
+  if (lpReferencedDomainName) lstrcpynA(lpReferencedDomainName, "BUILTIN", *cchReferencedDomainName);
   return TRUE;
 }
 
@@ -569,9 +585,25 @@
 		   LPDWORD cchReferencedDomainName,
 		   PSID_NAME_USE peUse)
 {
+  DWORD NameLength;
+  DWORD DomainLength;
+  
   DPRINT1("LookupAccountSidW is unimplemented, but returns success\n");
-  lstrcpynW(lpName, L"Administrator", *cchName);
-  lstrcpynW(lpReferencedDomainName, L"ReactOS", *cchReferencedDomainName);
+  
+  /* Calculate length needed */
+  NameLength = wcslen(L"Administrator") + sizeof(WCHAR);
+  DomainLength = wcslen(L"BUILTIN") + sizeof(WCHAR);
+  
+  if (*cchName < NameLength || *cchReferencedDomainName < DomainLength)
+  {
+    *cchName = NameLength;
+    *cchReferencedDomainName = DomainLength;
+    SetLastError(ERROR_INSUFFICIENT_BUFFER);
+    return FALSE;
+  }
+  
+  if (lpName) lstrcpynW(lpName, L"Administrator", *cchName);
+  if (lpReferencedDomainName) lstrcpynW(lpReferencedDomainName, L"BUILTIN", *cchReferencedDomainName);
   return TRUE;
 }
 

reactos/lib/user32/misc
display.c 1.13 -> 1.14
diff -u -r1.13 -r1.14
--- display.c	16 Nov 2004 16:27:48 -0000	1.13
+++ display.c	12 Dec 2004 21:25:04 -0000	1.14
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: display.c,v 1.13 2004/11/16 16:27:48 blight Exp $
+/* $Id: display.c,v 1.14 2004/12/12 21:25:04 weiden Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/dde.c
@@ -46,28 +46,45 @@
   PDISPLAY_DEVICEA lpDisplayDevice,
   DWORD dwFlags)
 {
-/* FIXME: This implementation doesn't convert the lpDisplayDevice structure! */
-#if 0
   BOOL rc;
   UNICODE_STRING Device;
+  DISPLAY_DEVICEW DisplayDeviceW;
+  
   if ( !RtlCreateUnicodeStringFromAsciiz ( &Device, (PCSZ)lpDevice ) )
     {
       SetLastError ( ERROR_OUTOFMEMORY );
       return FALSE;
     }
 
+  DisplayDeviceW.cb = lpDisplayDevice->cb;
   rc = NtUserEnumDisplayDevices (
     &Device,
     iDevNum,
-    lpDisplayDevice,
+    &DisplayDeviceW,
     dwFlags );
+  
+  /* Copy result from DisplayDeviceW to lpDisplayDevice */
+  lpDisplayDevice->StateFlags = DisplayDeviceW.StateFlags;
+  WideCharToMultiByte(CP_ACP,0,
+     DisplayDeviceW.DeviceName,wcslen(DisplayDeviceW.DeviceName),
+     lpDisplayDevice->DeviceName,sizeof(lpDisplayDevice->DeviceName) / sizeof(lpDisplayDevice->DeviceName[0]),
+     NULL,NULL);
+  WideCharToMultiByte(CP_ACP,0,
+     DisplayDeviceW.DeviceString,wcslen(DisplayDeviceW.DeviceString),
+     lpDisplayDevice->DeviceString,sizeof(lpDisplayDevice->DeviceString) / sizeof(lpDisplayDevice->DeviceString[0]),
+     NULL,NULL);
+  WideCharToMultiByte(CP_ACP,0,
+     DisplayDeviceW.DeviceID,wcslen(DisplayDeviceW.DeviceID),
+     lpDisplayDevice->DeviceID,sizeof(lpDisplayDevice->DeviceID) / sizeof(lpDisplayDevice->DeviceID[0]),
+     NULL,NULL);
+  WideCharToMultiByte(CP_ACP,0,
+     DisplayDeviceW.DeviceKey,wcslen(DisplayDeviceW.DeviceKey),
+     lpDisplayDevice->DeviceKey,sizeof(lpDisplayDevice->DeviceKey) / sizeof(lpDisplayDevice->DeviceKey[0]),
+     NULL,NULL);
 
   RtlFreeUnicodeString ( &Device );
 
   return rc;
-#else
-  return 0;
-#endif
 }
 
 

reactos/ntoskrnl/io
bootlog.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- bootlog.c	28 Sep 2004 12:50:23 -0000	1.5
+++ bootlog.c	12 Dec 2004 21:25:04 -0000	1.6
@@ -1,4 +1,4 @@
-/* $Id: bootlog.c,v 1.5 2004/09/28 12:50:23 ekohl Exp $
+/* $Id: bootlog.c,v 1.6 2004/12/12 21:25:04 weiden Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -65,12 +65,12 @@
 
   ExAcquireResourceExclusiveLite(&IopBootLogResource, TRUE);
 
-  DPRINT("Boot log: %S %wZ\n",
+  DPRINT("Boot log: %wS %wZ\n",
 	 Success ? L"Loaded driver" : L"Did not load driver",
 	 DriverName);
 
   swprintf(Buffer,
-	   L"%s %wZ",
+	   L"%ws %wZ",
 	   Success ? L"Loaded driver" : L"Did not load driver",
 	   DriverName);
 

reactos/subsys/win32k/objects
dc.c 1.150 -> 1.151
diff -u -r1.150 -r1.151
--- dc.c	12 Dec 2004 17:56:52 -0000	1.150
+++ dc.c	12 Dec 2004 21:25:05 -0000	1.151
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.150 2004/12/12 17:56:52 weiden Exp $
+/* $Id: dc.c,v 1.151 2004/12/12 21:25:05 weiden Exp $
  *
  * DC.C - Device context functions
  *
@@ -2252,6 +2252,7 @@
   {
     if (iModeNum == 0 || CachedDevModes == NULL) /* query modes from drivers */
     {
+      BOOL PrimarySurfaceCreated = FALSE;
       UNICODE_STRING DriverFileNames;
       LPWSTR CurrentName;
       DRVENABLEDATA DrvEnableData;
@@ -2263,6 +2264,12 @@
         DPRINT1("FindDriverFileNames failed\n");
         return FALSE;
       }
+      
+      if (!HalQueryDisplayOwnership())
+      {
+        IntCreatePrimarySurface();
+        PrimarySurfaceCreated = TRUE;
+      }
   
       /*
        * DriverFileNames may be a list of drivers in REG_SZ_MULTI format,
@@ -2328,6 +2335,10 @@
               SizeOfCachedDevModes = 0;
               CachedDevModes = NULL;
               CachedDevModesEnd = NULL;
+              if (PrimarySurfaceCreated)
+              {
+                IntDestroyPrimarySurface();
+              }
               SetLastWin32Error(STATUS_NO_MEMORY);
               return FALSE;
             }
@@ -2355,6 +2366,11 @@
           break;
         }
       }
+      
+      if (PrimarySurfaceCreated)
+      {
+        IntDestroyPrimarySurface();
+      }
   
       RtlFreeUnicodeString(&DriverFileNames);
     }

reactos/subsys/win32k/objects
gdiobj.c 1.74 -> 1.75
diff -u -r1.74 -r1.75
--- gdiobj.c	12 Dec 2004 01:40:38 -0000	1.74
+++ gdiobj.c	12 Dec 2004 21:25:05 -0000	1.75
@@ -19,7 +19,7 @@
 /*
  * GDIOBJ.C - GDI object manipulation routines
  *
- * $Id: gdiobj.c,v 1.74 2004/12/12 01:40:38 weiden Exp $
+ * $Id: gdiobj.c,v 1.75 2004/12/12 21:25:05 weiden Exp $
  */
 #include <w32k.h>
 
@@ -712,6 +712,9 @@
       {
         DPRINT1("Attempted to lock object 0x%x, type mismatch (0x%x : 0x%x)\n", hObj, EntryType, ExpectedType);
       }
+#ifdef GDI_DEBUG
+      DPRINT1("-> called from %s:%i\n", file, line);
+#endif
     }
   }
   else if(PrevProcId == LockedProcessId)
CVSspam 0.2.8