diff --git a/reactos/apps/utils/Makefile b/reactos/apps/utils/Makefile index 75d811c8d21..43d5be5c94b 100644 --- a/reactos/apps/utils/Makefile +++ b/reactos/apps/utils/Makefile @@ -11,7 +11,7 @@ include $(PATH_TO_TOP)/rules.mak # 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) diff --git a/reactos/drivers/fs/cdfs/common.c b/reactos/drivers/fs/cdfs/common.c index 865ea888401..ffa8a3f9598 100644 --- a/reactos/drivers/fs/cdfs/common.c +++ b/reactos/drivers/fs/cdfs/common.c @@ -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 @@ CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject, 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); diff --git a/reactos/lib/advapi32/sec/misc.c b/reactos/lib/advapi32/sec/misc.c index 5dfbc3e569a..d8ca4bc2ce7 100644 --- a/reactos/lib/advapi32/sec/misc.c +++ b/reactos/lib/advapi32/sec/misc.c @@ -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 @@ LookupAccountSidA (LPCSTR lpSystemName, 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 @@ LookupAccountSidW (LPCWSTR lpSystemName, 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; } diff --git a/reactos/lib/user32/misc/display.c b/reactos/lib/user32/misc/display.c index 5f58a480e18..2e0b903b901 100644 --- a/reactos/lib/user32/misc/display.c +++ b/reactos/lib/user32/misc/display.c @@ -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 @@ EnumDisplayDevicesA( 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 } diff --git a/reactos/ntoskrnl/io/bootlog.c b/reactos/ntoskrnl/io/bootlog.c index c063fb9966b..948eca5a811 100644 --- a/reactos/ntoskrnl/io/bootlog.c +++ b/reactos/ntoskrnl/io/bootlog.c @@ -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 @@ IopBootLog(PUNICODE_STRING DriverName, 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); diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index af760657bdb..462b759d893 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.c @@ -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 @@ IntEnumDisplaySettings( { if (iModeNum == 0 || CachedDevModes == NULL) /* query modes from drivers */ { + BOOL PrimarySurfaceCreated = FALSE; UNICODE_STRING DriverFileNames; LPWSTR CurrentName; DRVENABLEDATA DrvEnableData; @@ -2263,6 +2264,12 @@ IntEnumDisplaySettings( 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 @@ IntEnumDisplaySettings( SizeOfCachedDevModes = 0; CachedDevModes = NULL; CachedDevModesEnd = NULL; + if (PrimarySurfaceCreated) + { + IntDestroyPrimarySurface(); + } SetLastWin32Error(STATUS_NO_MEMORY); return FALSE; } @@ -2355,6 +2366,11 @@ IntEnumDisplaySettings( break; } } + + if (PrimarySurfaceCreated) + { + IntDestroyPrimarySurface(); + } RtlFreeUnicodeString(&DriverFileNames); } diff --git a/reactos/subsys/win32k/objects/gdiobj.c b/reactos/subsys/win32k/objects/gdiobj.c index 0cb071feb8f..91ae10200bc 100644 --- a/reactos/subsys/win32k/objects/gdiobj.c +++ b/reactos/subsys/win32k/objects/gdiobj.c @@ -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 @@ -712,6 +712,9 @@ LockHandle: { 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)