see ChangeLog file please

svn path=/trunk/; revision=5160
This commit is contained in:
Royce Mitchell III 2003-07-19 01:35:27 +00:00
parent 24475b126e
commit 35e4ade503
11 changed files with 352 additions and 127 deletions

View file

@ -1,3 +1,19 @@
2003-07-18 Royce Mitchell III <royce3@ev1.net>
* include/defines.h: added missing DISP_CHANGE_BADPARAM
* include/ntos/gditypes.h: fixed DEVMODEA/W structures
(had to move POINTL structure from structs.h)
* include/win32k/ntuser.h: fixed some parameter lists
* subsys/win32k/ntuser/stubs.c: ditto
* lib/user32/misc/devmode.c: new function USER32_DevModeA2W
converts DEVMODEA structure to a DEVMODEW
* lib/user32/include/user32.h: declaration for USER32_DevModeA2W
* lib/user32/makefile: added misc/devmode.c
* lib/user32/misc/desktop.c: converting CreateDesktopA's
DEVMODEA to a DEVMODEW now.
* lib/user32/misc/display.c: implemented all functions except
GetMonitorInfoA/W
2003-07-17 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/fs/ntfs/notes.txt: New file.

View file

@ -244,6 +244,7 @@ extern "C" {
#define DISP_CHANGE_FAILED (-1)
#define DISP_CHANGE_BADMODE (-2)
#define DISP_CHANGE_NOTUPDATED (-3)
#define DISP_CHANGE_BADPARAM (-5)
/* ChangeServiceConfig */
#define SERVICE_NO_CHANGE (-1)

View file

@ -11,11 +11,21 @@
#ifndef __INCLUDE_NTOS_GDITYPES_H
#define __INCLUDE_NTOS_GDITYPES_H
#include <structs.h>
#ifndef __USE_W32API
#define CCHDEVICENAME (32)
#define CCHFORMNAME (32)
/* should be in structs.h, but structs.h includes this file and
* we need it here - Royce3
*/
typedef struct _POINTL {
LONG x;
LONG y;
} POINTL, *PPOINTL;
typedef struct _devicemodeA
{
BYTE dmDeviceName[CCHDEVICENAME];
@ -24,10 +34,17 @@ typedef struct _devicemodeA
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
union
{
struct
{
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
};
POINTL dmPosition;
};
short dmScale;
short dmCopies;
short dmDefaultSource;
@ -42,14 +59,28 @@ typedef struct _devicemodeA
DWORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
DWORD dmDisplayFlags;
union
{
DWORD dmDisplayFlags;
DWORD dmNup;
};
DWORD dmDisplayFrequency;
DWORD dmICMMethod;
DWORD dmICMIntent;
DWORD dmMediaType;
DWORD dmDitherType;
DWORD dmICCManufacturer;
DWORD dmICCModel;
union
{
DWORD dmICCManufacturer;
DWORD dmReserved1;
};
union
{
DWORD dmICCModel;
DWORD dmReserved2;
};
DWORD dmPanningWidth;
DWORD dmPanningHeight;
} DEVMODEA,*LPDEVMODEA,*PDEVMODEA;
typedef struct _devicemodeW
@ -60,10 +91,17 @@ typedef struct _devicemodeW
WORD dmSize;
WORD dmDriverExtra;
DWORD dmFields;
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
union
{
struct
{
short dmOrientation;
short dmPaperSize;
short dmPaperLength;
short dmPaperWidth;
};
POINTL dmPosition;
};
short dmScale;
short dmCopies;
short dmDefaultSource;
@ -78,14 +116,28 @@ typedef struct _devicemodeW
DWORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
DWORD dmDisplayFlags;
union
{
DWORD dmDisplayFlags;
DWORD dmNup;
};
DWORD dmDisplayFrequency;
DWORD dmICMMethod;
DWORD dmICMIntent;
DWORD dmMediaType;
DWORD dmDitherType;
DWORD dmICCManufacturer;
DWORD dmICCModel;
union
{
DWORD dmICCManufacturer;
DWORD dmReserved1;
};
union
{
DWORD dmICCModel;
DWORD dmReserved2;
};
DWORD dmPanningWidth;
DWORD dmPanningHeight;
} DEVMODEW,*LPDEVMODEW,*PDEVMODEW;
#endif /* !__USE_W32API */

View file

