00028 {
00029
PCONSOLE_VDM_MSG a = (
PCONSOLE_VDM_MSG)&m->u.ApiMessageData;
00030
NTSTATUS Status;
00031
PCONSOLE_INFORMATION Console;
00032
00033
Status =
ApiPreamble(a->
ConsoleHandle,
00034 &Console
00035 );
00036
if (!
NT_SUCCESS(Status)) {
00037
return Status;
00038 }
00039
if (!(Console->
Flags &
CONSOLE_VDM_REGISTERED) ||
00040 (Console->
VDMProcessId !=
CONSOLE_CLIENTPROCESSID())) {
00041
Status = STATUS_INVALID_PARAMETER;
00042 }
else {
00043
switch (a->
iFunction) {
00044
case VDM_HIDE_WINDOW:
00045
PostMessage(Console->
hWnd,
00046 CM_HIDE_WINDOW,
00047 0,
00048 0
00049 );
00050
break;
00051
case VDM_IS_ICONIC:
00052 a->
Bool =
IsIconic(Console->
hWnd);
00053
break;
00054
case VDM_CLIENT_RECT:
00055
GetClientRect(Console->
hWnd,&a->
Rect);
00056
break;
00057
case VDM_CLIENT_TO_SCREEN:
00058
ClientToScreen(Console->
hWnd,&a->
Point);
00059
break;
00060
case VDM_SCREEN_TO_CLIENT:
00061
ScreenToClient(Console->
hWnd,&a->
Point);
00062
break;
00063
case VDM_IS_HIDDEN:
00064 a->
Bool = ((Console->
Flags &
CONSOLE_NO_WINDOW) != 0);
00065
break;
00066
case VDM_FULLSCREEN_NOPAINT:
00067
if (a->
Bool) {
00068 Console->
Flags |=
CONSOLE_FULLSCREEN_NOPAINT;
00069 }
else {
00070 Console->
Flags &= ~
CONSOLE_FULLSCREEN_NOPAINT;
00071 }
00072
break;
00073
#if defined(FE_SB)
00074
case VDM_SET_VIDEO_MODE:
00075 Console->fVDMVideoMode = (a->
Bool != 0);
00076
break;
00077
#if defined(i386)
00078
case VDM_SAVE_RESTORE_HW_STATE:
00079
if (ISNECPC98(gdwMachineId)) {
00080
00081
00082
00083 VIDEO_HARDWARE_STATE State;
00084 ULONG StateSize =
sizeof(State);
00085
00086 State.StateHeader = Console->
StateBuffer;
00087 State.StateLength = Console->
StateLength;
00088
00089
00090
Status = GdiFullscreenControl(a->
Bool ? FullscreenControlRestoreHardwareState
00091 : FullscreenControlSaveHardwareState,
00092 &State,
00093 StateSize,
00094 &State,
00095 &StateSize);
00096 }
00097
break;
00098
case VDM_VIDEO_IOCTL:
00099
if (ISNECPC98(gdwMachineId)) {
00100
00101
00102 PVOID InBuffer;
00103
00104
if (!CsrValidateMessageBuffer(m, &a->VDMIoctlParam.lpvInBuffer, a->VDMIoctlParam.cbInBuffer,
sizeof(BYTE)) ||
00105 !CsrValidateMessageBuffer(m, &a->VDMIoctlParam.lpvOutBuffer, a->VDMIoctlParam.cbOutBuffer,
sizeof(BYTE))) {
00106
UnlockConsole(Console);
00107
return STATUS_INVALID_PARAMETER;
00108 }
00109
00110 InBuffer =
ConsoleHeapAlloc(
00111
MAKE_TAG( TMP_DBCS_TAG ),
00112 a->VDMIoctlParam.cbInBuffer +
sizeof(DWORD)
00113 );
00114
if (InBuffer ==
NULL)
00115 {
00116
Status = STATUS_NO_MEMORY;
00117
break;
00118 }
00119
00120 *((PDWORD)InBuffer) = a->VDMIoctlParam.dwIoControlCode;
00121 RtlCopyMemory((PBYTE)InBuffer +
sizeof(DWORD),
00122 a->VDMIoctlParam.lpvInBuffer,
00123 a->VDMIoctlParam.cbInBuffer
00124 );
00125
00126
Status = GdiFullscreenControl(
00127 FullscreenControlSpecificVideoControl,
00128 InBuffer,
00129
ConsoleHeapSize(InBuffer),
00130 a->VDMIoctlParam.lpvOutBuffer,
00131 a->VDMIoctlParam.lpvOutBuffer ?
00132 &a->VDMIoctlParam.cbOutBuffer : 0
00133 );
00134
00135
ConsoleHeapFree(InBuffer);
00136 }
00137
break;
00138
#endif
00139
#endif
00140
default:
00141
ASSERT(FALSE);
00142 }
00143 }
00144
00145
UnlockConsole(Console);
00146
return Status;
00147 UNREFERENCED_PARAMETER(ReplyStatus);
00148 }