mirror of
https://github.com/reactos/reactos
synced 2025-10-06 08:22:58 +02:00
Compare commits
25 Commits
backups/c+
...
ReactOS-0.
Author | SHA1 | Date | |
---|---|---|---|
|
9173e96e7d | ||
|
fb29985637 | ||
|
c41f403a21 | ||
|
c22faedfdb | ||
|
940e95f578 | ||
|
2816fa8ad0 | ||
|
3b88890780 | ||
|
4e8b37f268 | ||
|
38e712904d | ||
|
cbbc54397d | ||
|
3c5b8f62ce | ||
|
076872ae0a | ||
|
1d110cfd34 | ||
|
b49ba945d0 | ||
|
5f8cac6653 | ||
|
7ed77ada75 | ||
|
fd1eddbc07 | ||
|
0cefb2734c | ||
|
e0c4931114 | ||
|
667d6e07eb | ||
|
7614c174b6 | ||
|
1ed2391c2f | ||
|
92697d6768 | ||
|
1bc7e5d407 | ||
|
5ddd8d5749 |
@@ -42,4 +42,4 @@
|
||||
Whether to compile for debugging. No compiler optimizations will be
|
||||
performed.
|
||||
-->
|
||||
<property name="DBG" value="1" />
|
||||
<property name="DBG" value="0" />
|
||||
|
@@ -10,9 +10,7 @@
|
||||
|
||||
/* INCLUDES ****************************************************************/
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
#include "i8042prt.h"
|
||||
@@ -78,7 +76,7 @@ NTSTATUS I8042ReadData(UCHAR *Data)
|
||||
DPRINT("Read: %x (status: %x)\n", Data[0], Status);
|
||||
|
||||
// If the data is valid (not timeout, not parity error)
|
||||
if (0 == (Status & (KBD_GTO | KBD_PERR)))
|
||||
if (0 == (Status & KBD_PERR))
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
@@ -115,7 +113,7 @@ VOID I8042Flush()
|
||||
UCHAR Ignore;
|
||||
|
||||
while (STATUS_SUCCESS == I8042ReadData(&Ignore)) {
|
||||
; /* drop */
|
||||
DPRINT("Data flushed\n"); /* drop */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,25 +144,38 @@ NTSTATUS STDCALL I8042SynchWritePort(PDEVICE_EXTENSION DevExt,
|
||||
do {
|
||||
if (Port)
|
||||
if (!I8042Write(DevExt, I8042_DATA_PORT, Port))
|
||||
return STATUS_TIMEOUT;
|
||||
{
|
||||
DPRINT1("Failed to write Port\n");
|
||||
return STATUS_IO_TIMEOUT;
|
||||
}
|
||||
|
||||
if (!I8042Write(DevExt, I8042_DATA_PORT, Value))
|
||||
return STATUS_TIMEOUT;
|
||||
{
|
||||
DPRINT1("Failed to write Value\n");
|
||||
return STATUS_IO_TIMEOUT;
|
||||
}
|
||||
|
||||
if (WaitForAck) {
|
||||
Status = I8042ReadDataWait(DevExt, &Ack);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to read Ack\n");
|
||||
return Status;
|
||||
}
|
||||
if (Ack == KBD_ACK)
|
||||
return STATUS_SUCCESS;
|
||||
if (Ack != KBD_RESEND)
|
||||
{
|
||||
DPRINT1("Unexpected Ack 0x%x\n", Ack);
|
||||
return STATUS_UNEXPECTED_IO_ERROR;
|
||||
}
|
||||
} else {
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
DPRINT("Reiterating\n");
|
||||
ResendIterations--;
|
||||
} while (ResendIterations);
|
||||
return STATUS_TIMEOUT;
|
||||
return STATUS_IO_TIMEOUT;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -241,7 +252,7 @@ NTSTATUS STDCALL I8042StartPacket(PDEVICE_EXTENSION DevExt,
|
||||
DevExt->PacketPort = 0;
|
||||
|
||||
if (!I8042PacketWrite(DevExt)) {
|
||||
Status = STATUS_TIMEOUT;
|
||||
Status = STATUS_IO_TIMEOUT;
|
||||
DevExt->Packet.State = Idle;
|
||||
DevExt->PacketResult = STATUS_ABANDONED;
|
||||
goto startpacketdone;
|
||||
@@ -273,7 +284,7 @@ BOOLEAN STDCALL I8042PacketIsr(PDEVICE_EXTENSION DevExt,
|
||||
if (DevExt->PacketResends > DevExt->Settings.ResendIterations) {
|
||||
DevExt->Packet.State = Idle;
|
||||
DevExt->PacketComplete = TRUE;
|
||||
DevExt->PacketResult = STATUS_TIMEOUT;
|
||||
DevExt->PacketResult = STATUS_IO_TIMEOUT;
|
||||
DevExt->PacketResends = 0;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -301,7 +312,7 @@ BOOLEAN STDCALL I8042PacketIsr(PDEVICE_EXTENSION DevExt,
|
||||
if (!I8042PacketWrite(DevExt)) {
|
||||
DevExt->Packet.State = Idle;
|
||||
DevExt->PacketComplete = TRUE;
|
||||
DevExt->PacketResult = STATUS_TIMEOUT;
|
||||
DevExt->PacketResult = STATUS_IO_TIMEOUT;
|
||||
return TRUE;
|
||||
}
|
||||
DevExt->Packet.CurrentByte++;
|
||||
@@ -519,30 +530,60 @@ static NTSTATUS STDCALL I8042BasicDetect(PDEVICE_EXTENSION DevExt)
|
||||
|
||||
I8042Flush();
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_SELF_TEST))
|
||||
return STATUS_TIMEOUT;
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_SELF_TEST)) {
|
||||
DPRINT1("Writing KBD_SELF_TEST command failed\n");
|
||||
return STATUS_IO_TIMEOUT;
|
||||
}
|
||||
|
||||
// Wait longer?
|
||||
Counter = 3;
|
||||
do {
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
} while ((Counter--) && (STATUS_TIMEOUT == Status));
|
||||
} while ((Counter--) && (STATUS_IO_TIMEOUT == Status));
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT1("Failed to read KBD_SELF_TEST response, status 0x%x\n",
|
||||
Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (Value != 0x55) {
|
||||
DPRINT1("Got %x instead of 55\n", Value);
|
||||
return STATUS_IO_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
if (I8042Write(DevExt, I8042_CTRL_PORT, KBD_LINE_TEST))
|
||||
{
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
if (NT_SUCCESS(Status) && Value == 0)
|
||||
DevExt->KeyboardExists = TRUE;
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_READ_MODE)) {
|
||||
DPRINT1("Can't read i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT1("No response after read i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Value |= CCB_KBD_DISAB | CCB_MOUSE_DISAB; /* disable keyboard/mouse */
|
||||
Value &= ~(CCB_KBD_INT_ENAB | CCB_MOUSE_INT_ENAB);
|
||||
/* don't enable keyboard and mouse interrupts */
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_WRITE_MODE)) {
|
||||
DPRINT1("Can't set i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!I8042Write(DevExt, I8042_DATA_PORT, Value)) {
|
||||
DPRINT1("Can't send i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* We used to send a KBD_LINE_TEST command here, but on at least HP
|
||||
* Pavilion notebooks the response to that command was incorrect.
|
||||
* So now we just assume that a keyboard is attached.
|
||||
*/
|
||||
DevExt->KeyboardExists = TRUE;
|
||||
|
||||
if (I8042Write(DevExt, I8042_CTRL_PORT, MOUSE_LINE_TEST))
|
||||
{
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
@@ -563,6 +604,11 @@ static NTSTATUS STDCALL I8042Initialize(PDEVICE_EXTENSION DevExt)
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (DevExt->MouseExists) {
|
||||
DPRINT("Aux port detected\n");
|
||||
DevExt->MouseExists = I8042DetectMouse(DevExt);
|
||||
}
|
||||
|
||||
if (!DevExt->KeyboardExists) {
|
||||
DPRINT("Keyboard port not detected\n");
|
||||
if (DevExt->Settings.Headless)
|
||||
@@ -820,4 +866,3 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
@@ -246,6 +246,17 @@ typedef struct _I8042_HOOK_WORKITEM
|
||||
#define KBD_GTO 0x40
|
||||
#define KBD_PERR 0x80
|
||||
|
||||
/*
|
||||
* Controller command byte bits
|
||||
*/
|
||||
#define CCB_KBD_INT_ENAB 0x01
|
||||
#define CCB_MOUSE_INT_ENAB 0x02
|
||||
#define CCB_SYSTEM_FLAG 0x04
|
||||
#define CCB_IGN_KEY_LOCK 0x08
|
||||
#define CCB_KBD_DISAB 0x10
|
||||
#define CCB_MOUSE_DISAB 0x20
|
||||
#define CCB_TRANSLATE 0x40
|
||||
|
||||
|
||||
/*
|
||||
* LED bits
|
||||
@@ -359,6 +370,7 @@ VOID STDCALL I8042MouseHandle(PDEVICE_EXTENSION DevExt,
|
||||
|
||||
BOOLEAN STDCALL I8042MouseEnable(PDEVICE_EXTENSION DevExt);
|
||||
BOOLEAN STDCALL I8042MouseDisable(PDEVICE_EXTENSION DevExt);
|
||||
BOOLEAN STDCALL I8042DetectMouse(PDEVICE_EXTENSION DevExt);
|
||||
|
||||
/* ps2pp.c */
|
||||
VOID I8042MouseHandlePs2pp(PDEVICE_EXTENSION DevExt, UCHAR Input);
|
||||
|
@@ -11,13 +11,11 @@
|
||||
|
||||
/* INCLUDES ****************************************************************/
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
#include "i8042prt.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
static UCHAR TypematicTable[] = {
|
||||
@@ -559,34 +557,73 @@ intcontfailure:
|
||||
* some really old broken keyboard controllers which I hope won't be
|
||||
* necessary.
|
||||
*
|
||||
* Anyway, disabling the keyboard helps the detection and it also
|
||||
* clears the keyboard buffer and sets defaults which is what we
|
||||
* want.
|
||||
* We change the command byte, sending KBD_ENABLE/DISABLE seems to confuse
|
||||
* some kvm switches.
|
||||
*/
|
||||
|
||||
BOOLEAN STDCALL I8042KeyboardEnable(PDEVICE_EXTENSION DevExt)
|
||||
{
|
||||
DPRINT("Enabling keyboard\n");
|
||||
if (STATUS_SUCCESS != I8042SynchWritePort(DevExt,
|
||||
0,
|
||||
KBD_ENABLE,
|
||||
TRUE)) {
|
||||
DPRINT("Can't enable keyboard\n");
|
||||
UCHAR Value;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("Enable keyboard\n");
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_READ_MODE)) {
|
||||
DPRINT1("Can't read i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT1("No response after read i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Value &= ~CCB_KBD_DISAB; // don't disable keyboard
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_WRITE_MODE)) {
|
||||
DPRINT1("Can't set i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!I8042Write(DevExt, I8042_DATA_PORT, Value)) {
|
||||
DPRINT1("Can't send i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOLEAN STDCALL I8042KeyboardDefaultsAndDisable(PDEVICE_EXTENSION DevExt)
|
||||
{
|
||||
UCHAR Value;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("Disabling keyboard\n");
|
||||
if (STATUS_SUCCESS != I8042SynchWritePort(DevExt,
|
||||
0,
|
||||
KBD_DISABLE,
|
||||
TRUE)) {
|
||||
DPRINT("Can't disable keyboard\n");
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_READ_MODE)) {
|
||||
DPRINT1("Can't read i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT1("No response after read i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Value |= CCB_KBD_DISAB; // disable keyboard
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_WRITE_MODE)) {
|
||||
DPRINT1("Can't set i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!I8042Write(DevExt, I8042_DATA_PORT, Value)) {
|
||||
DPRINT1("Can't send i8042 mode\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -608,8 +645,8 @@ BOOLEAN STDCALL I8042KeyboardEnableInterrupt(PDEVICE_EXTENSION DevExt)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Value &= ~(0x10); // don't disable keyboard
|
||||
Value |= 0x01; // enable keyboard interrupts
|
||||
Value &= ~CCB_KBD_DISAB; // don't disable keyboard
|
||||
Value |= CCB_KBD_INT_ENAB; // enable keyboard interrupts
|
||||
|
||||
if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_WRITE_MODE)) {
|
||||
DPRINT1("Can't set i8042 mode\n");
|
||||
@@ -628,6 +665,7 @@ BOOLEAN STDCALL I8042DetectKeyboard(PDEVICE_EXTENSION DevExt)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
UCHAR Value;
|
||||
UCHAR Value2;
|
||||
ULONG RetryCount = 10;
|
||||
|
||||
DPRINT("Detecting keyboard\n");
|
||||
@@ -635,12 +673,15 @@ BOOLEAN STDCALL I8042DetectKeyboard(PDEVICE_EXTENSION DevExt)
|
||||
I8042KeyboardDefaultsAndDisable(DevExt);
|
||||
|
||||
do {
|
||||
I8042Flush();
|
||||
Status = I8042SynchWritePort(DevExt, 0, KBD_GET_ID, TRUE);
|
||||
} while (STATUS_TIMEOUT == Status && RetryCount--);
|
||||
} while (STATUS_IO_TIMEOUT == Status && RetryCount--);
|
||||
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT1("Can't write GET_ID (%x)\n", Status);
|
||||
return FALSE;
|
||||
/* Could be an AT keyboard */
|
||||
DevExt->KeyboardIsAT = TRUE;
|
||||
goto detectsetleds;
|
||||
}
|
||||
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
@@ -658,17 +699,17 @@ BOOLEAN STDCALL I8042DetectKeyboard(PDEVICE_EXTENSION DevExt)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DPRINT("Keyboard ID: %x", Value);
|
||||
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
Status = I8042ReadDataWait(DevExt, &Value2);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT("Partial ID\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DPRINT ("%x\n", Value);
|
||||
DPRINT("Keyboard ID: 0x%x 0x%x\n", Value, Value2);
|
||||
|
||||
detectsetleds:
|
||||
I8042Flush(); /* Flush any bytes left over from GET_ID */
|
||||
|
||||
Status = I8042SynchWritePort(DevExt, 0, KBD_SET_LEDS, TRUE);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
DPRINT("Can't write SET_LEDS (%x)\n", Status);
|
||||
|
@@ -11,13 +11,11 @@
|
||||
|
||||
/* INCLUDES ****************************************************************/
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
#endif
|
||||
#include <debug.h>
|
||||
|
||||
#include "i8042prt.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/*
|
||||
* These functions are callbacks for filter driver custom interrupt
|
||||
* service routines.
|
||||
@@ -897,3 +895,54 @@ BOOLEAN STDCALL I8042MouseDisable(PDEVICE_EXTENSION DevExt)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN STDCALL I8042DetectMouse(PDEVICE_EXTENSION DevExt)
|
||||
{
|
||||
BOOLEAN Ok = TRUE;
|
||||
NTSTATUS Status;
|
||||
UCHAR Value;
|
||||
UCHAR ExpectedReply[] = { 0xFA, 0xAA, 0x00 };
|
||||
unsigned ReplyByte;
|
||||
|
||||
if (! I8042Write(DevExt, I8042_CTRL_PORT, 0xD4) ||
|
||||
! I8042Write(DevExt, I8042_DATA_PORT, 0xFF))
|
||||
{
|
||||
DPRINT1("Failed to write reset command to mouse\n");
|
||||
Ok = FALSE;
|
||||
}
|
||||
|
||||
for (ReplyByte = 0;
|
||||
ReplyByte < sizeof(ExpectedReply) / sizeof(ExpectedReply[0]) && Ok;
|
||||
ReplyByte++)
|
||||
{
|
||||
Status = I8042ReadDataWait(DevExt, &Value);
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("No ACK after mouse reset, status 0x%08x\n",
|
||||
Status);
|
||||
Ok = FALSE;
|
||||
}
|
||||
else if (Value != ExpectedReply[ReplyByte])
|
||||
{
|
||||
DPRINT1("Unexpected reply: 0x%02x (expected 0x%02x)\n",
|
||||
Value, ExpectedReply[ReplyByte]);
|
||||
Ok = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (! Ok)
|
||||
{
|
||||
/* There is probably no mouse present. On some systems,
|
||||
the probe locks the entire keyboard controller. Let's
|
||||
try to get access to the keyboard again by sending a
|
||||
reset */
|
||||
I8042Flush();
|
||||
I8042Write(DevExt, I8042_CTRL_PORT, KBD_SELF_TEST);
|
||||
I8042ReadDataWait(DevExt, &Value);
|
||||
I8042Flush();
|
||||
}
|
||||
|
||||
DPRINT("Mouse %sdetected\n", Ok ? "" : "not ");
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
@@ -51,25 +51,28 @@ static VOID ZeroEvents( PAFD_HANDLE HandleArray,
|
||||
HandleArray[i].Status = 0;
|
||||
}
|
||||
|
||||
static VOID RemoveSelect( PAFD_ACTIVE_POLL Poll ) {
|
||||
AFD_DbgPrint(MID_TRACE,("Called\n"));
|
||||
|
||||
RemoveEntryList( &Poll->ListEntry );
|
||||
KeCancelTimer( &Poll->Timer );
|
||||
|
||||
ExFreePool( Poll );
|
||||
|
||||
AFD_DbgPrint(MID_TRACE,("Done\n"));
|
||||
}
|
||||
|
||||
static VOID SignalSocket( PAFD_ACTIVE_POLL Poll, PAFD_POLL_INFO PollReq,
|
||||
NTSTATUS Status ) {
|
||||
/* you must pass either Poll OR Irp */
|
||||
static VOID SignalSocket(
|
||||
PAFD_ACTIVE_POLL Poll OPTIONAL,
|
||||
PIRP _Irp OPTIONAL,
|
||||
PAFD_POLL_INFO PollReq,
|
||||
NTSTATUS Status
|
||||
)
|
||||
{
|
||||
UINT i;
|
||||
PIRP Irp = Poll->Irp;
|
||||
PIRP Irp = _Irp ? _Irp : Poll->Irp;
|
||||
AFD_DbgPrint(MID_TRACE,("Called (Status %x)\n", Status));
|
||||
KeCancelTimer( &Poll->Timer );
|
||||
Poll->Irp->IoStatus.Status = Status;
|
||||
Poll->Irp->IoStatus.Information =
|
||||
|
||||
if (Poll)
|
||||
{
|
||||
KeCancelTimer( &Poll->Timer );
|
||||
RemoveEntryList( &Poll->ListEntry );
|
||||
ExFreePool( Poll );
|
||||
}
|
||||
|
||||
Irp->IoStatus.Status = Status;
|
||||
Irp->IoStatus.Information =
|
||||
FIELD_OFFSET(AFD_POLL_INFO, Handles) + sizeof(AFD_HANDLE) * PollReq->HandleCount;
|
||||
CopyBackStatus( PollReq->Handles,
|
||||
PollReq->HandleCount );
|
||||
@@ -84,8 +87,6 @@ static VOID SignalSocket( PAFD_ACTIVE_POLL Poll, PAFD_POLL_INFO PollReq,
|
||||
UnlockHandles( AFD_HANDLES(PollReq), PollReq->HandleCount );
|
||||
AFD_DbgPrint(MID_TRACE,("Completing\n"));
|
||||
IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
|
||||
RemoveEntryList( &Poll->ListEntry );
|
||||
RemoveSelect( Poll );
|
||||
AFD_DbgPrint(MID_TRACE,("Done\n"));
|
||||
}
|
||||
|
||||
@@ -108,7 +109,7 @@ static VOID SelectTimeout( PKDPC Dpc,
|
||||
ZeroEvents( PollReq->Handles, PollReq->HandleCount );
|
||||
|
||||
KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
|
||||
SignalSocket( Poll, PollReq, STATUS_TIMEOUT );
|
||||
SignalSocket( Poll, NULL, PollReq, STATUS_TIMEOUT );
|
||||
KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
|
||||
|
||||
AFD_DbgPrint(MID_TRACE,("Timeout\n"));
|
||||
@@ -143,7 +144,7 @@ VOID KillSelectsForFCB( PAFD_DEVICE_EXTENSION DeviceExt,
|
||||
if( (PVOID)HandleArray[i].Handle == FileObject &&
|
||||
(!OnlyExclusive || (OnlyExclusive && Poll->Exclusive)) ) {
|
||||
ZeroEvents( PollReq->Handles, PollReq->HandleCount );
|
||||
SignalSocket( Poll, PollReq, STATUS_SUCCESS );
|
||||
SignalSocket( Poll, NULL, PollReq, STATUS_SUCCESS );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,7 +162,6 @@ AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||
PFILE_OBJECT FileObject;
|
||||
PAFD_POLL_INFO PollReq = Irp->AssociatedIrp.SystemBuffer;
|
||||
PAFD_DEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
|
||||
PAFD_ACTIVE_POLL Poll = NULL;
|
||||
UINT CopySize = IrpSp->Parameters.DeviceIoControl.InputBufferLength;
|
||||
UINT AllocSize =
|
||||
CopySize + sizeof(AFD_ACTIVE_POLL) - sizeof(AFD_POLL_INFO);
|
||||
@@ -196,22 +196,7 @@ AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||
ZeroEvents( PollReq->Handles,
|
||||
PollReq->HandleCount );
|
||||
|
||||
Poll = ExAllocatePool( NonPagedPool, AllocSize );
|
||||
|
||||
if( Poll ) {
|
||||
Poll->Irp = Irp;
|
||||
Poll->DeviceExt = DeviceExt;
|
||||
Poll->Exclusive = Exclusive;
|
||||
|
||||
KeInitializeTimerEx( &Poll->Timer, NotificationTimer );
|
||||
KeSetTimer( &Poll->Timer, PollReq->Timeout, &Poll->TimeoutDpc );
|
||||
|
||||
KeInitializeDpc( (PRKDPC)&Poll->TimeoutDpc,
|
||||
(PKDEFERRED_ROUTINE)SelectTimeout,
|
||||
Poll );
|
||||
|
||||
KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql );
|
||||
InsertTailList( &DeviceExt->Polls, &Poll->ListEntry );
|
||||
|
||||
for( i = 0; i < PollReq->HandleCount; i++ ) {
|
||||
if( !AFD_HANDLES(PollReq)[i].Handle ) continue;
|
||||
@@ -243,14 +228,37 @@ AfdSelect( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||
if( Signalled ) {
|
||||
Status = STATUS_SUCCESS;
|
||||
Irp->IoStatus.Status = Status;
|
||||
SignalSocket( Poll, PollReq, Status );
|
||||
SignalSocket( NULL, Irp, PollReq, Status );
|
||||
} else {
|
||||
Status = STATUS_PENDING;
|
||||
IoMarkIrpPending( Irp );
|
||||
|
||||
PAFD_ACTIVE_POLL Poll = NULL;
|
||||
|
||||
Poll = ExAllocatePool( NonPagedPool, AllocSize );
|
||||
|
||||
if (Poll){
|
||||
Poll->Irp = Irp;
|
||||
Poll->DeviceExt = DeviceExt;
|
||||
Poll->Exclusive = Exclusive;
|
||||
|
||||
KeInitializeTimerEx( &Poll->Timer, NotificationTimer );
|
||||
|
||||
KeInitializeDpc( (PRKDPC)&Poll->TimeoutDpc,
|
||||
(PKDEFERRED_ROUTINE)SelectTimeout,
|
||||
Poll );
|
||||
|
||||
InsertTailList( &DeviceExt->Polls, &Poll->ListEntry );
|
||||
|
||||
KeSetTimer( &Poll->Timer, PollReq->Timeout, &Poll->TimeoutDpc );
|
||||
|
||||
Status = STATUS_PENDING;
|
||||
IoMarkIrpPending( Irp );
|
||||
} else {
|
||||
AFD_DbgPrint(MAX_TRACE, ("FIXME: do something with the IRP!\n"));
|
||||
Status = STATUS_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
KeReleaseSpinLock( &DeviceExt->Lock, OldIrql );
|
||||
} else Status = STATUS_NO_MEMORY;
|
||||
|
||||
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
|
||||
|
||||
@@ -400,7 +408,7 @@ VOID PollReeval( PAFD_DEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject ) {
|
||||
if( UpdatePollWithFCB( Poll, FileObject ) ) {
|
||||
ThePollEnt = ThePollEnt->Flink;
|
||||
AFD_DbgPrint(MID_TRACE,("Signalling socket\n"));
|
||||
SignalSocket( Poll, PollReq, STATUS_SUCCESS );
|
||||
SignalSocket( Poll, NULL, PollReq, STATUS_SUCCESS );
|
||||
} else
|
||||
ThePollEnt = ThePollEnt->Flink;
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@
|
||||
* If not, write to the Free Software Foundation,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "videoprt.h"
|
||||
@@ -133,18 +132,6 @@ IntVideoPortDispatchOpen(
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
|
||||
InterlockedIncrement((PLONG)&DeviceExtension->DeviceOpened);
|
||||
|
||||
/*
|
||||
* Storing the device extension pointer in a static variable is an
|
||||
* ugly hack. Unfortunately, we need it in VideoPortResetDisplayParameters
|
||||
* and HalAcquireDisplayOwnership doesn't allow us to pass a userdata
|
||||
* parameter. On the bright side, the DISPLAY device is opened
|
||||
* exclusively, so there can be only one device extension active at
|
||||
* any point in time.
|
||||
*/
|
||||
|
||||
ResetDisplayParametersDeviceExtension = DeviceExtension;
|
||||
HalAcquireDisplayOwnership(IntVideoPortResetDisplayParameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -264,6 +251,56 @@ IntVideoPortDispatchDeviceControl(
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*
|
||||
* IntVideoPortWrite
|
||||
*
|
||||
* This is a bit of a hack. We want to take ownership of the display as late
|
||||
* as possible, just before the switch to graphics mode. Win32k knows when
|
||||
* this happens, we don't. So we need Win32k to inform us. This could be done
|
||||
* using an IOCTL, but there's no way of knowing which IOCTL codes are unused
|
||||
* in the communication between GDI driver and miniport driver. So we use
|
||||
* IRP_MJ_WRITE as the signal that win32k is ready to switch to graphics mode,
|
||||
* since we know for certain that there is no read/write activity going on
|
||||
* between GDI and miniport drivers.
|
||||
* We don't actually need the data that is passed, we just trigger on the fact
|
||||
* that an IRP_MJ_WRITE was sent.
|
||||
*
|
||||
* Run Level
|
||||
* PASSIVE_LEVEL
|
||||
*/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
IntVideoPortDispatchWrite(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
PIO_STACK_LOCATION piosStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
NTSTATUS nErrCode;
|
||||
|
||||
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
|
||||
/*
|
||||
* Storing the device extension pointer in a static variable is an
|
||||
* ugly hack. Unfortunately, we need it in VideoPortResetDisplayParameters
|
||||
* and HalAcquireDisplayOwnership doesn't allow us to pass a userdata
|
||||
* parameter. On the bright side, the DISPLAY device is opened
|
||||
* exclusively, so there can be only one device extension active at
|
||||
* any point in time.
|
||||
*/
|
||||
|
||||
ResetDisplayParametersDeviceExtension = DeviceExtension;
|
||||
HalAcquireDisplayOwnership(IntVideoPortResetDisplayParameters);
|
||||
|
||||
nErrCode = STATUS_SUCCESS;
|
||||
Irp->IoStatus.Information = piosStack->Parameters.Write.Length;
|
||||
Irp->IoStatus.Status = nErrCode;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
return nErrCode;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS NTAPI
|
||||
IntVideoPortPnPStartDevice(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
|
@@ -646,6 +646,7 @@ VideoPortInitialize(
|
||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = IntVideoPortDispatchOpen;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = IntVideoPortDispatchClose;
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IntVideoPortDispatchDeviceControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_WRITE] = IntVideoPortDispatchWrite;
|
||||
DriverObject->DriverUnload = IntVideoPortUnload;
|
||||
|
||||
/*
|
||||
|
@@ -148,6 +148,11 @@ IntVideoPortDispatchPower(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
NTSTATUS NTAPI
|
||||
IntVideoPortDispatchWrite(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp);
|
||||
|
||||
VOID NTAPI
|
||||
IntVideoPortUnload(PDRIVER_OBJECT DriverObject);
|
||||
|
||||
|
@@ -18,11 +18,11 @@
|
||||
#define __VERSION_H
|
||||
|
||||
#define KERNEL_VERSION_MAJOR 0
|
||||
#define KERNEL_VERSION_MINOR 3
|
||||
#define KERNEL_VERSION_PATCH_LEVEL 0
|
||||
#define KERNEL_VERSION_MINOR 2
|
||||
#define KERNEL_VERSION_PATCH_LEVEL 8
|
||||
|
||||
/* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"RELEASE" */
|
||||
#define KERNEL_VERSION_BUILD_TYPE L"SVN"
|
||||
#define KERNEL_VERSION_BUILD_TYPE L"RELEASE"
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -2821,8 +2821,6 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, RECT *rc)
|
||||
}
|
||||
}
|
||||
|
||||
TREEVIEW_UpdateScrollBars(infoPtr);
|
||||
|
||||
if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
|
||||
infoPtr->cdmode =
|
||||
TREEVIEW_SendCustomDrawNotify(infoPtr, CDDS_POSTPAINT, hdc, rect);
|
||||
@@ -3337,6 +3335,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
||||
}
|
||||
}
|
||||
}
|
||||
TREEVIEW_UpdateScrollBars(infoPtr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -436,7 +436,7 @@ FT_BEGIN_HEADER
|
||||
/* Do not #undef this macro here, since the build system might */
|
||||
/* define it for certain configurations only. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
//#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@@ -399,7 +399,6 @@ InstallReactOS (HINSTANCE hInstance)
|
||||
|
||||
/* desktop shortcuts */
|
||||
CreateShortcut(CSIDL_DESKTOP, _T("Command Prompt.lnk"), _T("cmd.exe"), _T("Open command prompt"));
|
||||
CreateShortcut(CSIDL_DESKTOP, _T("winefile.lnk"), _T("winefile.exe"), _T("Launch Winefile"));
|
||||
|
||||
/* program startmenu shortcuts */
|
||||
CreateShortcut(CSIDL_PROGRAMS, _T("Command Prompt.lnk"), _T("cmd.exe"), _T("Open command prompt"));
|
||||
|
@@ -730,14 +730,11 @@ void DesktopShellView::PositionIcons(int dir)
|
||||
int dx2 = dir_x2 * cx;
|
||||
int dy2 = dir_y2 * cy;
|
||||
|
||||
int start_x = (start_pos.x * work_area.right)/cx*cx + (cx-32)/2;
|
||||
int start_y = (start_pos.y * work_area.bottom)/cy*cy + 4/*(cy-32)/2*/;
|
||||
int xoffset = (cx-32)/2;
|
||||
int yoffset = 4/*(cy-32)/2*/;
|
||||
|
||||
if (start_x >= work_area.right)
|
||||
start_x -= cx;
|
||||
|
||||
if (start_y >= work_area.bottom)
|
||||
start_y -= cy;
|
||||
int start_x = start_pos.x * (work_area.right - cx) + xoffset;
|
||||
int start_y = start_pos.y * (work_area.bottom - cy) + yoffset;
|
||||
|
||||
int x = start_x;
|
||||
int y = start_y;
|
||||
@@ -755,19 +752,22 @@ void DesktopShellView::PositionIcons(int dir)
|
||||
|
||||
IconMap pos_idx;
|
||||
int cnt = 0;
|
||||
int xhv = start_x;
|
||||
int yhv = start_y;
|
||||
|
||||
for(int idx=i1; idx!=i2; idx+=dir) {
|
||||
pos_idx[IconPos(y, x)] = idx;
|
||||
|
||||
if (_icon_algo == ARRANGE_BORDER_DOWN) {
|
||||
if (++cnt & 1)
|
||||
x = work_area.right - x;
|
||||
x = work_area.right - x - cx + 2*xoffset;
|
||||
else {
|
||||
y += dy1;
|
||||
|
||||
if (y >= work_area.bottom) {
|
||||
if (y + cy - 2 * yoffset > work_area.bottom) {
|
||||
y = start_y;
|
||||
x += dx2;
|
||||
start_x += dx2;
|
||||
x = start_x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,20 +775,32 @@ void DesktopShellView::PositionIcons(int dir)
|
||||
}
|
||||
else if (_icon_algo == ARRANGE_BORDER_HV) {
|
||||
if (++cnt & 1)
|
||||
x = work_area.right - x;
|
||||
x = work_area.right - x - cx + 2*xoffset;
|
||||
else if (cnt & 2) {
|
||||
y += dy1;
|
||||
yhv += cy;
|
||||
y = yhv;
|
||||
x = start_x;
|
||||
|
||||
if (y >= work_area.bottom) {
|
||||
y = start_y;
|
||||
x += dx2;
|
||||
if (y + cy - 2 * yoffset > work_area.bottom) {
|
||||
start_x += cx;
|
||||
xhv = start_x;
|
||||
x = xhv;
|
||||
start_y += cy;
|
||||
yhv = start_y;
|
||||
y = yhv;
|
||||
}
|
||||
} else {
|
||||
x += dx1;
|
||||
xhv += cx;
|
||||
x = xhv;
|
||||
y = start_y;
|
||||
|
||||
if (x >= work_area.right) {
|
||||
x = start_x;
|
||||
y += dy2;
|
||||
if (x + cx - 2 * xoffset > work_area.right) {
|
||||
start_x += cx;
|
||||
xhv = start_x;
|
||||
x = xhv;
|
||||
start_y += cy;
|
||||
yhv = start_y;
|
||||
y = yhv;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -803,10 +815,10 @@ void DesktopShellView::PositionIcons(int dir)
|
||||
x += dx1;
|
||||
y += dy1;
|
||||
|
||||
if (x<0 || x>=work_area.right) {
|
||||
if (x<0 || x+cx-2*xoffset>work_area.right) {
|
||||
x = start_x;
|
||||
y += dy2;
|
||||
} else if (y<0 || y>=work_area.bottom) {
|
||||
} else if (y<0 || y+cy-2*yoffset>work_area.bottom) {
|
||||
y = start_y;
|
||||
x += dx2;
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ PSM_CMD_DESCRIPTOR LookupCommand (const TCHAR * CommandName)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), IDS_Unknown, (LPTSTR) UsageMessage,RC_STRING_MAX_SIZE);
|
||||
|
||||
_ftprintf(stderr, _T("%s '%s'.\n"), UsageMessage, CommandName);
|
||||
_ftprintf(stderr, UsageMessage, CommandName);
|
||||
return NULL;
|
||||
}
|
||||
return & Command [i];
|
||||
|
@@ -41,6 +41,7 @@ BOOL StartVMwConfigWizard, DriverFilesFound, ActivateVBE = FALSE, UninstallDrive
|
||||
|
||||
static WCHAR DestinationDriversPath[MAX_PATH+1];
|
||||
static WCHAR CDDrive = L'\0';
|
||||
static WCHAR PathToVideoDrivers55[MAX_PATH+1] = L"X:\\program files\\VMware\\VMware Tools\\Drivers\\video\\winnt2k\\32Bit\\";
|
||||
static WCHAR PathToVideoDrivers45[MAX_PATH+1] = L"X:\\program files\\VMware\\VMware Tools\\Drivers\\video\\winnt2k\\";
|
||||
static WCHAR PathToVideoDrivers40[MAX_PATH+1] = L"X:\\video\\winnt2k\\";
|
||||
static WCHAR DestinationPath[MAX_PATH+1];
|
||||
@@ -223,9 +224,12 @@ IsVMwareCDInDrive(WCHAR *Drv)
|
||||
if(GetDriveType(Drive) == DRIVE_CDROM)
|
||||
{
|
||||
#endif
|
||||
PathToVideoDrivers55[0] = Current;
|
||||
PathToVideoDrivers40[0] = Current;
|
||||
PathToVideoDrivers45[0] = Current;
|
||||
if(SetCurrentDirectory(PathToVideoDrivers45))
|
||||
if(SetCurrentDirectory(PathToVideoDrivers55))
|
||||
SrcPath = PathToVideoDrivers55;
|
||||
else if(SetCurrentDirectory(PathToVideoDrivers45))
|
||||
SrcPath = PathToVideoDrivers45;
|
||||
else if(SetCurrentDirectory(PathToVideoDrivers40))
|
||||
SrcPath = PathToVideoDrivers40;
|
||||
|
@@ -90,20 +90,18 @@ typedef struct _USER_REFERENCE_ENTRY
|
||||
ASSERT(_obj_ == ref->obj); \
|
||||
\
|
||||
}
|
||||
#define UserRefObjectCo(_obj_) \
|
||||
#define UserRefObjectCo(_obj_, _ref_) \
|
||||
{ \
|
||||
PW32THREAD t; \
|
||||
PUSER_REFERENCE_ENTRY ref; \
|
||||
\
|
||||
ASSERT(_obj_); \
|
||||
t = PsGetWin32Thread(); \
|
||||
ASSERT(t); \
|
||||
ref = (PUSER_REFERENCE_ENTRY)_alloca(sizeof(USER_REFERENCE_ENTRY)); \
|
||||
ASSERT(ref); \
|
||||
ref->obj = _obj_; \
|
||||
ASSERT(_ref_); \
|
||||
(_ref_)->obj = _obj_; \
|
||||
ObmReferenceObject(_obj_); \
|
||||
\
|
||||
PushEntryList(&t->ReferencesList, &ref->Entry); \
|
||||
PushEntryList(&t->ReferencesList, &(_ref_)->Entry); \
|
||||
\
|
||||
}
|
||||
|
||||
|
@@ -433,6 +433,7 @@ NtUserTranslateAccelerator(
|
||||
PWINDOW_OBJECT Window = NULL;
|
||||
PACCELERATOR_TABLE Accel = NULL;
|
||||
ULONG i;
|
||||
USER_REFERENCE_ENTRY AccelRef, WindowRef;
|
||||
DECLARE_RETURN(int);
|
||||
|
||||
DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p)\n",
|
||||
@@ -458,14 +459,14 @@ NtUserTranslateAccelerator(
|
||||
RETURN( 0);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Accel);
|
||||
UserRefObjectCo(Accel, &AccelRef);
|
||||
|
||||
if (!(Window = UserGetWindowObject(hWnd)))
|
||||
{
|
||||
RETURN( 0);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &WindowRef);
|
||||
|
||||
|
||||
/* FIXME: Associate AcceleratorTable with the current thread */
|
||||
|
@@ -405,6 +405,7 @@ STDCALL
|
||||
NtUserShowCaret(HWND hWnd OPTIONAL, BOOL bShow)
|
||||
{
|
||||
PWINDOW_OBJECT Window = NULL;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
DECLARE_RETURN(BOOL);
|
||||
BOOL ret;
|
||||
|
||||
@@ -416,7 +417,7 @@ NtUserShowCaret(HWND hWnd OPTIONAL, BOOL bShow)
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
if (Window) UserRefObjectCo(Window);
|
||||
if (Window) UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if (bShow)
|
||||
ret = co_UserShowCaret(Window);
|
||||
|
@@ -68,12 +68,21 @@ ClassRefObject(PWNDCLASS_OBJECT Class)
|
||||
VOID FASTCALL DestroyClass(PWNDCLASS_OBJECT Class)
|
||||
{
|
||||
PWINSTATION_OBJECT WinSta;
|
||||
WinSta = PsGetWin32Thread()->Desktop->WindowStation;
|
||||
|
||||
ASSERT(Class->refs == 0);
|
||||
RemoveEntryList(&Class->ListEntry);
|
||||
//FIXME: release ATOM
|
||||
RtlDeleteAtomFromAtomTable(WinSta->AtomTable, Class->Atom);
|
||||
|
||||
/* FIXME See bug 899 */
|
||||
if (NULL != PsGetWin32Thread())
|
||||
{
|
||||
WinSta = PsGetWin32Thread()->Desktop->WindowStation;
|
||||
//FIXME: release ATOM
|
||||
RtlDeleteAtomFromAtomTable(WinSta->AtomTable, Class->Atom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Can't locate window station, see bug 899\n");
|
||||
}
|
||||
ExFreePool(Class);
|
||||
}
|
||||
|
||||
@@ -557,6 +566,7 @@ NtUserSetClassLong(HWND hWnd,
|
||||
{
|
||||
PWINDOW_OBJECT Window;
|
||||
LONG Ret;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
DECLARE_RETURN(DWORD);
|
||||
|
||||
DPRINT("Enter NtUserSetClassLong\n");
|
||||
@@ -567,7 +577,7 @@ NtUserSetClassLong(HWND hWnd,
|
||||
RETURN(0);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
Ret = IntGetClassLong(Window, Offset, Ansi);
|
||||
co_IntSetClassLong(Window, Offset, dwNewLong, Ansi);
|
||||
|
@@ -61,12 +61,13 @@ co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
|
||||
VOID FASTCALL
|
||||
co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
|
||||
{
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
PWINDOW_OBJECT Window;
|
||||
|
||||
if ((Window = UserGetWindowObject(hWnd)))
|
||||
{
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
/* Send palette messages */
|
||||
if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
|
||||
@@ -218,6 +219,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
|
||||
{
|
||||
HWND Top;
|
||||
PWINDOW_OBJECT TopWindow;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
ASSERT_REFS_CO(Window);
|
||||
|
||||
@@ -231,7 +233,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
|
||||
Top = IntFindChildWindowToOwner(DesktopWindow, Window);
|
||||
if((TopWnd = UserGetWindowObject(Top)))
|
||||
{
|
||||
UserRefObjectCo(TopWnd);
|
||||
UserRefObjectCo(TopWnd, &Ref);
|
||||
Ret = co_IntMouseActivateWindow(TopWnd);
|
||||
UserDerefObjectCo(TopWnd);
|
||||
|
||||
@@ -246,7 +248,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
|
||||
if (!TopWindow) return FALSE;
|
||||
|
||||
/* TMN: Check return valud from this function? */
|
||||
UserRefObjectCo(TopWindow);
|
||||
UserRefObjectCo(TopWindow, &Ref);
|
||||
|
||||
co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE);
|
||||
|
||||
@@ -386,6 +388,7 @@ CLEANUP:
|
||||
HWND STDCALL
|
||||
NtUserSetActiveWindow(HWND hWnd)
|
||||
{
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
DECLARE_RETURN(HWND);
|
||||
|
||||
DPRINT("Enter NtUserSetActiveWindow(%x)\n", hWnd);
|
||||
@@ -412,7 +415,7 @@ NtUserSetActiveWindow(HWND hWnd)
|
||||
RETURN( 0);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
hWndPrev = co_IntSetActiveWindow(Window);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -503,6 +506,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
|
||||
PUSER_MESSAGE_QUEUE ThreadQueue;
|
||||
HWND hWndPrev;
|
||||
PWINDOW_OBJECT TopWnd;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
ASSERT_REFS_CO(Window);
|
||||
|
||||
@@ -523,7 +527,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
|
||||
if (TopWnd && TopWnd->hSelf != UserGetActiveWindow())
|
||||
{
|
||||
// PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop);
|
||||
UserRefObjectCo(TopWnd);
|
||||
UserRefObjectCo(TopWnd, &Ref);
|
||||
co_IntSetActiveWindow(TopWnd);
|
||||
UserDerefObjectCo(TopWnd);
|
||||
}
|
||||
@@ -547,6 +551,7 @@ HWND STDCALL
|
||||
NtUserSetFocus(HWND hWnd)
|
||||
{
|
||||
PWINDOW_OBJECT Window;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
DECLARE_RETURN(HWND);
|
||||
HWND ret;
|
||||
|
||||
@@ -558,7 +563,7 @@ NtUserSetFocus(HWND hWnd)
|
||||
RETURN(NULL);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
ret = co_UserSetFocus(Window);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
|
@@ -547,6 +547,7 @@ BOOL FASTCALL
|
||||
co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *HitTest, BOOL Remove)
|
||||
{
|
||||
PWINDOW_OBJECT Window;
|
||||
USER_REFERENCE_ENTRY Ref, DesktopRef;
|
||||
|
||||
if(!(Window = UserGetWindowObject(Msg->hwnd)))
|
||||
{
|
||||
@@ -554,7 +555,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if(ThreadQueue == Window->MessageQueue &&
|
||||
ThreadQueue->CaptureWindow != Window->hSelf)
|
||||
@@ -572,7 +573,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
|
||||
{
|
||||
PWINDOW_OBJECT Wnd;
|
||||
|
||||
UserRefObjectCo(DesktopWindow);
|
||||
UserRefObjectCo(DesktopWindow, &DesktopRef);
|
||||
|
||||
co_WinPosWindowFromPoint(DesktopWindow, Window->MessageQueue, &Msg->pt, &Wnd);
|
||||
if(Wnd)
|
||||
@@ -664,6 +665,7 @@ co_IntPeekMessage(PUSER_MESSAGE Msg,
|
||||
PUSER_MESSAGE_QUEUE ThreadQueue;
|
||||
PUSER_MESSAGE Message;
|
||||
BOOL Present, RemoveMessages;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
/* The queues and order in which they are checked are documented in the MSDN
|
||||
article on GetMessage() */
|
||||
@@ -772,7 +774,7 @@ MessageFound:
|
||||
{
|
||||
USHORT HitTest;
|
||||
|
||||
UserRefObjectCo(MsgWindow);
|
||||
UserRefObjectCo(MsgWindow, &Ref);
|
||||
|
||||
if(co_IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE))
|
||||
/* FIXME - check message filter again, if the message doesn't match anymore,
|
||||
@@ -972,6 +974,7 @@ NtUserGetMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
|
||||
UINT Size;
|
||||
USER_MESSAGE Msg;
|
||||
DECLARE_RETURN(BOOL);
|
||||
// USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetMessage\n");
|
||||
UserEnterExclusive();
|
||||
@@ -982,7 +985,7 @@ NtUserGetMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
|
||||
RETURN(-1);
|
||||
}
|
||||
|
||||
// if (Window) UserRefObjectCo(Window);
|
||||
// if (Window) UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if (MsgFilterMax < MsgFilterMin)
|
||||
{
|
||||
@@ -1357,6 +1360,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd,
|
||||
LPARAM lParamPacked;
|
||||
PW32THREAD Win32Thread;
|
||||
DECLARE_RETURN(LRESULT);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
/* FIXME: Call hooks. */
|
||||
if (!(Window = UserGetWindowObject(hWnd)))
|
||||
@@ -1364,7 +1368,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd,
|
||||
RETURN( FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
Win32Thread = PsGetWin32Thread();
|
||||
|
||||
|
@@ -689,6 +689,7 @@ NtUserCallHwndLock(
|
||||
{
|
||||
BOOL Ret = 0;
|
||||
PWINDOW_OBJECT Window;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
DECLARE_RETURN(BOOLEAN);
|
||||
|
||||
DPRINT("Enter NtUserCallHwndLock\n");
|
||||
@@ -698,7 +699,7 @@ NtUserCallHwndLock(
|
||||
{
|
||||
RETURN( FALSE);
|
||||
}
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
/* FIXME: Routine can be 0x53 - 0x5E */
|
||||
switch (Routine)
|
||||
|
@@ -468,6 +468,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
|
||||
PVOID WaitObjects[2];
|
||||
NTSTATUS WaitStatus;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
if( !IntGetScreenDC() ||
|
||||
PsGetWin32Thread()->MessageQueue == W32kGetPrimitiveMessageQueue() )
|
||||
@@ -495,7 +496,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
|
||||
|
||||
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
|
||||
|
||||
if (DesktopWindow) UserRefObjectCo(DesktopWindow);//can DesktopWindow be NULL?
|
||||
if (DesktopWindow) UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL?
|
||||
|
||||
/* Process messages in the message queue itself. */
|
||||
IntLockHardwareMessageQueue(MessageQueue);
|
||||
|
@@ -295,7 +295,8 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
|
||||
Window = UserGetWindowObject(*phWnd);
|
||||
if (Window && (Window->Style & WS_VISIBLE))
|
||||
{
|
||||
UserRefObjectCo(Window);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
co_IntPaintWindows(Window, Flags);
|
||||
UserDerefObjectCo(Window);
|
||||
}
|
||||
@@ -722,6 +723,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
|
||||
PROSRGNDATA Rgn;
|
||||
NTSTATUS Status;
|
||||
DECLARE_RETURN(HDC);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserBeginPaint\n");
|
||||
UserEnterExclusive();
|
||||
@@ -731,7 +733,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
|
||||
RETURN( NULL);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
co_UserHideCaret(Window);
|
||||
|
||||
@@ -828,6 +830,7 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs)
|
||||
{
|
||||
PWINDOW_OBJECT Window;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserEndPaint\n");
|
||||
UserEnterExclusive();
|
||||
@@ -839,7 +842,7 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs)
|
||||
|
||||
UserReleaseDC(Window, lPs->hdc, TRUE);
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
co_UserShowCaret(Window);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -894,6 +897,7 @@ NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
|
||||
DECLARE_RETURN(INT);
|
||||
PWINDOW_OBJECT Window;
|
||||
INT ret;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetUpdateRgn\n");
|
||||
UserEnterExclusive();
|
||||
@@ -903,7 +907,7 @@ NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
|
||||
RETURN(ERROR);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
ret = co_UserGetUpdateRgn(Window, hRgn, bErase);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -975,7 +979,8 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
|
||||
|
||||
if (bErase && !IntGdiIsEmptyRect(&Rect))
|
||||
{
|
||||
UserRefObjectCo(Window);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
co_UserRedrawWindow(Window, NULL, NULL, RDW_ERASENOW | RDW_NOCHILDREN);
|
||||
UserDerefObjectCo(Window);
|
||||
}
|
||||
@@ -1013,6 +1018,7 @@ NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
|
||||
NTSTATUS Status;
|
||||
PWINDOW_OBJECT Wnd;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserRedrawWindow\n");
|
||||
UserEnterExclusive();
|
||||
@@ -1034,7 +1040,7 @@ NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
|
||||
}
|
||||
}
|
||||
|
||||
UserRefObjectCo(Wnd);
|
||||
UserRefObjectCo(Wnd, &Ref);
|
||||
|
||||
Status = co_UserRedrawWindow(Wnd, NULL == lprcUpdate ? NULL : &SafeUpdateRect,
|
||||
hrgnUpdate, flags);
|
||||
@@ -1206,6 +1212,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
|
||||
BOOL bOwnRgn = TRUE;
|
||||
NTSTATUS Status;
|
||||
DECLARE_RETURN(DWORD);
|
||||
USER_REFERENCE_ENTRY Ref, CaretRef;
|
||||
|
||||
DPRINT("Enter NtUserScrollWindowEx\n");
|
||||
UserEnterExclusive();
|
||||
@@ -1216,7 +1223,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
|
||||
Window = NULL; /* prevent deref at cleanup */
|
||||
RETURN( ERROR);
|
||||
}
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
IntGetClientRect(Window, &rc);
|
||||
|
||||
@@ -1292,6 +1299,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
|
||||
RECT r, dummy;
|
||||
POINT ClientOrigin;
|
||||
PWINDOW_OBJECT Wnd;
|
||||
USER_REFERENCE_ENTRY WndRef;
|
||||
|
||||
IntGetClientOrigin(Window, &ClientOrigin);
|
||||
for (i = 0; List[i]; i++)
|
||||
@@ -1307,7 +1315,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
|
||||
|
||||
if (! UnsafeRect || IntGdiIntersectRect(&dummy, &r, &rc))
|
||||
{
|
||||
UserRefObjectCo(Wnd);
|
||||
UserRefObjectCo(Wnd, &WndRef);
|
||||
co_WinPosSetWindowPos(Wnd, 0, r.left + dx, r.top + dy, 0, 0,
|
||||
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
|
||||
SWP_NOREDRAW);
|
||||
@@ -1329,7 +1337,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
|
||||
|
||||
if ((CaretWnd = UserGetWindowObject(hwndCaret)))
|
||||
{
|
||||
UserRefObjectCo(CaretWnd);
|
||||
UserRefObjectCo(CaretWnd, &CaretRef);
|
||||
|
||||
co_IntSetCaretPos(caretrc.left + dx, caretrc.top + dy);
|
||||
co_UserShowCaret(CaretWnd);
|
||||
|
@@ -548,6 +548,7 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
|
||||
PWINDOW_OBJECT Window;
|
||||
BOOL Ret;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetScrollBarInfo\n");
|
||||
UserEnterExclusive();
|
||||
@@ -564,7 +565,7 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -595,6 +596,7 @@ NtUserGetScrollInfo(HWND hWnd, int fnBar, LPSCROLLINFO lpsi)
|
||||
DWORD sz;
|
||||
BOOL Ret;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetScrollInfo\n");
|
||||
UserEnterExclusive();
|
||||
@@ -619,7 +621,7 @@ NtUserGetScrollInfo(HWND hWnd, int fnBar, LPSCROLLINFO lpsi)
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
Ret = co_IntGetScrollInfo(Window, fnBar, &psi);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -650,6 +652,7 @@ NtUserEnableScrollBar(
|
||||
PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
|
||||
BOOL Chg = FALSE;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserEnableScrollBar\n");
|
||||
UserEnterExclusive();
|
||||
@@ -658,7 +661,7 @@ NtUserEnableScrollBar(
|
||||
{
|
||||
RETURN(FALSE);
|
||||
}
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if(wSBflags == SB_CTL)
|
||||
{
|
||||
@@ -732,6 +735,7 @@ NtUserSetScrollBarInfo(
|
||||
NTSTATUS Status;
|
||||
LONG Obj;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserSetScrollBarInfo\n");
|
||||
UserEnterExclusive();
|
||||
@@ -740,7 +744,7 @@ NtUserSetScrollBarInfo(
|
||||
{
|
||||
RETURN( FALSE);
|
||||
}
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
Obj = SBOBJ_TO_SBID(idObject);
|
||||
if(!SBID_IS_VALID(Obj))
|
||||
@@ -792,6 +796,7 @@ NtUserSetScrollInfo(
|
||||
NTSTATUS Status;
|
||||
SCROLLINFO ScrollInfo;
|
||||
DECLARE_RETURN(DWORD);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserSetScrollInfo\n");
|
||||
UserEnterExclusive();
|
||||
@@ -800,7 +805,7 @@ NtUserSetScrollInfo(
|
||||
{
|
||||
RETURN( 0);
|
||||
}
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos));
|
||||
if(!NT_SUCCESS(Status))
|
||||
@@ -892,6 +897,7 @@ NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
|
||||
PWINDOW_OBJECT Window;
|
||||
DECLARE_RETURN(DWORD);
|
||||
DWORD ret;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserShowScrollBar\n");
|
||||
UserEnterExclusive();
|
||||
@@ -901,7 +907,7 @@ NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
|
||||
RETURN(0);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
ret = co_UserShowScrollBar(Window, wBar, bShow);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
|
@@ -60,6 +60,7 @@ IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL S
|
||||
{
|
||||
PWINDOW_OBJECT Window;
|
||||
UINT_PTR Ret = 0;
|
||||
PUSER_MESSAGE_QUEUE MessageQueue;
|
||||
|
||||
DPRINT("IntSetTimer wnd %x id %p elapse %u timerproc %p systemtimer %s\n",
|
||||
Wnd, IDEvent, Elapse, TimerFunc, SystemTimer ? "TRUE" : "FALSE");
|
||||
@@ -82,6 +83,7 @@ IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL S
|
||||
HintIndex = ++IDEvent;
|
||||
IntUnlockWindowlessTimerBitmap();
|
||||
Ret = IDEvent;
|
||||
MessageQueue = PsGetWin32Thread()->MessageQueue;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -99,6 +101,7 @@ IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL S
|
||||
}
|
||||
|
||||
Ret = IDEvent;
|
||||
MessageQueue = Window->MessageQueue;
|
||||
}
|
||||
|
||||
#if 1
|
||||
@@ -128,7 +131,7 @@ IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL S
|
||||
Elapse = 10;
|
||||
}
|
||||
|
||||
if (! MsqSetTimer(PsGetWin32Thread()->MessageQueue, Wnd,
|
||||
if (! MsqSetTimer(MessageQueue, Wnd,
|
||||
IDEvent, Elapse, TimerFunc,
|
||||
SystemTimer ? WM_SYSTIMER : WM_TIMER))
|
||||
{
|
||||
|
@@ -151,6 +151,7 @@ co_VIS_WindowLayoutChanged(
|
||||
{
|
||||
HRGN Temp;
|
||||
PWINDOW_OBJECT Parent;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
ASSERT_REFS_CO(Window);
|
||||
|
||||
@@ -164,7 +165,7 @@ co_VIS_WindowLayoutChanged(
|
||||
Window->WindowRect.left - Parent->ClientRect.left,
|
||||
Window->WindowRect.top - Parent->ClientRect.top);
|
||||
|
||||
UserRefObjectCo(Parent);
|
||||
UserRefObjectCo(Parent, &Ref);
|
||||
co_UserRedrawWindow(Parent, NULL, Temp,
|
||||
RDW_FRAME | RDW_ERASE | RDW_INVALIDATE |
|
||||
RDW_ALLCHILDREN);
|
||||
|
@@ -239,7 +239,8 @@ static void IntSendDestroyMsg(HWND hWnd)
|
||||
Window = UserGetWindowObject(hWnd);
|
||||
if (Window)
|
||||
{
|
||||
// UserRefObjectCo(Window);
|
||||
// USER_REFERENCE_ENTRY Ref;
|
||||
// UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if (!IntGetOwner(Window) && !IntGetParent(Window))
|
||||
{
|
||||
@@ -569,7 +570,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
|
||||
PW32THREAD WThread;
|
||||
PLIST_ENTRY Current;
|
||||
PWINDOW_OBJECT Wnd;
|
||||
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
WThread = Thread->Tcb.Win32Thread;
|
||||
|
||||
while (!IsListEmpty(&WThread->WindowListHead))
|
||||
@@ -588,7 +589,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
|
||||
|
||||
//ASSERT(co_UserDestroyWindow(Wnd));
|
||||
|
||||
UserRefObjectCo(Wnd);//faxme: temp hack??
|
||||
UserRefObjectCo(Wnd, &Ref);//faxme: temp hack??
|
||||
if (!co_UserDestroyWindow(Wnd))
|
||||
{
|
||||
DPRINT1("Unable to destroy window 0x%x at thread cleanup... This is _VERY_ bad!\n", Wnd);
|
||||
@@ -1355,6 +1356,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
|
||||
BOOL MenuChanged;
|
||||
DECLARE_RETURN(HWND);
|
||||
BOOL HasOwner;
|
||||
USER_REFERENCE_ENTRY ParentRef, Ref;
|
||||
|
||||
ParentWindowHandle = PsGetWin32Thread()->Desktop->DesktopWindow;
|
||||
OwnerWindowHandle = NULL;
|
||||
@@ -1388,7 +1390,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
|
||||
// {
|
||||
ParentWindow = UserGetWindowObject(ParentWindowHandle);
|
||||
|
||||
if (ParentWindow) UserRefObjectCo(ParentWindow);
|
||||
if (ParentWindow) UserRefObjectCo(ParentWindow, &ParentRef);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@@ -1441,7 +1443,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
|
||||
RETURN( (HWND)0);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
ObDereferenceObject(WinSta);
|
||||
|
||||
@@ -2033,7 +2035,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
|
||||
ASSERT_REFS_CO(Window); //fixme: temp hack?
|
||||
|
||||
/* Check for owner thread and desktop window */
|
||||
if ((Window->OwnerThread != PsGetCurrentThread()) || IntIsDesktopWindow(Window))
|
||||
if ((Window->OwnerThread != PsGetCurrentThread()))
|
||||
{
|
||||
SetLastWin32Error(ERROR_ACCESS_DENIED);
|
||||
return FALSE;
|
||||
@@ -2101,7 +2103,8 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
|
||||
HWND *ChildHandle;
|
||||
PWINDOW_OBJECT Child, Desktop;
|
||||
|
||||
Desktop = UserGetWindowObject(IntGetDesktopWindow());
|
||||
Desktop = IntIsDesktopWindow(Window) ? Window :
|
||||
UserGetWindowObject(IntGetDesktopWindow());
|
||||
Children = IntWinListChildren(Desktop);
|
||||
|
||||
if (Children)
|
||||
@@ -2118,8 +2121,8 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
|
||||
|
||||
if (IntWndBelongsToThread(Child, PsGetWin32Thread()))
|
||||
{
|
||||
|
||||
UserRefObjectCo(Child);//temp hack?
|
||||
USER_REFERENCE_ENTRY ChildRef;
|
||||
UserRefObjectCo(Child, &ChildRef);//temp hack?
|
||||
co_UserDestroyWindow(Child);
|
||||
UserDerefObjectCo(Child);//temp hack?
|
||||
|
||||
@@ -2165,6 +2168,7 @@ NtUserDestroyWindow(HWND Wnd)
|
||||
PWINDOW_OBJECT Window;
|
||||
DECLARE_RETURN(BOOLEAN);
|
||||
BOOLEAN ret;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserDestroyWindow\n");
|
||||
UserEnterExclusive();
|
||||
@@ -2174,7 +2178,7 @@ NtUserDestroyWindow(HWND Wnd)
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);//faxme: dunno if win should be reffed during destroy..
|
||||
UserRefObjectCo(Window, &Ref);//faxme: dunno if win should be reffed during destroy..
|
||||
ret = co_UserDestroyWindow(Window);
|
||||
UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy..
|
||||
|
||||
@@ -2270,7 +2274,7 @@ IntFindWindow(PWINDOW_OBJECT Parent,
|
||||
/* Do not send WM_GETTEXT messages in the kernel mode version!
|
||||
The user mode version however calls GetWindowText() which will
|
||||
send WM_GETTEXT messages to windows belonging to its processes */
|
||||
if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE)) &&
|
||||
if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), TRUE)) &&
|
||||
(!ClassAtom || Child->Class->Atom == ClassAtom))
|
||||
{
|
||||
Ret = Child->hSelf;
|
||||
@@ -2449,7 +2453,7 @@ NtUserFindWindowEx(HWND hwndParent,
|
||||
The user mode version however calls GetWindowText() which will
|
||||
send WM_GETTEXT messages to windows belonging to its processes */
|
||||
WindowMatches = !CheckWindowName || !RtlCompareUnicodeString(
|
||||
&WindowName, &TopLevelWindow->WindowName, FALSE);
|
||||
&WindowName, &TopLevelWindow->WindowName, TRUE);
|
||||
ClassMatches = !CheckClassName ||
|
||||
ClassAtom == TopLevelWindow->Class->Atom;
|
||||
|
||||
@@ -2778,6 +2782,7 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
|
||||
{
|
||||
PWINDOW_OBJECT Wnd = NULL, WndParent = NULL, WndOldParent;
|
||||
HWND hWndOldParent = NULL;
|
||||
USER_REFERENCE_ENTRY Ref, ParentRef;
|
||||
|
||||
if (IntIsBroadcastHwnd(hWndChild) || IntIsBroadcastHwnd(hWndNewParent))
|
||||
{
|
||||
@@ -2811,8 +2816,8 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
|
||||
return( NULL);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Wnd);
|
||||
UserRefObjectCo(WndParent);
|
||||
UserRefObjectCo(Wnd, &Ref);
|
||||
UserRefObjectCo(WndParent, &ParentRef);
|
||||
|
||||
WndOldParent = co_IntSetParent(Wnd, WndParent);
|
||||
|
||||
@@ -2930,6 +2935,7 @@ NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
|
||||
PWINSTATION_OBJECT WinStaObject;
|
||||
PWINDOW_OBJECT WndShell;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserSetShellWindowEx\n");
|
||||
UserEnterExclusive();
|
||||
@@ -2985,7 +2991,7 @@ NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
|
||||
RETURN( FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(WndShell);
|
||||
UserRefObjectCo(WndShell, &Ref);
|
||||
co_WinPosSetWindowPos(WndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||
|
||||
WinStaObject->ShellWindow = hwndShell;
|
||||
@@ -3876,7 +3882,9 @@ NtUserSetMenu(
|
||||
|
||||
if (Changed && Repaint)
|
||||
{
|
||||
UserRefObjectCo(Window);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||
|
||||
@@ -3917,6 +3925,7 @@ NtUserSetWindowPlacement(HWND hWnd,
|
||||
WINDOWPLACEMENT Safepl;
|
||||
NTSTATUS Status;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserSetWindowPlacement\n");
|
||||
UserEnterExclusive();
|
||||
@@ -3936,7 +3945,7 @@ NtUserSetWindowPlacement(HWND hWnd,
|
||||
RETURN( FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if ((Window->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
|
||||
{
|
||||
@@ -3982,6 +3991,7 @@ NtUserSetWindowPos(
|
||||
DECLARE_RETURN(BOOL);
|
||||
PWINDOW_OBJECT Window;
|
||||
BOOL ret;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserSetWindowPos\n");
|
||||
UserEnterExclusive();
|
||||
@@ -3991,7 +4001,7 @@ NtUserSetWindowPos(
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -4114,7 +4124,8 @@ NtUserSetWindowRgn(
|
||||
|
||||
if(bRedraw)
|
||||
{
|
||||
UserRefObjectCo(Window);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
co_UserRedrawWindow(Window, NULL, NULL, RDW_INVALIDATE);
|
||||
UserDerefObjectCo(Window);
|
||||
}
|
||||
@@ -4137,6 +4148,7 @@ NtUserShowWindow(HWND hWnd, LONG nCmdShow)
|
||||
PWINDOW_OBJECT Window;
|
||||
BOOL ret;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserShowWindow\n");
|
||||
UserEnterExclusive();
|
||||
@@ -4146,7 +4158,7 @@ NtUserShowWindow(HWND hWnd, LONG nCmdShow)
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
ret = co_WinPosShowWindow(Window, nCmdShow);
|
||||
UserDerefObjectCo(Window);
|
||||
|
||||
@@ -4206,6 +4218,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
|
||||
HWND Ret;
|
||||
PWINDOW_OBJECT DesktopWindow = NULL, Window = NULL;
|
||||
DECLARE_RETURN(HWND);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserWindowFromPoint\n");
|
||||
UserEnterExclusive();
|
||||
@@ -4219,7 +4232,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
|
||||
|
||||
//hmm... threads live on desktops thus we have a reference on the desktop and indirectly the desktop window
|
||||
//its possible this referencing is useless, thou it shouldnt hurt...
|
||||
UserRefObjectCo(DesktopWindow);
|
||||
UserRefObjectCo(DesktopWindow, &Ref);
|
||||
|
||||
Hit = co_WinPosWindowFromPoint(DesktopWindow, PsGetWin32Thread()->MessageQueue, &pt, &Window);
|
||||
|
||||
|
@@ -149,6 +149,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
|
||||
{
|
||||
PWINDOW_OBJECT WndTo = NULL;
|
||||
HWND Fg;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
ASSERT_REFS_CO(Window);
|
||||
|
||||
@@ -176,7 +177,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
|
||||
|
||||
done:
|
||||
|
||||
if (WndTo) UserRefObjectCo(WndTo);
|
||||
if (WndTo) UserRefObjectCo(WndTo, &Ref);
|
||||
|
||||
Fg = UserGetForegroundWindow();
|
||||
if ((!Fg || Window->hSelf == Fg) && WndTo)//fixme: ok if WndTo is NULL??
|
||||
@@ -224,7 +225,8 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
|
||||
|
||||
if((WndChild->Style & WS_MINIMIZE) != 0 )
|
||||
{
|
||||
UserRefObjectCo(WndChild);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
UserRefObjectCo(WndChild, &Ref);
|
||||
|
||||
co_WinPosSetWindowPos(WndChild, 0, x + UserGetSystemMetrics(SM_CXBORDER),
|
||||
y - yspacing - UserGetSystemMetrics(SM_CYBORDER)
|
||||
@@ -372,8 +374,8 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
|
||||
Window->Style &= ~WS_MINIMIZE;
|
||||
if (Window->Flags & WINDOWOBJECT_RESTOREMAX)
|
||||
{
|
||||
co_WinPosGetMinMaxInfo(Window, NULL,
|
||||
&InternalPos->MaxPos, NULL, &Size);
|
||||
co_WinPosGetMinMaxInfo(Window, &Size,
|
||||
&InternalPos->MaxPos, NULL, NULL);
|
||||
Window->Style |= WS_MAXIMIZE;
|
||||
IntGdiSetRect(NewPos, InternalPos->MaxPos.x,
|
||||
InternalPos->MaxPos.y, Size.x, Size.y);
|
||||
@@ -596,7 +598,7 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
|
||||
|
||||
if (!(WinPos->flags & SWP_NOSENDCHANGING))
|
||||
{
|
||||
co_IntSendMessage(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
|
||||
co_IntPostOrSendMessage(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
|
||||
}
|
||||
|
||||
*WindowRect = Window->WindowRect;
|
||||
@@ -709,7 +711,8 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
|
||||
if ((Wnd->Style & WS_POPUP) &&
|
||||
UserGetWindow(List[i], GW_OWNER) == hWnd)
|
||||
{
|
||||
UserRefObjectCo(Wnd);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
UserRefObjectCo(Wnd, &Ref);
|
||||
|
||||
co_WinPosSetWindowPos(Wnd, hWndInsertAfter, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
|
||||
@@ -1282,7 +1285,7 @@ co_WinPosSetWindowPos(
|
||||
}
|
||||
|
||||
if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
|
||||
co_IntSendMessage(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM) &WinPos);
|
||||
co_IntPostOrSendMessage(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM) &WinPos);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1337,28 +1340,38 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
|
||||
/* Fall through. */
|
||||
case SW_MINIMIZE:
|
||||
{
|
||||
Swp |= SWP_FRAMECHANGED | SWP_NOACTIVATE;
|
||||
Swp |= SWP_NOACTIVATE;
|
||||
if (!(Window->Style & WS_MINIMIZE))
|
||||
{
|
||||
Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos);
|
||||
Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos) |
|
||||
SWP_FRAMECHANGED;
|
||||
}
|
||||
else
|
||||
{
|
||||
Swp |= SWP_NOSIZE | SWP_NOMOVE;
|
||||
if (! WasVisible)
|
||||
{
|
||||
Swp |= SWP_FRAMECHANGED;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SW_SHOWMAXIMIZED:
|
||||
{
|
||||
Swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
|
||||
Swp |= SWP_SHOWWINDOW;
|
||||
if (!(Window->Style & WS_MAXIMIZE))
|
||||
{
|
||||
Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos);
|
||||
Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos) |
|
||||
SWP_FRAMECHANGED;
|
||||
}
|
||||
else
|
||||
{
|
||||
Swp |= SWP_NOSIZE | SWP_NOMOVE;
|
||||
if (! WasVisible)
|
||||
{
|
||||
Swp |= SWP_FRAMECHANGED;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1377,14 +1390,19 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
|
||||
case SW_SHOWNORMAL:
|
||||
case SW_SHOWDEFAULT:
|
||||
case SW_RESTORE:
|
||||
Swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
|
||||
Swp |= SWP_SHOWWINDOW;
|
||||
if (Window->Style & (WS_MINIMIZE | WS_MAXIMIZE))
|
||||
{
|
||||
Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos);
|
||||
Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos) |
|
||||
SWP_FRAMECHANGED;
|
||||
}
|
||||
else
|
||||
{
|
||||
Swp |= SWP_NOSIZE | SWP_NOMOVE;
|
||||
if (! WasVisible)
|
||||
{
|
||||
Swp |= SWP_FRAMECHANGED;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1514,6 +1532,7 @@ co_WinPosSearchChildren(
|
||||
{
|
||||
PWINDOW_OBJECT Current;
|
||||
HWND *List, *phWnd;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
ASSERT_REFS_CO(ScopeWin);
|
||||
|
||||
@@ -1556,7 +1575,7 @@ co_WinPosSearchChildren(
|
||||
break;
|
||||
}
|
||||
|
||||
UserRefObjectCo(Current);
|
||||
UserRefObjectCo(Current, &Ref);
|
||||
|
||||
if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests))
|
||||
{
|
||||
@@ -1641,6 +1660,7 @@ NtUserGetMinMaxInfo(
|
||||
MINMAXINFO SafeMinMax;
|
||||
NTSTATUS Status;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetMinMaxInfo\n");
|
||||
UserEnterExclusive();
|
||||
@@ -1650,7 +1670,7 @@ NtUserGetMinMaxInfo(
|
||||
RETURN( FALSE);
|
||||
}
|
||||
|
||||
UserRefObjectCo(Window);
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
Size.x = Window->WindowRect.left;
|
||||
Size.y = Window->WindowRect.top;
|
||||
|
@@ -1022,10 +1022,9 @@ NtGdiSetPixel(
|
||||
INT Y,
|
||||
COLORREF Color)
|
||||
{
|
||||
COLORREF cr = NtGdiGetPixel(hDC,X,Y);
|
||||
if(cr != CLR_INVALID && NtGdiSetPixelV(hDC,X,Y,Color))
|
||||
if (NtGdiSetPixelV(hDC,X,Y,Color))
|
||||
{
|
||||
return(cr);
|
||||
return NtGdiGetPixel(hDC,X,Y);
|
||||
}
|
||||
return ((COLORREF) -1);
|
||||
}
|
||||
|
@@ -638,6 +638,7 @@ NtGdiUpdateColors(HDC hDC)
|
||||
{
|
||||
PWINDOW_OBJECT Wnd;
|
||||
BOOL calledFromUser, ret;
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
calledFromUser = UserIsEntered();
|
||||
|
||||
@@ -657,7 +658,7 @@ NtGdiUpdateColors(HDC hDC)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UserRefObjectCo(Wnd);
|
||||
UserRefObjectCo(Wnd, &Ref);
|
||||
ret = co_UserRedrawWindow(Wnd, NULL, 0, RDW_INVALIDATE);
|
||||
UserDerefObjectCo(Wnd);
|
||||
|
||||
|
@@ -661,6 +661,61 @@ IntPrepareDriverIfNeeded()
|
||||
return (PrimarySurface.PreparedDriver ? TRUE : IntPrepareDriver());
|
||||
}
|
||||
|
||||
static BOOL FASTCALL
|
||||
PrepareVideoPrt()
|
||||
{
|
||||
PIRP Irp;
|
||||
NTSTATUS Status;
|
||||
IO_STATUS_BLOCK Iosb;
|
||||
BOOL Prepare = TRUE;
|
||||
ULONG Length = sizeof(BOOL);
|
||||
PIO_STACK_LOCATION StackPtr;
|
||||
LARGE_INTEGER StartOffset;
|
||||
PFILE_OBJECT FileObject = PrimarySurface.VideoFileObject;
|
||||
PDEVICE_OBJECT DeviceObject = FileObject->DeviceObject;
|
||||
|
||||
DPRINT("PrepareVideoPrt() called\n");
|
||||
|
||||
KeClearEvent(&PrimarySurface.VideoFileObject->Event);
|
||||
|
||||
ObReferenceObjectByPointer(FileObject, 0, IoFileObjectType, KernelMode);
|
||||
|
||||
StartOffset.QuadPart = 0;
|
||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_WRITE,
|
||||
DeviceObject,
|
||||
(PVOID) &Prepare,
|
||||
Length,
|
||||
&StartOffset,
|
||||
NULL,
|
||||
&Iosb);
|
||||
if (NULL == Irp)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Set up IRP Data */
|
||||
Irp->Tail.Overlay.OriginalFileObject = FileObject;
|
||||
Irp->RequestorMode = KernelMode;
|
||||
Irp->Overlay.AsynchronousParameters.UserApcRoutine = NULL;
|
||||
Irp->Overlay.AsynchronousParameters.UserApcContext = NULL;
|
||||
Irp->Flags |= IRP_WRITE_OPERATION;
|
||||
|
||||
/* Setup Stack Data */
|
||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||
StackPtr->FileObject = PrimarySurface.VideoFileObject;
|
||||
StackPtr->Parameters.Write.Key = 0;
|
||||
|
||||
Status = IoCallDriver(DeviceObject, Irp);
|
||||
|
||||
if (STATUS_PENDING == Status)
|
||||
{
|
||||
KeWaitForSingleObject(&FileObject->Event, Executive, KernelMode, TRUE, 0);
|
||||
Status = Iosb.Status;
|
||||
}
|
||||
|
||||
return NT_SUCCESS(Status);
|
||||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
IntCreatePrimarySurface()
|
||||
{
|
||||
@@ -674,6 +729,11 @@ IntCreatePrimarySurface()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (! PrepareVideoPrt())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DPRINT("calling EnableSurface\n");
|
||||
/* Enable the drawing surface */
|
||||
PrimarySurface.Handle =
|
||||
|
@@ -1458,7 +1458,7 @@ NtGdiExtTextOut(
|
||||
FT_Face face;
|
||||
FT_GlyphSlot glyph;
|
||||
LONGLONG TextLeft, RealXStart;
|
||||
ULONG TextTop, pitch, previous, BackgroundLeft;
|
||||
ULONG TextTop, previous, BackgroundLeft;
|
||||
FT_Bool use_kerning;
|
||||
RECTL DestRect, MaskRect, SpecifiedDestRect;
|
||||
POINTL SourcePoint, BrushOrigin;
|
||||
@@ -1805,9 +1805,6 @@ NtGdiExtTextOut(
|
||||
DPRINT1("WARNING: Failed to render glyph!\n");
|
||||
goto fail;
|
||||
}
|
||||
pitch = glyph->bitmap.pitch;
|
||||
} else {
|
||||
pitch = glyph->bitmap.width;
|
||||
}
|
||||
|
||||
if (fuOptions & ETO_OPAQUE)
|
||||
@@ -1845,9 +1842,17 @@ NtGdiExtTextOut(
|
||||
* We should create the bitmap out of the loop at the biggest possible
|
||||
* glyph size. Then use memset with 0 to clear it and sourcerect to
|
||||
* limit the work of the transbitblt.
|
||||
*
|
||||
* FIXME: DIB bitmaps should have an lDelta which is a multiple of 4.
|
||||
* Here we pass in the pitch from the FreeType bitmap, which is not
|
||||
* guaranteed to be a multiple of 4. If it's not, we should expand
|
||||
* the FreeType bitmap to a temporary bitmap.
|
||||
*/
|
||||
|
||||
HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, BMF_TOPDOWN, glyph->bitmap.buffer);
|
||||
HSourceGlyph = EngCreateBitmap(bitSize, glyph->bitmap.pitch,
|
||||
(glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ?
|
||||
BMF_8BPP : BMF_1BPP, BMF_TOPDOWN,
|
||||
glyph->bitmap.buffer);
|
||||
if ( !HSourceGlyph )
|
||||
{
|
||||
DPRINT1("WARNING: EngLockSurface() failed!\n");
|
||||
|
@@ -7,4 +7,5 @@
|
||||
<library>gdi32</library>
|
||||
<file>main.c</file>
|
||||
<file>dialog.c</file>
|
||||
<file>winemine.rc</file>
|
||||
</module>
|
||||
|
Reference in New Issue
Block a user