@ -340,10 +340,12 @@ typedef struct tagPOINTFX {
FIXED y;
} POINTFX;
/* moved to gditypes.h since I needed it there - Royce3
typedef struct _POINTL {
LONG x;
LONG y;
} POINTL, *PPOINTL;
*/
typedef struct tagPOINTS {
SHORT x;

View file

@ -167,14 +167,14 @@ NtUserChangeClipboardChain(
DWORD Unknown0,
DWORD Unknown1);
DWORD
LONG
STDCALL
NtUserChangeDisplaySettings(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4);
PUNICODE_STRING lpszDeviceName,
LPDEVMODEW lpDevMode,
HWND hwnd,
DWORD dwflags,
LPVOID lParam);
DWORD
STDCALL
@ -449,29 +449,29 @@ NtUserEndMenu(VOID);
BOOL STDCALL
NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs);
DWORD
WINBOOL
STDCALL
NtUserEnumDisplayDevices(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3);
NtUserEnumDisplayDevices (
PUNICODE_STRING lpDevice, /* device name */
DWORD iDevNum, /* display device */
PDISPLAY_DEVICE lpDisplayDevice, /* device information */
DWORD dwFlags ); /* reserved */
DWORD
WINBOOL
STDCALL
NtUserEnumDisplayMonitors(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3);
NtUserEnumDisplayMonitors (
HDC hdc,
LPCRECT lprcClip,
MONITORENUMPROC lpfnEnum,
LPARAM dwData );
DWORD
WINBOOL
STDCALL
NtUserEnumDisplaySettings(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3);
PUNICODE_STRING lpszDeviceName,
DWORD iModeNum,
LPDEVMODEW lpDevMode, /* FIXME is this correct? */
DWORD dwFlags );
DWORD
STDCALL

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.18 2003/07/11 17:58:51 sedwards Exp $
# $Id: Makefile,v 1.19 2003/07/19 01:35:27 royce Exp $
PATH_TO_TOP = ../..
@ -32,6 +32,7 @@ CONTROLS_OBJECTS = \
MISC_OBJECTS = \
misc/dde.o \
misc/desktop.o \
misc/devmode.o \
misc/display.o \
misc/dllmain.o \
misc/exit.o \

View file

@ -7,5 +7,6 @@
#include <windows.h>
#include <win32k/win32k.h>
/* see lib/user32/misc/devmode.c */
void
USER32_DevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA );

View file

@ -1,4 +1,4 @@
/* $Id: desktop.c,v 1.13 2003/07/10 21:04:31 chorns Exp $
/* $Id: desktop.c,v 1.14 2003/07/19 01:35:27 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -100,6 +100,7 @@ CreateDesktopA(LPCSTR lpszDesktop,
ANSI_STRING DesktopNameA;
UNICODE_STRING DesktopNameU;
HDESK hDesktop;
DEVMODEW DevmodeW;
if (lpszDesktop != NULL)
{
@ -110,11 +111,12 @@ CreateDesktopA(LPCSTR lpszDesktop,
{
RtlInitUnicodeString(&DesktopNameU, NULL);
}
/* FIXME: Need to convert the DEVMODE parameter. */
USER32_DevModeA2W ( &DevmodeW, pDevmode );
hDesktop = CreateDesktopW(DesktopNameU.Buffer,
NULL,
(LPDEVMODEW)pDevmode,
&DevmodeW,
dwFlags,
dwDesiredAccess,
lpsa);

View file

@ -0,0 +1,82 @@
#include <string.h>
#include <windows.h>
#include <user32.h>
void
USER32_DevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA )
{
#define SIZEOF_DEVMODEA_300 124
#define SIZEOF_DEVMODEA_400 148
#define SIZEOF_DEVMODEA_500 156
#define SIZEOF_DEVMODEW_300 188
#define SIZEOF_DEVMODEW_400 212
#define SIZEOF_DEVMODEW_500 220
#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len )
#define COPYN(f) pW->f = pA->f
memset ( pW, 0, sizeof(DEVMODEW) );
COPYS(dmDeviceName, CCHDEVICENAME );
COPYN(dmSpecVersion);
COPYN(dmDriverVersion);
switch ( pA->dmSize )
{
case SIZEOF_DEVMODEA_300:
pW->dmSize = SIZEOF_DEVMODEW_300;
break;
case SIZEOF_DEVMODEA_400:
pW->dmSize = SIZEOF_DEVMODEW_400;
break;
case SIZEOF_DEVMODEA_500:
default: /* FIXME what to do??? */
pW->dmSize = SIZEOF_DEVMODEW_500;
break;
}
COPYN(dmDriverExtra);
COPYN(dmFields);
COPYN(dmPosition.x);
COPYN(dmPosition.y);
COPYN(dmScale);
COPYN(dmCopies);
COPYN(dmDefaultSource);
COPYN(dmPrintQuality);
COPYN(dmColor);
COPYN(dmDuplex);
COPYN(dmYResolution);
COPYN(dmTTOption);
COPYN(dmCollate);
COPYS(dmFormName,CCHFORMNAME);
COPYN(dmLogPixels);
COPYN(dmBitsPerPel);
COPYN(dmPelsWidth);
COPYN(dmPelsHeight);
COPYN(dmDisplayFlags); // aka dmNup
COPYN(dmDisplayFrequency);
if ( pA->dmSize <= SIZEOF_DEVMODEA_300 )
return; // we're done with 0x300 fields
COPYN(dmICMMethod);
COPYN(dmICMIntent);
COPYN(dmMediaType);
COPYN(dmDitherType);
COPYN(dmReserved1);
COPYN(dmReserved2);
if ( pA->dmSize <= SIZEOF_DEVMODEA_400 )
return; // we're done with 0x400 fields
COPYN(dmPanningWidth);
COPYN(dmPanningHeight);
return;
#undef COPYN
#undef COPYS
#undef SIZEOF_DEVMODEA_300
#undef SIZEOF_DEVMODEA_400
#undef SIZEOF_DEVMODEA_500
#undef SIZEOF_DEVMODEW_300
#undef SIZEOF_DEVMODEW_400
#undef SIZEOF_DEVMODEW_500
}

