mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
* 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. svn path=/trunk/; revision=12058
This commit is contained in:
parent
9530713f4b
commit
4e843a2af2
7 changed files with 89 additions and 21 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 @@ 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)
|
||||
|
|
Loading…
Reference in a new issue