View file

@ -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.5 2003/07/10 21:04:31 chorns Exp $
/* $Id: display.c,v 1.6 2003/07/19 01:35:27 royce Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/dde.c
@ -35,7 +35,7 @@
/* FUNCTIONS *****************************************************************/
/*
* @unimplemented
* @implemented
*/
WINBOOL STDCALL
EnumDisplayDevicesA(
@ -44,13 +44,28 @@ EnumDisplayDevicesA(
PDISPLAY_DEVICE lpDisplayDevice,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
WINBOOL rc;
UNICODE_STRING Device;
if ( !RtlCreateUnicodeStringFromAsciiz ( &Device, (PCSZ)lpDevice ) )
{
SetLastError ( ERROR_OUTOFMEMORY );
return FALSE;
}
rc = NtUserEnumDisplayDevices (
&Device,
iDevNum,
lpDisplayDevice,
dwFlags );
RtlFreeUnicodeString ( &Device );
return rc;
}
/*
* @unimplemented
* @implemented
*/
WINBOOL
STDCALL
@ -60,29 +75,71 @@ EnumDisplayDevicesW(
PDISPLAY_DEVICE lpDisplayDevice,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
UNICODE_STRING Device;
WINBOOL rc;
RtlInitUnicodeString ( &Device, lpDevice );
rc = NtUserEnumDisplayDevices (
&Device,
iDevNum,
lpDisplayDevice,
dwFlags );
RtlFreeUnicodeString ( &Device );
return rc;
}
/*
* @unimplemented
* @implemented
*/
WINBOOL
STDCALL
EnumDisplayMonitors(
HDC hdc,
LPRECT lprcClip,
LPCRECT lprcClip,
MONITORENUMPROC lpfnEnum,
LPARAM dwData)
{
UNIMPLEMENTED;
return FALSE;
return NtUserEnumDisplayMonitors ( hdc, lprcClip, lpfnEnum, dwData );
}
/*
* @unimplemented
* @implemented
*/
WINBOOL
STDCALL
EnumDisplaySettingsExA(
LPCSTR lpszDeviceName,
DWORD iModeNum,
LPDEVMODEA lpDevMode,
DWORD dwFlags)
{
WINBOOL rc;
UNICODE_STRING DeviceName;
DEVMODEW DevModeW;
if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
{
SetLastError ( ERROR_OUTOFMEMORY );
return FALSE;
}
USER32_DevModeA2W ( &DevModeW, lpDevMode );
rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &DevModeW, dwFlags );
RtlFreeUnicodeString ( &DeviceName );
return rc;
}
/*
* @implemented
*/
WINBOOL
STDCALL
@ -91,45 +148,36 @@ EnumDisplaySettingsA(
DWORD iModeNum,
LPDEVMODEA lpDevMode)
{
UNIMPLEMENTED;
return FALSE;
return EnumDisplaySettingsExA ( lpszDeviceName, iModeNum, lpDevMode, 0 );
}
/*
* @unimplemented
*/
WINBOOL
STDCALL
EnumDisplaySettingsExA(
LPCSTR lpszDeviceName,
DWORD iModeNum,
LPDEVMODEW lpDevMode,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
/*
* @unimplemented
* @implemented
*/
WINBOOL
STDCALL
EnumDisplaySettingsExW(
LPCWSTR lpszDeviceName,
DWORD iModeNum,
LPDEVMODEA lpDevMode,
LPDEVMODEW lpDevMode,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
WINBOOL rc;
UNICODE_STRING DeviceName;
RtlInitUnicodeString ( &DeviceName, lpszDeviceName );
rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, lpDevMode, dwFlags );
RtlFreeUnicodeString ( &DeviceName );
return rc;
}
/*
* @unimplemented
* @implemented
*/
WINBOOL
STDCALL
@ -138,8 +186,7 @@ EnumDisplaySettingsW(
DWORD iModeNum,
LPDEVMODEW lpDevMode)
{
UNIMPLEMENTED;
return FALSE;
return EnumDisplaySettingsExW ( lpszDeviceName, iModeNum, lpDevMode, 0 );
}
@ -172,21 +219,7 @@ GetMonitorInfoW(
/*
* @unimplemented
*/
LONG
STDCALL
ChangeDisplaySettingsA(
LPDEVMODEA lpDevMode,
DWORD dwflags)
{
UNIMPLEMENTED;
return 0;
}
/*
* @unimplemented
* @implemented
*/
LONG
STDCALL
@ -197,13 +230,41 @@ ChangeDisplaySettingsExA(
DWORD dwflags,
LPVOID lParam)
{
UNIMPLEMENTED;
return 0;
LONG rc;
UNICODE_STRING DeviceName;
DEVMODEW DevModeW;
if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
{
SetLastError ( ERROR_OUTOFMEMORY );
return DISP_CHANGE_BADPARAM; /* FIXME what to return? */
}
USER32_DevModeA2W ( &DevModeW, lpDevMode );
rc = NtUserChangeDisplaySettings ( &DeviceName, &DevModeW, hwnd, dwflags, lParam );
RtlFreeUnicodeString ( &DeviceName );
return rc;
}
/*
* @unimplemented
* @implemented
*/
LONG
STDCALL
ChangeDisplaySettingsA(
LPDEVMODEA lpDevMode,
DWORD dwflags)
{
return ChangeDisplaySettingsExA ( NULL, lpDevMode, NULL, dwflags, 0 );
}
/*
* @implemented
*/
LONG
STDCALL
@ -214,13 +275,21 @@ ChangeDisplaySettingsExW(
DWORD dwflags,
LPVOID lParam)
{
UNIMPLEMENTED;
return 0;
LONG rc;
UNICODE_STRING DeviceName;
RtlInitUnicodeString ( &DeviceName, lpszDeviceName );
rc = NtUserChangeDisplaySettings ( &DeviceName, lpDevMode, hwnd, dwflags, lParam );
RtlFreeUnicodeString ( &DeviceName );
return rc;
}
/*
* @unimplemented
* @implemented
*/
LONG
STDCALL
@ -228,6 +297,5 @@ ChangeDisplaySettingsW(
LPDEVMODEW lpDevMode,
DWORD dwflags)
{
UNIMPLEMENTED;
return 0;
return ChangeDisplaySettingsExW ( NULL, lpDevMode, NULL, dwflags, 0 );
}

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.13 2003/07/05 16:04:01 chorns Exp $
/* $Id: stubs.c,v 1.14 2003/07/19 01:35:27 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -194,14 +194,14 @@ NtUserChangeClipboardChain(
return 0;
}
DWORD
LONG
STDCALL
NtUserChangeDisplaySettings(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4)
PUNICODE_STRING lpszDeviceName,
LPDEVMODEW lpDevMode,
HWND hwnd,
DWORD dwflags,
LPVOID lParam)
{
UNIMPLEMENTED
@ -511,39 +511,39 @@ NtUserEndMenu(VOID)
return 0;
}
DWORD
WINBOOL
STDCALL
NtUserEnumDisplayDevices(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
NtUserEnumDisplayDevices (
PUNICODE_STRING lpDevice, /* device name */
DWORD iDevNum, /* display device */
PDISPLAY_DEVICE lpDisplayDevice, /* device information */
DWORD dwFlags ) /* reserved */
{
UNIMPLEMENTED
return 0;
}
DWORD
WINBOOL
STDCALL
NtUserEnumDisplayMonitors(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
HDC hdc,
LPCRECT lprcClip,
MONITORENUMPROC lpfnEnum,
LPARAM dwData)
{
UNIMPLEMENTED
return 0;
}
DWORD
WINBOOL
STDCALL
NtUserEnumDisplaySettings(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
PUNICODE_STRING lpszDeviceName,
DWORD iModeNum,
LPDEVMODEW lpDevMode, /* FIXME is this correct? */
DWORD dwFlags )
{
UNIMPLEMENTED