ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
814 discussions
Start a n
N
ew thread
[gvg] 15299: user32 is becoming a big boy, give it some more space
by gvg@svn.reactos.com
user32 is becoming a big boy, give it some more space Modified: branches/xmlbuildsystem/reactos/baseaddress.xml _____ Modified: branches/xmlbuildsystem/reactos/baseaddress.xml --- branches/xmlbuildsystem/reactos/baseaddress.xml 2005-05-15 09:38:53 UTC (rev 15298) +++ branches/xmlbuildsystem/reactos/baseaddress.xml 2005-05-15 09:41:00 UTC (rev 15299) @@ -70,8 +70,8 @@ <property name="BASEADDRESS_OLE32" value="0x77a50000" /> <property name="BASEADDRESS_OLEPRO32" value="0x77aa0000" /> <property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" /> -<property name="BASEADDRESS_USER32" value="0x77e60000" /> -<property name="BASEADDRESS_GDI32" value="0x77ed0000" /> +<property name="BASEADDRESS_USER32" value="0x77e50000" /> +<property name="BASEADDRESS_GDI32" value="0x77ee0000" /> <property name="BASEADDRESS_DNSAPI" value="0x77f00000" /> <property name="BASEADDRESS_KERNEL32" value="0x77800000" /> <property name="BASEADDRESS_MSVCRT" value="0x78000000" />
19 years, 7 months
1
0
0
0
[gvg] 15298: Work around broken binutils which creates relocation
by gvg@svn.reactos.com
Work around broken binutils which creates relocation entries for the Export Table. Modified: branches/xmlbuildsystem/reactos/tools/rsym.c _____ Modified: branches/xmlbuildsystem/reactos/tools/rsym.c --- branches/xmlbuildsystem/reactos/tools/rsym.c 2005-05-15 09:30:25 UTC (rev 15297) +++ branches/xmlbuildsystem/reactos/tools/rsym.c 2005-05-15 09:38:53 UTC (rev 15298) @@ -407,6 +407,7 @@ { static char *BlacklistedSections[] = { + ".edata", ".idata", ".reloc" };
19 years, 7 months
1
0
0
0
[hpoussin] 15297: Open port before sending IOCTLs
by hpoussin@svn.reactos.com
Open port before sending IOCTLs Modified: trunk/reactos/drivers/bus/serenum/detect.c _____ Modified: trunk/reactos/drivers/bus/serenum/detect.c --- trunk/reactos/drivers/bus/serenum/detect.c 2005-05-15 09:29:30 UTC (rev 15296) +++ trunk/reactos/drivers/bus/serenum/detect.c 2005-05-15 09:30:25 UTC (rev 15297) @@ -62,6 +62,44 @@ } static NTSTATUS +SerenumSendIrp( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG MajorFunction) +{ + KEVENT Event; + PIRP Irp; + IO_STATUS_BLOCK IoStatus; + NTSTATUS Status; + + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + Irp = IoBuildSynchronousFsdRequest( + MajorFunction, + DeviceObject, + NULL, + 0, + NULL, + &Event, + &IoStatus); + if (Irp == NULL) + { + DPRINT("Serenum: IoBuildSynchronousFsdRequest() failed\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Status = IoCallDriver(DeviceObject, Irp); + + if (Status == STATUS_PENDING) + { + DPRINT("Serenum: Operation pending\n"); + KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); + Status = IoStatus.Status; + } + + return Status; +} + +static NTSTATUS ReadBytes( IN PDEVICE_OBJECT LowerDevice, OUT PUCHAR Buffer, @@ -224,91 +262,95 @@ SERIAL_TIMEOUTS Timeouts; SERIALPERF_STATS PerfStats; NTSTATUS Status; + + /* Open port */ + Status = SerenumSendIrp(LowerDevice, IRP_MJ_CREATE); + if (!NT_SUCCESS(Status)) goto ByeBye; /* 1. COM port initialization, check for device enumerate */ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; SerenumWait(200); Size = sizeof(Msr); Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_GET_MODEMSTATUS, NULL, 0, &Msr, &Size); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if ((Msr & SR_MSR_DSR) == 0) goto SerenumDisconnectIdle; /* 2. COM port setup, 1st phase */ CHECKPOINT; - BaudRate = SERIAL_BAUD_1200; + BaudRate = 1200; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE, &BaudRate, sizeof(BaudRate), NULL, 0); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Lcr.WordLength = 7; Lcr.Parity = NO_PARITY; Lcr.StopBits = STOP_BIT_1; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL, &Lcr, sizeof(Lcr), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; SerenumWait(200); Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; SerenumWait(200); /* 3. Wait for response, 1st phase */ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Timeouts.ReadIntervalTimeout = 0; Timeouts.ReadTotalTimeoutMultiplier = 0; Timeouts.ReadTotalTimeoutConstant = 200; Timeouts.WriteTotalTimeoutMultiplier = Timeouts.WriteTotalTimeoutConstant = 0; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS, &Timeouts, sizeof(Timeouts), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer), &Size); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if (Size != 0) goto SerenumCollectPnpComDeviceId; /* 4. COM port setup, 2nd phase */ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Purge = SERIAL_PURGE_RXABORT | SERIAL_PURGE_RXCLEAR; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_PURGE, &Purge, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; SerenumWait(200); /* 5. Wait for response, 2nd phase */ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = ReadBytes(LowerDevice, Buffer, 1, &TotalBytesReceived); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if (TotalBytesReceived != 0) goto SerenumCollectPnpComDeviceId; Size = sizeof(Msr); Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_GET_MODEMSTATUS, NULL, 0, &Msr, &Size); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if ((Msr & SR_MSR_DSR) == 0) goto SerenumVerifyDisconnect; else goto SerenumConnectIdle; /* 6. Collect PnP COM device ID */ @@ -319,14 +361,14 @@ Timeouts.ReadTotalTimeoutConstant = 2200; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS, &Timeouts, sizeof(Timeouts), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = ReadBytes(LowerDevice, &Buffer[TotalBytesReceived], sizeof(Buffer) - TotalBytesReceived, &Size); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; TotalBytesReceived += Size; Size = sizeof(PerfStats); Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_GET_STATS, NULL, 0, &PerfStats, &Size); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if (PerfStats.FrameErrorCount + PerfStats.ParityErrorCount != 0) goto SerenumConnectIdle; for (i = 0; i < TotalBytesReceived; i++) { @@ -336,7 +378,10 @@ if (TotalBytesReceived == 1 || BufferContainsEndId) { if (SerenumIsValidPnpIdString(Buffer, TotalBytesReceived)) - return ReportDetectedPnpDevice(Buffer, TotalBytesReceived); + { + Status = ReportDetectedPnpDevice(Buffer, TotalBytesReceived); + goto ByeBye; + } goto SerenumConnectIdle; } if (!BufferContainsBeginId) goto SerenumConnectIdle; @@ -344,7 +389,7 @@ Size = sizeof(Msr); Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_GET_MODEMSTATUS, NULL, 0, &Msr, &Size); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if ((Msr & SR_MSR_DSR) == 0) goto SerenumVerifyDisconnect; /* 7. Verify disconnect */ @@ -352,10 +397,10 @@ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; SerenumWait(5000); goto SerenumDisconnectIdle; @@ -364,24 +409,25 @@ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; - BaudRate = SERIAL_BAUD_300; + if (!NT_SUCCESS(Status)) goto ByeBye; + BaudRate = 300; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE, &BaudRate, sizeof(BaudRate), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Lcr.WordLength = 7; Lcr.Parity = NO_PARITY; Lcr.StopBits = STOP_BIT_1; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL, &Lcr, sizeof(Lcr), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; if (TotalBytesReceived == 0) - return STATUS_DEVICE_NOT_CONNECTED; + Status = STATUS_DEVICE_NOT_CONNECTED; else - return STATUS_SUCCESS; + Status = STATUS_SUCCESS; + goto ByeBye; /* 9. Disconnect idle */ SerenumDisconnectIdle: @@ -389,21 +435,27 @@ /* FIXME: report to OS device removal, if it was present */ Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; - BaudRate = SERIAL_BAUD_300; + if (!NT_SUCCESS(Status)) goto ByeBye; + BaudRate = 300; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE, &BaudRate, sizeof(BaudRate), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Lcr.WordLength = 7; Lcr.Parity = NO_PARITY; Lcr.StopBits = STOP_BIT_1; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL, &Lcr, sizeof(Lcr), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; - return STATUS_DEVICE_NOT_CONNECTED; + if (!NT_SUCCESS(Status)) goto ByeBye; + Status = STATUS_DEVICE_NOT_CONNECTED; + +ByeBye: + /* Close port */ + SerenumSendIrp(LowerDevice, IRP_MJ_CLOSE); + SerenumSendIrp(LowerDevice, IRP_MJ_CLEANUP); + return Status; } NTSTATUS @@ -429,13 +481,17 @@ LowerDevice); RtlZeroMemory(Buffer, sizeof(Buffer)); + + /* Open port */ + Status = SerenumSendIrp(LowerDevice, IRP_MJ_CREATE); + if (!NT_SUCCESS(Status)) goto ByeBye; /* Reset UART */ CHECKPOINT; Mcr = 0; /* MCR: DTR/RTS/OUT2 off */ Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL, &Mcr, sizeof(Mcr), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Set communications parameters */ CHECKPOINT; @@ -443,26 +499,26 @@ Fcr = 0; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_FIFO_CONTROL, &Fcr, sizeof(Fcr), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Set serial port speed */ - BaudRate = SERIAL_BAUD_1200; + BaudRate = 1200; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE, &BaudRate, sizeof(BaudRate), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Set LCR */ LCR.WordLength = 7; LCR.Parity = NO_PARITY; LCR.StopBits = STOP_BITS_2; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL, &LCR, sizeof(LCR), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Flush receive buffer */ CHECKPOINT; Command = SERIAL_PURGE_RXCLEAR; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL, &Command, sizeof(Command), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Wait 100 ms */ SerenumWait(100); @@ -470,10 +526,10 @@ CHECKPOINT; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS, NULL, 0, NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Set timeout to 500 microseconds */ CHECKPOINT; @@ -483,12 +539,12 @@ Timeouts.WriteTotalTimeoutMultiplier = Timeouts.WriteTotalTimeoutConstant = 0; Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS, &Timeouts, sizeof(Timeouts), NULL, NULL); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; /* Fill the read buffer */ CHECKPOINT; Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count); - if (!NT_SUCCESS(Status)) return Status; + if (!NT_SUCCESS(Status)) goto ByeBye; for (i = 0; i < Count; i++) { @@ -506,7 +562,7 @@ &DeviceDescription, &DeviceId, &HardwareIds, &CompatibleIds); RtlFreeUnicodeString(&HardwareIds); RtlFreeUnicodeString(&CompatibleIds); - return Status; + goto ByeBye; } else if (Buffer[i] == 'M') { @@ -514,7 +570,8 @@ if (i == sizeof(Buffer) - 1) { /* Overflow Error */ - return STATUS_DEVICE_NOT_CONNECTED; + Status = STATUS_DEVICE_NOT_CONNECTED; + goto ByeBye; } switch (Buffer[i + 1]) { @@ -539,9 +596,15 @@ &DeviceDescription, &DeviceId, &HardwareIds, &CompatibleIds); RtlFreeUnicodeString(&HardwareIds); RtlFreeUnicodeString(&CompatibleIds); - return Status; + goto ByeBye; } } - return STATUS_DEVICE_NOT_CONNECTED; + Status = STATUS_DEVICE_NOT_CONNECTED; + +ByeBye: + /* Close port */ + SerenumSendIrp(LowerDevice, IRP_MJ_CLOSE); + SerenumSendIrp(LowerDevice, IRP_MJ_CLEANUP); + return Status; }
19 years, 7 months
1
0
0
0
[hpoussin] 15296: Correct implementation of IOCTL_SERIAL_SET_BAUD_RATE
by hpoussin@svn.reactos.com
Correct implementation of IOCTL_SERIAL_SET_BAUD_RATE Don't test FileObject in IRP_MJ_CREATE as it may be not valid Modified: trunk/reactos/drivers/dd/serial/create.c Modified: trunk/reactos/drivers/dd/serial/devctrl.c Modified: trunk/reactos/drivers/dd/serial/pnp.c _____ Modified: trunk/reactos/drivers/dd/serial/create.c --- trunk/reactos/drivers/dd/serial/create.c 2005-05-15 08:30:35 UTC (rev 15295) +++ trunk/reactos/drivers/dd/serial/create.c 2005-05-15 09:29:30 UTC (rev 15296) @@ -17,17 +17,13 @@ IN PIRP Irp) { PIO_STACK_LOCATION Stack; - PFILE_OBJECT FileObject; PSERIAL_DEVICE_EXTENSION DeviceExtension; NTSTATUS Status; DPRINT("Serial: IRP_MJ_CREATE\n"); Stack = IoGetCurrentIrpStackLocation(Irp); - FileObject = Stack->FileObject; DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - ASSERT(FileObject); - if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE) { CHECKPOINT; @@ -35,14 +31,6 @@ goto ByeBye; } - if (FileObject->FileName.Length != 0 || - FileObject->RelatedFileObject != NULL) - { - CHECKPOINT; - Status = STATUS_ACCESS_DENIED; - goto ByeBye; - } - if(DeviceExtension->IsOpened) { DPRINT("Serial: COM%lu is already opened\n", DeviceExtension->ComPort); _____ Modified: trunk/reactos/drivers/dd/serial/devctrl.c --- trunk/reactos/drivers/dd/serial/devctrl.c 2005-05-15 08:30:35 UTC (rev 15295) +++ trunk/reactos/drivers/dd/serial/devctrl.c 2005-05-15 09:29:30 UTC (rev 15296) @@ -51,60 +51,29 @@ IN PSERIAL_DEVICE_EXTENSION DeviceExtension, IN ULONG NewBaudRate) { + ULONG BaudRate; USHORT divisor; PUCHAR ComPortBase = (PUCHAR)DeviceExtension->BaseAddress; - ULONG BaudRate; NTSTATUS Status = STATUS_SUCCESS; - if (NewBaudRate & SERIAL_BAUD_USER) - { - BaudRate = NewBaudRate & ~SERIAL_BAUD_USER; - divisor = (USHORT)(BAUD_CLOCK / (CLOCKS_PER_BIT * BaudRate)); - } - else - { - switch (NewBaudRate) - { - case SERIAL_BAUD_075: divisor = 0x600; BaudRate = 75; break; - case SERIAL_BAUD_110: divisor = 0x400; BaudRate = 110; break; - case SERIAL_BAUD_134_5: divisor = 0x360; BaudRate = 134; break; - case SERIAL_BAUD_150: divisor = 0x300; BaudRate = 150; break; - case SERIAL_BAUD_300: divisor = 0x180; BaudRate = 300; break; - case SERIAL_BAUD_600: divisor = 0xc0; BaudRate = 600; break; - case SERIAL_BAUD_1200: divisor = 0x60; BaudRate = 1200; break; - case SERIAL_BAUD_1800: divisor = 0x40; BaudRate = 1800; break; - case SERIAL_BAUD_2400: divisor = 0x30; BaudRate = 2400; break; - case SERIAL_BAUD_4800: divisor = 0x18; BaudRate = 4800; break; - case SERIAL_BAUD_7200: divisor = 0x10; BaudRate = 7200; break; - case SERIAL_BAUD_9600: divisor = 0xc; BaudRate = 9600; break; - case SERIAL_BAUD_14400: divisor = 0x8; BaudRate = 14400; break; - case SERIAL_BAUD_38400: divisor = 0x3; BaudRate = 38400; break; - case SERIAL_BAUD_57600: divisor = 0x2; BaudRate = 57600; break; - case SERIAL_BAUD_115200: divisor = 0x1; BaudRate = 115200; break; - case SERIAL_BAUD_56K: divisor = 0x2; BaudRate = 57600; break; - case SERIAL_BAUD_128K: divisor = 0x1; BaudRate = 115200; break; - default: Status = STATUS_INVALID_PARAMETER; - } - } + divisor = (USHORT)(BAUD_CLOCK / (CLOCKS_PER_BIT * NewBaudRate)); + BaudRate = BAUD_CLOCK / (CLOCKS_PER_BIT * divisor); + Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); if (NT_SUCCESS(Status)) { - Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); - if (NT_SUCCESS(Status)) - { - UCHAR Lcr; - DPRINT("Serial: SerialSetBaudRate(COM%lu, %lu Bauds)\n", DeviceExtension->ComPort, BaudRate); - /* Set Bit 7 of LCR to expose baud registers */ - Lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase)); - WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr | SR_LCR_DLAB); - /* Write the baud rate */ - WRITE_PORT_UCHAR(SER_DLL(ComPortBase), divisor & 0xff); - WRITE_PORT_UCHAR(SER_DLM(ComPortBase), divisor >> 8); - /* Switch back to normal registers */ - WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr); + UCHAR Lcr; + DPRINT("Serial: SerialSetBaudRate(COM%lu, %lu Bauds)\n", DeviceExtension->ComPort, BaudRate); + /* Set Bit 7 of LCR to expose baud registers */ + Lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase)); + WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr | SR_LCR_DLAB); + /* Write the baud rate */ + WRITE_PORT_UCHAR(SER_DLL(ComPortBase), divisor & 0xff); + WRITE_PORT_UCHAR(SER_DLM(ComPortBase), divisor >> 8); + /* Switch back to normal registers */ + WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr); - IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); - } + IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort); } if (NT_SUCCESS(Status)) @@ -244,16 +213,14 @@ | SERIAL_BAUD_150 | SERIAL_BAUD_300 | SERIAL_BAUD_600 | SERIAL_BAUD_1200 | SERIAL_BAUD_1800 | SERIAL_BAUD_2400 | SERIAL_BAUD_4800 | SERIAL_BAUD_7200 | SERIAL_BAUD_9600 | SERIAL_BAUD_USER; - pCommProp->MaxBaud = SERIAL_BAUD_9600; + pCommProp->MaxBaud = SERIAL_BAUD_USER; if (DeviceExtension->UartType >= Uart16450) { pCommProp->SettableBaud |= SERIAL_BAUD_14400 | SERIAL_BAUD_19200 | SERIAL_BAUD_38400; - pCommProp->MaxBaud = SERIAL_BAUD_38400; } if (DeviceExtension->UartType >= Uart16550) { pCommProp->SettableBaud |= SERIAL_BAUD_56K | SERIAL_BAUD_57600 | SERIAL_BAUD_115200 | SERIAL_BAUD_128K; - pCommProp->MaxBaud = SERIAL_BAUD_115200; } pCommProp->SettableData = SERIAL_DATABITS_5 | SERIAL_DATABITS_6 | SERIAL_DATABITS_7 | SERIAL_DATABITS_8; _____ Modified: trunk/reactos/drivers/dd/serial/pnp.c --- trunk/reactos/drivers/dd/serial/pnp.c 2005-05-15 08:30:35 UTC (rev 15295) +++ trunk/reactos/drivers/dd/serial/pnp.c 2005-05-15 09:29:30 UTC (rev 15296) @@ -154,7 +154,7 @@ ASSERT(DeviceExtension); ASSERT(DeviceExtension->PnpState == dsStopped); - DeviceExtension->BaudRate = 19200 | SERIAL_BAUD_USER; + DeviceExtension->BaudRate = 19200; DeviceExtension->BaseAddress = 0; Dirql = 0; for (i = 0; i < ResourceList->Count; i++) @@ -308,8 +308,33 @@ switch (MinorFunction) { - case IRP_MN_START_DEVICE: + /* FIXME: do all these minor functions + IRP_MN_QUERY_REMOVE_DEVICE 0x1 + IRP_MN_REMOVE_DEVICE 0x2 { + DPRINT("Serial: IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n"); + IoAcquireRemoveLock + IoReleaseRemoveLockAndWait + pass request to DeviceExtension-LowerDriver + disable interface + IoDeleteDevice(Fdo) and/or IoDetachDevice + break; + } + IRP_MN_CANCEL_REMOVE_DEVICE 0x3 + IRP_MN_STOP_DEVICE 0x4 + IRP_MN_QUERY_STOP_DEVICE 0x5 + IRP_MN_CANCEL_STOP_DEVICE 0x6 + IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations (optional) 0x7 + IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations (optional) 0x7 + IRP_MN_QUERY_INTERFACE (optional) 0x8 + IRP_MN_QUERY_CAPABILITIES (optional) 0x9 + IRP_MN_FILTER_RESOURCE_REQUIREMENTS (optional) 0xd + IRP_MN_QUERY_PNP_DEVICE_STATE (optional) 0x14 + IRP_MN_DEVICE_USAGE_NOTIFICATION (required or optional) 0x16 + IRP_MN_SURPRISE_REMOVAL 0x17 + */ + case IRP_MN_START_DEVICE: /* 0x0 */ + { BOOLEAN ConflictDetected; DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); @@ -355,29 +380,27 @@ Stack->Parameters.StartDevice.AllocatedResources); break; } - /* IRP_MN_QUERY_STOP_DEVICE (FIXME: required) */ - /* IRP_MN_STOP_DEVICE (FIXME: required) */ - /* IRP_MN_CANCEL_STOP_DEVICE (FIXME: required) */ - /* IRP_MN_QUERY_REMOVE_DEVICE (FIXME: required) */ - /* case IRP_MN_REMOVE_DEVICE (FIXME: required) */ - /*{ - DPRINT("Serial: IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n"); - IoAcquireRemoveLock - IoReleaseRemoveLockAndWait - pass request to DeviceExtension-LowerDriver - disable interface - IoDeleteDevice(Fdo) and/or IoDetachDevice + case IRP_MN_QUERY_DEVICE_RELATIONS: /* (optional) 0x7 */ + { + switch (Stack->Parameters.QueryDeviceRelations.Type) + { + case BusRelations: + { + DPRINT("Serial: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n"); + return ForwardIrpAndForget(DeviceObject, Irp); + } + case RemovalRelations: + { + DPRINT("Serial: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n"); + return ForwardIrpAndForget(DeviceObject, Irp); + } + default: + DPRINT1("Serial: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n", + Stack->Parameters.QueryDeviceRelations.Type); + return ForwardIrpAndForget(DeviceObject, Irp); + } break; - }*/ - /* IRP_MN_CANCEL_REMOVE_DEVICE (FIXME: required) */ - /* IRP_MN_SURPRISE_REMOVAL (FIXME: required) */ - /* IRP_MN_QUERY_CAPABILITIES (optional) */ - /* IRP_MN_QUERY_PNP_DEVICE_STATE (optional) */ - /* IRP_MN_FILTER_RESOURCE_REQUIREMENTS (optional) */ - /* IRP_MN_DEVICE_USAGE_NOTIFICATION (FIXME: required or optional ???) */ - /* IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations (optional) */ - /* IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations (optional) */ - /* IRP_MN_QUERY_INTERFACE (optional) */ + } default: { DPRINT1("Serial: unknown minor function 0x%x\n", MinorFunction);
19 years, 7 months
1
0
0
0
[gvg] 15295: Remove local definitions for stuff which is now
by gvg@svn.reactos.com
Remove local definitions for stuff which is now present in our headers Modified: trunk/reactos/lib/dinput/keyboard.c Modified: trunk/reactos/lib/dinput/mouse.c _____ Modified: trunk/reactos/lib/dinput/keyboard.c --- trunk/reactos/lib/dinput/keyboard.c 2005-05-15 06:49:01 UTC (rev 15294) +++ trunk/reactos/lib/dinput/keyboard.c 2005-05-15 08:30:35 UTC (rev 15295) @@ -38,14 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput); -//fast fix misning from mingw headers -#ifdef __REACTOS__ -#define LLKHF_EXTENDED (KF_EXTENDED >> 8) -#define LLKHF_INJECTED 0x00000010 -//#define LLKHF_ALTDOWN (KF_ALTDOWN >> 8) -#define LLKHF_UP (KF_UP >> 8) -#endif - #define WINE_DINPUT_KEYBOARD_MAX_KEYS 256 static IDirectInputDevice8AVtbl SysKeyboardAvt; _____ Modified: trunk/reactos/lib/dinput/mouse.c --- trunk/reactos/lib/dinput/mouse.c 2005-05-15 06:49:01 UTC (rev 15294) +++ trunk/reactos/lib/dinput/mouse.c 2005-05-15 08:30:35 UTC (rev 15295) @@ -40,13 +40,6 @@ #define MOUSE_HACK WINE_DEFAULT_DEBUG_CHANNEL(dinput); -typedef struct { - POINT pt; - DWORD mouseData; - DWORD flags; - DWORD time; - ULONG_PTR dwExtraInfo; -} MSLLHOOKSTRUCT, *PMSLLHOOKSTRUCT; /* Wine mouse driver object instances */ #define WINE_MOUSE_X_AXIS_INSTANCE 0
19 years, 7 months
1
0
0
0
[greatlrd] 15294: fix uninitialized waring so gcc 3.4.3 can compile it
by greatlrd@svn.reactos.com
fix uninitialized waring so gcc 3.4.3 can compile it Modified: trunk/reactos/ntoskrnl/ob/object.c _____ Modified: trunk/reactos/ntoskrnl/ob/object.c --- trunk/reactos/ntoskrnl/ob/object.c 2005-05-15 04:56:52 UTC (rev 15293) +++ trunk/reactos/ntoskrnl/ob/object.c 2005-05-15 06:49:01 UTC (rev 15294) @@ -666,7 +666,7 @@ UNICODE_STRING RemainingPath; POBJECT_HEADER Header; POBJECT_HEADER ParentHeader = NULL; - NTSTATUS Status; + NTSTATUS Status = 0; BOOLEAN ObjectAttached = FALSE; PWCHAR NamePtr; PSECURITY_DESCRIPTOR NewSecurityDescriptor = NULL;
19 years, 7 months
1
0
0
0
[ion] 15293: Removed incorrect Create/DuplicationNotify callbacks and replaced by a more correct Open callback which is what a windows driver would get. This is needed because of some changes I'm trying to make to get Parse routines to work properly, so I had to add two hacks for now, they will be removed within 2-3 commits
by ion@svn.reactos.com
Removed incorrect Create/DuplicationNotify callbacks and replaced by a more correct Open callback which is what a windows driver would get. This is needed because of some changes I'm trying to make to get Parse routines to work properly, so I had to add two hacks for now, they will be removed within 2-3 commits Modified: trunk/reactos/include/ddk/pstypes.h Modified: trunk/reactos/ntoskrnl/cm/cm.h Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c Modified: trunk/reactos/ntoskrnl/cm/registry.c Modified: trunk/reactos/ntoskrnl/cm/regobj.c Modified: trunk/reactos/ntoskrnl/ex/callback.c Modified: trunk/reactos/ntoskrnl/ex/event.c Modified: trunk/reactos/ntoskrnl/ex/evtpair.c Modified: trunk/reactos/ntoskrnl/ex/mutant.c Modified: trunk/reactos/ntoskrnl/ex/profile.c Modified: trunk/reactos/ntoskrnl/ex/sem.c Modified: trunk/reactos/ntoskrnl/ex/timer.c Modified: trunk/reactos/ntoskrnl/ex/win32k.c Modified: trunk/reactos/ntoskrnl/include/internal/ob.h Modified: trunk/reactos/ntoskrnl/io/driver.c Modified: trunk/reactos/ntoskrnl/io/iocomp.c Modified: trunk/reactos/ntoskrnl/io/iomgr.c Modified: trunk/reactos/ntoskrnl/ldr/init.c Modified: trunk/reactos/ntoskrnl/lpc/create.c Modified: trunk/reactos/ntoskrnl/lpc/port.c Modified: trunk/reactos/ntoskrnl/mm/section.c Modified: trunk/reactos/ntoskrnl/ob/dirobj.c Modified: trunk/reactos/ntoskrnl/ob/handle.c Modified: trunk/reactos/ntoskrnl/ob/namespc.c Modified: trunk/reactos/ntoskrnl/ob/object.c Modified: trunk/reactos/ntoskrnl/ob/symlink.c Modified: trunk/reactos/ntoskrnl/ps/job.c Modified: trunk/reactos/ntoskrnl/ps/psmgr.c Modified: trunk/reactos/ntoskrnl/ps/security.c Modified: trunk/reactos/ntoskrnl/ps/win32.c Modified: trunk/reactos/ntoskrnl/se/token.c Modified: trunk/reactos/subsys/win32k/include/desktop.h Modified: trunk/reactos/subsys/win32k/include/winsta.h Modified: trunk/reactos/subsys/win32k/main/dllmain.c Modified: trunk/reactos/subsys/win32k/ntuser/desktop.c Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c _____ Modified: trunk/reactos/include/ddk/pstypes.h --- trunk/reactos/include/ddk/pstypes.h 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/include/ddk/pstypes.h 2005-05-15 04:56:52 UTC (rev 15293) @@ -71,11 +71,20 @@ * Callbacks used for Win32 objects... this define won't be needed after the Object Manager * rewrite -- Alex */ + +/* TEMPORARY HACK */ typedef NTSTATUS STDCALL_FUNC (*OBJECT_CREATE_ROUTINE)(PVOID ObjectBody, PVOID Parent, PWSTR RemainingPath, struct _OBJECT_ATTRIBUTES* ObjectAttributes); + +typedef NTSTATUS STDCALL_FUNC +(*OBJECT_OPEN_ROUTINE)(ULONG Reason, + PVOID ObjectBody, + PEPROCESS Process, + ULONG HandleCount, + ACCESS_MASK GrantedAccess); typedef NTSTATUS STDCALL_FUNC (*OBJECT_PARSE_ROUTINE)(PVOID Object, @@ -93,7 +102,7 @@ ULONG Attributes); typedef struct _W32_OBJECT_CALLBACK { - OBJECT_CREATE_ROUTINE WinStaCreate; + OBJECT_OPEN_ROUTINE WinStaCreate; OBJECT_PARSE_ROUTINE WinStaParse; OBJECT_DELETE_ROUTINE WinStaDelete; OBJECT_FIND_ROUTINE WinStaFind; _____ Modified: trunk/reactos/ntoskrnl/cm/cm.h --- trunk/reactos/ntoskrnl/cm/cm.h 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/cm/cm.h 2005-05-15 04:56:52 UTC (rev 15293) @@ -489,12 +489,6 @@ IN OUT PWSTR *Path, IN ULONG Attribute); -NTSTATUS STDCALL -CmiObjectCreate(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes); - VOID STDCALL CmiObjectDelete(PVOID DeletedObject); _____ Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c --- trunk/reactos/ntoskrnl/cm/ntfunc.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/cm/ntfunc.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -225,13 +225,13 @@ if (Disposition) *Disposition = REG_OPENED_EXISTING_KEY; - Status = ObCreateHandle(PsGetCurrentProcess(), + Status = ObpCreateHandle(PsGetCurrentProcess(), Object, DesiredAccess, TRUE, KeyHandle); - DPRINT("ObCreateHandle failed Status 0x%x\n", Status); + DPRINT("ObpCreateHandle failed Status 0x%x\n", Status); ObDereferenceObject(Object); RtlFreeUnicodeString(&RemainingPath); return Status; @@ -1182,7 +1182,7 @@ goto openkey_cleanup; } - Status = ObCreateHandle(PsGetCurrentProcess(), + Status = ObpCreateHandle(PsGetCurrentProcess(), Object, DesiredAccess, TRUE, _____ Modified: trunk/reactos/ntoskrnl/cm/registry.c --- trunk/reactos/ntoskrnl/cm/registry.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/cm/registry.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -366,8 +366,6 @@ CmiKeyType->Security = CmiObjectSecurity; CmiKeyType->QueryName = CmiObjectQueryName; CmiKeyType->OkayToClose = NULL; - CmiKeyType->Create = CmiObjectCreate; - CmiKeyType->DuplicationNotify = NULL; RtlInitUnicodeString(&CmiKeyType->TypeName, L"Key"); ObpCreateTypeObject (CmiKeyType); _____ Modified: trunk/reactos/ntoskrnl/cm/regobj.c --- trunk/reactos/ntoskrnl/cm/regobj.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/cm/regobj.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -263,35 +263,6 @@ return(STATUS_SUCCESS); } - -NTSTATUS STDCALL -CmiObjectCreate(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - PKEY_OBJECT KeyObject = ObjectBody; - PWSTR Start; - - KeyObject->ParentKey = Parent; - if (RemainingPath) - { - Start = RemainingPath; - if(*Start == L'\\') - Start++; - RtlpCreateUnicodeString(&KeyObject->Name, - Start, NonPagedPool); - } - else - { - RtlInitUnicodeString(&KeyObject->Name, - NULL); - } - - return STATUS_SUCCESS; -} - - VOID STDCALL CmiObjectDelete(PVOID DeletedObject) { _____ Modified: trunk/reactos/ntoskrnl/ex/callback.c --- trunk/reactos/ntoskrnl/ex/callback.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/callback.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -65,9 +65,7 @@ ExCallbackObjectType->Parse = NULL; ExCallbackObjectType->Security = NULL; ExCallbackObjectType->QueryName = NULL; - ExCallbackObjectType->DuplicationNotify = NULL; ExCallbackObjectType->OkayToClose = NULL; - ExCallbackObjectType->Create = NULL; ExCallbackObjectType->Mapping = &ExpCallbackMapping; ExCallbackObjectType->NonpagedPoolCharge = sizeof(_INT_CALLBACK_OBJECT); Status = ObpCreateTypeObject(ExCallbackObjectType); _____ Modified: trunk/reactos/ntoskrnl/ex/event.c --- trunk/reactos/ntoskrnl/ex/event.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/event.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -55,8 +55,6 @@ ExEventObjectType->Security = NULL; ExEventObjectType->QueryName = NULL; ExEventObjectType->OkayToClose = NULL; - ExEventObjectType->Create = NULL; - ExEventObjectType->DuplicationNotify = NULL; ObpCreateTypeObject(ExEventObjectType); } _____ Modified: trunk/reactos/ntoskrnl/ex/evtpair.c --- trunk/reactos/ntoskrnl/ex/evtpair.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/evtpair.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -52,8 +52,6 @@ ExEventPairObjectType->Security = NULL; ExEventPairObjectType->QueryName = NULL; ExEventPairObjectType->OkayToClose = NULL; - ExEventPairObjectType->Create = NULL; - ExEventPairObjectType->DuplicationNotify = NULL; ObpCreateTypeObject(ExEventPairObjectType); } _____ Modified: trunk/reactos/ntoskrnl/ex/mutant.c --- trunk/reactos/ntoskrnl/ex/mutant.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/mutant.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -68,11 +68,10 @@ ExMutantObjectType->Close = NULL; ExMutantObjectType->Delete = ExpDeleteMutant; ExMutantObjectType->Parse = NULL; + ExMutantObjectType->Open = NULL; ExMutantObjectType->Security = NULL; ExMutantObjectType->QueryName = NULL; ExMutantObjectType->OkayToClose = NULL; - ExMutantObjectType->Create = NULL; - ExMutantObjectType->DuplicationNotify = NULL; ObpCreateTypeObject(ExMutantObjectType); } _____ Modified: trunk/reactos/ntoskrnl/ex/profile.c --- trunk/reactos/ntoskrnl/ex/profile.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/profile.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -94,10 +94,10 @@ ExProfileObjectType->Close = NULL; ExProfileObjectType->Delete = ExpDeleteProfile; ExProfileObjectType->Parse = NULL; + ExProfileObjectType->Open = NULL; ExProfileObjectType->Security = NULL; ExProfileObjectType->QueryName = NULL; ExProfileObjectType->OkayToClose = NULL; - ExProfileObjectType->Create = NULL; ObpCreateTypeObject(ExProfileObjectType); } _____ Modified: trunk/reactos/ntoskrnl/ex/sem.c --- trunk/reactos/ntoskrnl/ex/sem.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/sem.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -54,8 +54,6 @@ ExSemaphoreObjectType->Security = NULL; ExSemaphoreObjectType->QueryName = NULL; ExSemaphoreObjectType->OkayToClose = NULL; - ExSemaphoreObjectType->Create = NULL; - ExSemaphoreObjectType->DuplicationNotify = NULL; ObpCreateTypeObject(ExSemaphoreObjectType); } _____ Modified: trunk/reactos/ntoskrnl/ex/timer.c --- trunk/reactos/ntoskrnl/ex/timer.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/timer.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -244,10 +244,9 @@ ExTimerType->Delete = ExpDeleteTimer; ExTimerType->Parse = NULL; ExTimerType->Security = NULL; + ExTimerType->Open = NULL; ExTimerType->QueryName = NULL; ExTimerType->OkayToClose = NULL; - ExTimerType->Create = NULL; - ExTimerType->DuplicationNotify = NULL; ObpCreateTypeObject(ExTimerType); /* Initialize the Wait List and Lock */ _____ Modified: trunk/reactos/ntoskrnl/ex/win32k.c --- trunk/reactos/ntoskrnl/ex/win32k.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ex/win32k.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -39,7 +39,7 @@ DESKTOP_READOBJECTS | DESKTOP_SWITCHDESKTOP | DESKTOP_WRITEOBJECTS }; -OBJECT_CREATE_ROUTINE ExpWindowStationObjectCreate = NULL; +OBJECT_OPEN_ROUTINE ExpWindowStationObjectOpen = NULL; OBJECT_PARSE_ROUTINE ExpWindowStationObjectParse = NULL; OBJECT_DELETE_ROUTINE ExpWindowStationObjectDelete = NULL; OBJECT_FIND_ROUTINE ExpWindowStationObjectFind = NULL; @@ -50,16 +50,18 @@ NTSTATUS STDCALL -ExpWinStaObjectCreate(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - struct _OBJECT_ATTRIBUTES* ObjectAttributes) +ExpWinStaObjectOpen(OB_OPEN_REASON Reason, + PVOID ObjectBody, + PEPROCESS Process, + ULONG HandleCount, + ACCESS_MASK GrantedAccess) { /* Call the Registered Callback */ - return ExpWindowStationObjectCreate(ObjectBody, - Parent, - RemainingPath, - ObjectAttributes); + return ExpWindowStationObjectOpen(Reason, + ObjectBody, + Process, + HandleCount, + GrantedAccess); } VOID @@ -101,9 +103,9 @@ NTSTATUS STDCALL ExpDesktopCreate(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - struct _OBJECT_ATTRIBUTES* ObjectAttributes) + PVOID Parent, + PWSTR RemainingPath, + struct _OBJECT_ATTRIBUTES* ObjectAttributes) { /* Call the Registered Callback */ return ExpDesktopObjectCreate(ObjectBody, @@ -135,15 +137,13 @@ ExWindowStationObjectType->NonpagedPoolCharge = sizeof(WINSTATION_OBJECT); ExWindowStationObjectType->Mapping = &ExpWindowStationMapping; ExWindowStationObjectType->Dump = NULL; - ExWindowStationObjectType->Open = NULL; + ExWindowStationObjectType->Open = ExpWinStaObjectOpen; ExWindowStationObjectType->Close = NULL; ExWindowStationObjectType->Delete = ExpWinStaObjectDelete; ExWindowStationObjectType->Parse = ExpWinStaObjectParse; ExWindowStationObjectType->Security = NULL; ExWindowStationObjectType->QueryName = NULL; ExWindowStationObjectType->OkayToClose = NULL; - ExWindowStationObjectType->Create = ExpWinStaObjectCreate; - ExWindowStationObjectType->DuplicationNotify = NULL; RtlInitUnicodeString(&ExWindowStationObjectType->TypeName, L"WindowStation"); ObpCreateTypeObject(ExWindowStationObjectType); @@ -165,8 +165,7 @@ ExDesktopObjectType->Security = NULL; ExDesktopObjectType->QueryName = NULL; ExDesktopObjectType->OkayToClose = NULL; - ExDesktopObjectType->Create = ExpDesktopCreate; - ExDesktopObjectType->DuplicationNotify = NULL; + RtlInitUnicodeString(&ExDesktopObjectType->TypeName, L"Desktop"); ObpCreateTypeObject(ExDesktopObjectType); } _____ Modified: trunk/reactos/ntoskrnl/include/internal/ob.h --- trunk/reactos/ntoskrnl/include/internal/ob.h 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/include/internal/ob.h 2005-05-15 04:56:52 UTC (rev 15293) @@ -16,6 +16,15 @@ struct _EPROCESS; +typedef enum _OB_OPEN_REASON +{ + ObCreateHandle, + ObOpenHandle, + ObDuplicateHandle, + ObInheritHandle, + ObMaxOpenReason +} OB_OPEN_REASON; + typedef struct { CSHORT Type; @@ -78,12 +87,6 @@ */ VOID STDCALL_FUNC (*Dump)(VOID); - /* - * PURPOSE: Opens the object - * NOTE: To be defined - */ - VOID STDCALL_FUNC (*Open)(VOID); - /* * PURPOSE: Called to close an object if OkayToClose returns true */ @@ -136,14 +139,11 @@ */ VOID STDCALL_FUNC (*OkayToClose)(VOID); - NTSTATUS STDCALL_FUNC (*Create)(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - struct _OBJECT_ATTRIBUTES* ObjectAttributes); - - VOID STDCALL_FUNC (*DuplicationNotify)(PEPROCESS DuplicateTo, - PEPROCESS DuplicateFrom, - PVOID Object); + NTSTATUS STDCALL_FUNC (*Open)(OB_OPEN_REASON Reason, + PVOID ObjectBody, + PEPROCESS Process, + ULONG HandleCount, + ACCESS_MASK GrantedAccess); } OBJECT_TYPE; @@ -259,7 +259,7 @@ ObInitSymbolicLinkImplementation(VOID); -NTSTATUS ObCreateHandle(struct _EPROCESS* Process, +NTSTATUS ObpCreateHandle(struct _EPROCESS* Process, PVOID ObjectBody, ACCESS_MASK GrantedAccess, BOOLEAN Inherit, _____ Modified: trunk/reactos/ntoskrnl/io/driver.c --- trunk/reactos/ntoskrnl/io/driver.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/io/driver.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -80,13 +80,6 @@ /* DECLARATIONS ***************************************************************/ -NTSTATUS STDCALL -IopCreateDriver( - PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes); - VOID STDCALL IopDeleteDriver(PVOID ObjectBody); @@ -112,8 +105,6 @@ IoDriverObjectType->Security = NULL; IoDriverObjectType->QueryName = NULL; IoDriverObjectType->OkayToClose = NULL; - IoDriverObjectType->Create = IopCreateDriver; - IoDriverObjectType->DuplicationNotify = NULL; RtlInitUnicodeString(&IoDriverObjectType->TypeName, L"Driver"); ObpCreateTypeObject(IoDriverObjectType); @@ -138,46 +129,6 @@ return STATUS_INVALID_DEVICE_REQUEST; } -NTSTATUS STDCALL -IopCreateDriver( - PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - PDRIVER_OBJECT Object = ObjectBody; - ULONG i; - - DPRINT("IopCreateDriver(ObjectBody %x, Parent %x, RemainingPath %S)\n", - ObjectBody, Parent, RemainingPath); - - if (RemainingPath != NULL && wcschr(RemainingPath + 1, '\\') != NULL) - return STATUS_UNSUCCESSFUL; - - /* Create driver extension */ - Object->DriverExtension = (PDRIVER_EXTENSION) - ExAllocatePoolWithTag( - NonPagedPool, - sizeof(DRIVER_EXTENSION), - TAG_DRIVER_EXTENSION); - - if (Object->DriverExtension == NULL) - { - return STATUS_NO_MEMORY; - } - - RtlZeroMemory(Object->DriverExtension, sizeof(DRIVER_EXTENSION)); - - Object->Type = IO_TYPE_DRIVER; - - for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) - Object->MajorFunction[i] = IopInvalidDeviceRequest; - - Object->HardwareDatabase = &IopHardwareDatabaseKey; - - return STATUS_SUCCESS; -} - VOID STDCALL IopDeleteDriver(PVOID ObjectBody) { @@ -217,6 +168,7 @@ UNICODE_STRING DriverName; OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status; + ULONG i; PWSTR Buffer = NULL; DPRINT("IopCreateDriverObject(%p '%wZ' %x %p %x)\n", @@ -269,7 +221,28 @@ { return Status; } + + /* Create driver extension */ + Object->DriverExtension = (PDRIVER_EXTENSION) + ExAllocatePoolWithTag( + NonPagedPool, + sizeof(DRIVER_EXTENSION), + TAG_DRIVER_EXTENSION); + if (Object->DriverExtension == NULL) + { + return STATUS_NO_MEMORY; + } + + RtlZeroMemory(Object->DriverExtension, sizeof(DRIVER_EXTENSION)); + + Object->Type = IO_TYPE_DRIVER; + + for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) + Object->MajorFunction[i] = IopInvalidDeviceRequest; + + Object->HardwareDatabase = &IopHardwareDatabaseKey; + Object->DriverStart = DriverImageStart; Object->DriverSize = DriverImageSize; if (Buffer) _____ Modified: trunk/reactos/ntoskrnl/io/iocomp.c --- trunk/reactos/ntoskrnl/io/iocomp.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/io/iocomp.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -222,8 +222,6 @@ ExIoCompletionType->Security = NULL; ExIoCompletionType->QueryName = NULL; ExIoCompletionType->OkayToClose = NULL; - ExIoCompletionType->Create = NULL; - ExIoCompletionType->DuplicationNotify = NULL; } NTSTATUS _____ Modified: trunk/reactos/ntoskrnl/io/iomgr.c --- trunk/reactos/ntoskrnl/io/iomgr.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/io/iomgr.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -51,7 +51,7 @@ NPAGED_LOOKASIDE_LIST IoSmallIrpLookaside; /* INIT FUNCTIONS ************************************************************/ - + VOID INIT_FUNCTION IoInitCancelHandling(VOID) @@ -217,8 +217,6 @@ IoDeviceObjectType->Security = NULL; IoDeviceObjectType->QueryName = NULL; IoDeviceObjectType->OkayToClose = NULL; - IoDeviceObjectType->Create = NULL; - IoDeviceObjectType->DuplicationNotify = NULL; RtlInitUnicodeString(&IoDeviceObjectType->TypeName, L"Device"); @@ -246,8 +244,6 @@ IoFileObjectType->Security = IopSecurityFile; IoFileObjectType->QueryName = IopQueryNameFile; IoFileObjectType->OkayToClose = NULL; - IoFileObjectType->Create = IopCreateFile; - IoFileObjectType->DuplicationNotify = NULL; RtlInitUnicodeString(&IoFileObjectType->TypeName, L"File"); _____ Modified: trunk/reactos/ntoskrnl/ldr/init.c --- trunk/reactos/ntoskrnl/ldr/init.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ldr/init.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -89,7 +89,7 @@ L"\\SystemRoot\\system32\\smss.exe"); - Status = ObCreateHandle( + Status = ObpCreateHandle( PsGetCurrentProcess(), PsInitialSystemProcess, PROCESS_CREATE_PROCESS | PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION, _____ Modified: trunk/reactos/ntoskrnl/lpc/create.c --- trunk/reactos/ntoskrnl/lpc/create.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/lpc/create.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -62,38 +62,7 @@ return (STATUS_SUCCESS); } - /********************************************************************** - * NAME - * NiCreatePort/4 - * - * DESCRIPTION - * - * ARGUMENTS - * - * RETURN VALUE - */ -NTSTATUS STDCALL -NiCreatePort (PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - if (RemainingPath == NULL) - { - return (STATUS_SUCCESS); - } - - if (wcschr(RemainingPath+1, '\\') != NULL) - { - return (STATUS_UNSUCCESSFUL); - } - - return (STATUS_SUCCESS); -} - - -/********************************************************************** * NAME EXPORTED * NtCreatePort/5 * _____ Modified: trunk/reactos/ntoskrnl/lpc/port.c --- trunk/reactos/ntoskrnl/lpc/port.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/lpc/port.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -54,9 +54,8 @@ LpcPortObjectType->Parse = NULL; LpcPortObjectType->Security = NULL; LpcPortObjectType->QueryName = NULL; + LpcPortObjectType->Open = NULL; LpcPortObjectType->OkayToClose = NULL; - LpcPortObjectType->Create = NiCreatePort; - LpcPortObjectType->DuplicationNotify = NULL; ObpCreateTypeObject(LpcPortObjectType); _____ Modified: trunk/reactos/ntoskrnl/mm/section.c --- trunk/reactos/ntoskrnl/mm/section.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/mm/section.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -2068,27 +2068,6 @@ ObjectBody, HandleCount, ObGetObjectPointerCount(ObjectBody)); } -NTSTATUS STDCALL -MmpCreateSection(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - DPRINT("MmpCreateSection(ObjectBody %x, Parent %x, RemainingPath %S)\n", - ObjectBody, Parent, RemainingPath); - - if (RemainingPath == NULL) - { - return(STATUS_SUCCESS); - } - - if (wcschr(RemainingPath+1, L'\\') != NULL) - { - return(STATUS_UNSUCCESSFUL); - } - return(STATUS_SUCCESS); -} - NTSTATUS INIT_FUNCTION MmCreatePhysicalMemorySection(VOID) { @@ -2145,11 +2124,10 @@ MmSectionObjectType->Close = MmpCloseSection; MmSectionObjectType->Delete = MmpDeleteSection; MmSectionObjectType->Parse = NULL; + MmSectionObjectType->Open = NULL; MmSectionObjectType->Security = NULL; MmSectionObjectType->QueryName = NULL; MmSectionObjectType->OkayToClose = NULL; - MmSectionObjectType->Create = MmpCreateSection; - MmSectionObjectType->DuplicationNotify = NULL; /* * NOTE: Do not register the section object type here because _____ Modified: trunk/reactos/ntoskrnl/ob/dirobj.c --- trunk/reactos/ntoskrnl/ob/dirobj.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ob/dirobj.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -475,6 +475,7 @@ 0, 0, (PVOID*)&Directory); + if(NT_SUCCESS(Status)) { Status = ObInsertObject((PVOID)Directory, _____ Modified: trunk/reactos/ntoskrnl/ob/handle.c --- trunk/reactos/ntoskrnl/ob/handle.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ob/handle.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -459,11 +459,11 @@ ObjectType->Mapping); } } - Status = ObCreateHandle(TargetProcess, - ObjectBody, - DesiredAccess, - InheritHandle, - &hTarget); + Status = ObpCreateHandle(TargetProcess, + ObjectBody, + DesiredAccess, + InheritHandle, + &hTarget); ObDereferenceObject(ObjectBody); @@ -586,7 +586,7 @@ NTSTATUS -ObCreateHandle(PEPROCESS Process, +ObpCreateHandle(PEPROCESS Process, PVOID ObjectBody, ACCESS_MASK GrantedAccess, BOOLEAN Inherit, @@ -605,7 +605,7 @@ PAGED_CODE(); - DPRINT("ObCreateHandle(Process %x, obj %x)\n",Process,ObjectBody); + DPRINT("ObpCreateHandle(Process %x, obj %x)\n",Process,ObjectBody); ASSERT(Process); ASSERT(ObjectBody); @@ -941,7 +941,7 @@ Access = DesiredAccess; ObjectHeader = BODY_TO_HEADER(Object); - return(ObCreateHandle(PsGetCurrentProcess(), + return(ObpCreateHandle(PsGetCurrentProcess(), Object, Access, ObjectHeader->Inherit, _____ Modified: trunk/reactos/ntoskrnl/ob/namespc.c --- trunk/reactos/ntoskrnl/ob/namespc.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ob/namespc.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -159,7 +159,7 @@ return Status; } - Status = ObCreateHandle(PsGetCurrentProcess(), + Status = ObpCreateHandle(PsGetCurrentProcess(), Object, DesiredAccess, FALSE, @@ -238,6 +238,24 @@ KeReleaseSpinLock(&(Header->Parent->Lock),oldlvl); } +NTSTATUS +STDCALL +ObpCreateDirectory(OB_OPEN_REASON Reason, + PVOID ObjectBody, + PEPROCESS Process, + ULONG HandleCount, + ACCESS_MASK GrantedAccess) +{ + PDIRECTORY_OBJECT Directory = ObjectBody; + + if (Reason == ObCreateHandle) + { + InitializeListHead(&Directory->head); + KeInitializeSpinLock(&Directory->Lock); + } + + return STATUS_SUCCESS; +} PVOID ObpFindEntryDirectory(PDIRECTORY_OBJECT DirectoryObject, @@ -350,29 +368,6 @@ } -NTSTATUS STDCALL -ObpCreateDirectory(PVOID ObjectBody, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - PDIRECTORY_OBJECT DirectoryObject = (PDIRECTORY_OBJECT)ObjectBody; - - DPRINT("ObpCreateDirectory(ObjectBody %x, Parent %x, RemainingPath %S)\n", - ObjectBody, Parent, RemainingPath); - - if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL) - { - return(STATUS_UNSUCCESSFUL); - } - - InitializeListHead(&DirectoryObject->head); - KeInitializeSpinLock(&DirectoryObject->Lock); - - return(STATUS_SUCCESS); -} - - VOID INIT_FUNCTION ObInit(VOID) /* @@ -405,8 +400,7 @@ ObDirectoryType->Security = NULL; ObDirectoryType->QueryName = NULL; ObDirectoryType->OkayToClose = NULL; - ObDirectoryType->Create = ObpCreateDirectory; - ObDirectoryType->DuplicationNotify = NULL; + ObDirectoryType->Open = ObpCreateDirectory; RtlInitUnicodeString(&ObDirectoryType->TypeName, L"Directory"); @@ -430,8 +424,6 @@ ObTypeObjectType->Security = NULL; ObTypeObjectType->QueryName = NULL; ObTypeObjectType->OkayToClose = NULL; - ObTypeObjectType->Create = NULL; - ObTypeObjectType->DuplicationNotify = NULL; RtlInitUnicodeString(&ObTypeObjectType->TypeName, L"ObjectType"); _____ Modified: trunk/reactos/ntoskrnl/ob/object.c --- trunk/reactos/ntoskrnl/ob/object.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ob/object.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -22,7 +22,13 @@ POBJECT_HEADER ObjectHeader; } RETENTION_CHECK_PARAMS, *PRETENTION_CHECK_PARAMS; - +/* TEMPORARY HACK. DO NOT REMOVE -- Alex */ +NTSTATUS +STDCALL +ExpDesktopCreate(PVOID ObjectBody, + PVOID Parent, + PWSTR RemainingPath, + struct _OBJECT_ATTRIBUTES* ObjectAttributes); /* FUNCTIONS ************************************************************/ NTSTATUS @@ -733,6 +739,7 @@ RtlInitUnicodeString(&RemainingPath, NULL); } + DPRINT("Allocating memory\n"); Header = (POBJECT_HEADER)ExAllocatePoolWithTag(NonPagedPool, OBJECT_ALLOC_SIZE(ObjectSize), Type->Tag); @@ -786,14 +793,39 @@ ObjectAttached = TRUE; } - DPRINT("About to call Create Routine\n"); - if (Header->ObjectType->Create != NULL) - { - DPRINT("Calling %x\n", Header->ObjectType->Create); - Status = Header->ObjectType->Create(HEADER_TO_BODY(Header), - Parent, - RemainingPath.Buffer, - ObjectAttributes); + if ((Header->ObjectType == IoFileObjectType) || + (Header->ObjectType == ExDesktopObjectType) || + (Header->ObjectType->Open != NULL)) + { + DPRINT("About to call Open Routine\n"); + if (Header->ObjectType == IoFileObjectType) + { + /* TEMPORARY HACK. DO NOT TOUCH -- Alex */ + DPRINT("Calling IopCreateFile\n"); + Status = IopCreateFile(HEADER_TO_BODY(Header), + Parent, + RemainingPath.Buffer, + ObjectAttributes); + } + else if (Header->ObjectType == ExDesktopObjectType) + { + /* TEMPORARY HACK. DO NOT TOUCH -- Alex */ + DPRINT("Calling ExpDesktopCreate\n"); + Status = ExpDesktopCreate(HEADER_TO_BODY(Header), + Parent, + RemainingPath.Buffer, + ObjectAttributes); + } + else if (Header->ObjectType->Open != NULL) + { + DPRINT("Calling %x\n", Header->ObjectType->Open); + Status = Header->ObjectType->Open(ObCreateHandle, + HEADER_TO_BODY(Header), + NULL, + 0, + 0); + } + if (!NT_SUCCESS(Status)) { if (ObjectAttached == TRUE) @@ -810,7 +842,8 @@ DPRINT("Create Failed\n"); return Status; } - } + } + RtlFreeUnicodeString(&RemainingPath); SeCaptureSubjectContext(&SubjectContext); @@ -960,7 +993,7 @@ return Status; } - Status = ObCreateHandle(PsGetCurrentProcess(), + Status = ObpCreateHandle(PsGetCurrentProcess(), Object, DesiredAccess, (BOOLEAN)(HandleAttributes & OBJ_INHERIT), _____ Modified: trunk/reactos/ntoskrnl/ob/symlink.c --- trunk/reactos/ntoskrnl/ob/symlink.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ob/symlink.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -33,29 +33,6 @@ /********************************************************************** * NAME INTERNAL - * ObpCreateSymbolicLink - * - * DESCRIPTION - * - * ARGUMENTS - * - * RETURNN VALUE - * Status. - * - * REVISIONS - */ -NTSTATUS STDCALL -ObpCreateSymbolicLink(PVOID Object, - PVOID Parent, - PWSTR RemainingPath, - POBJECT_ATTRIBUTES ObjectAttributes) -{ - return(STATUS_SUCCESS); -} - - -/********************************************************************** - * NAME INTERNAL * ObpDeleteSymbolicLink * * DESCRIPTION @@ -175,10 +152,9 @@ ObSymbolicLinkType->Delete = ObpDeleteSymbolicLink; ObSymbolicLinkType->Parse = ObpParseSymbolicLink; ObSymbolicLinkType->Security = NULL; + ObSymbolicLinkType->Open = NULL; ObSymbolicLinkType->QueryName = NULL; ObSymbolicLinkType->OkayToClose = NULL; - ObSymbolicLinkType->Create = ObpCreateSymbolicLink; - ObSymbolicLinkType->DuplicationNotify = NULL; RtlInitUnicodeString(&ObSymbolicLinkType->TypeName, L"SymbolicLink"); _____ Modified: trunk/reactos/ntoskrnl/ps/job.c --- trunk/reactos/ntoskrnl/ps/job.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ps/job.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -78,8 +78,7 @@ PsJobType->Security = NULL; PsJobType->QueryName = NULL; PsJobType->OkayToClose = NULL; - PsJobType->Create = NULL; - PsJobType->DuplicationNotify = NULL; + PsJobType->Open = NULL; RtlInitUnicodeString(&PsJobType->TypeName, L"Job"); _____ Modified: trunk/reactos/ntoskrnl/ps/psmgr.c --- trunk/reactos/ntoskrnl/ps/psmgr.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ps/psmgr.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -97,8 +97,7 @@ PsThreadType->Security = NULL; PsThreadType->QueryName = NULL; PsThreadType->OkayToClose = NULL; - PsThreadType->Create = NULL; - PsThreadType->DuplicationNotify = NULL; + PsThreadType->Open = NULL; RtlInitUnicodeString(&PsThreadType->TypeName, L"Thread"); @@ -149,8 +148,7 @@ PsProcessType->Security = NULL; PsProcessType->QueryName = NULL; PsProcessType->OkayToClose = NULL; - PsProcessType->Create = NULL; - PsProcessType->DuplicationNotify = NULL; + PsProcessType->Open = NULL; RtlInitUnicodeString(&PsProcessType->TypeName, L"Process"); _____ Modified: trunk/reactos/ntoskrnl/ps/security.c --- trunk/reactos/ntoskrnl/ps/security.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ps/security.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -99,7 +99,7 @@ &Token); if(NT_SUCCESS(Status)) { - Status = ObCreateHandle(PsGetCurrentProcess(), + Status = ObpCreateHandle(PsGetCurrentProcess(), Token, DesiredAccess, FALSE, _____ Modified: trunk/reactos/ntoskrnl/ps/win32.c --- trunk/reactos/ntoskrnl/ps/win32.c 2005-05-14 22:55:21 UTC (rev 15292) +++ trunk/reactos/ntoskrnl/ps/win32.c 2005-05-15 04:56:52 UTC (rev 15293) @@ -21,7 +21,7 @@ static ULONG PspWin32ProcessSize = 0; static ULONG PspWin32ThreadSize = 0; -extern OBJECT_CREATE_ROUTINE ExpWindowStationObjectCreate; +extern OBJECT_OPEN_ROUTINE ExpWindowStationObjectOpen; extern OBJECT_PARSE_ROUTINE ExpWindowStationObjectParse; extern OBJECT_DELETE_ROUTINE ExpWindowStationObjectDelete; extern OBJECT_FIND_ROUTINE ExpWindowStationObjectFind; @@ -92,7 +92,7 @@ [truncated at 1000 lines; 230 more skipped]
19 years, 7 months
1
0
0
0
[chorns] 15292: Generate files for host zlib in object and output directories
by chorns@svn.reactos.com
Generate files for host zlib in object and output directories Modified: branches/xmlbuildsystem/reactos/lib/zlib/zlib.mak _____ Modified: branches/xmlbuildsystem/reactos/lib/zlib/zlib.mak --- branches/xmlbuildsystem/reactos/lib/zlib/zlib.mak 2005-05-14 21:35:54 UTC (rev 15291) +++ branches/xmlbuildsystem/reactos/lib/zlib/zlib.mak 2005-05-14 22:55:21 UTC (rev 15292) @@ -1,11 +1,15 @@ ZLIB_BASE = $(LIB_BASE_)zlib ZLIB_BASE_ = $(ZLIB_BASE)$(SEP) - ZLIB_INT = $(INTERMEDIATE_)$(ZLIB_BASE) +ZLIB_INT_ = $(INTERMEDIATE_)$(ZLIB_BASE)$(SEP) ZLIB_OUT = $(OUTPUT_)$(ZLIB_BASE) +ZLIB_OUT_ = $(OUTPUT_)$(ZLIB_BASE)$(SEP) -#$(ZLIB_INT): $(INTERMEDIATE_NO_SLASH) $(RMKDIR_TARGET) -# ${mkdir} $(INTERMEDIATE)$(ZLIB_BASE) +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(ZLIB_OUT): | $(OUTPUT_)$(LIB_BASE) + $(ECHO_MKDIR) + ${mkdir} $@ +endif ZLIB_HOST_TARGET = \ $(ZLIB_OUT)$(SEP)zlib.host.a @@ -28,22 +32,74 @@ ) ZLIB_HOST_OBJECTS = \ - $(ZLIB_HOST_SOURCES:.c=.o) + $(addprefix $(INTERMEDIATE_), $(ZLIB_HOST_SOURCES:.c=.host.o)) ZLIB_HOST_CFLAGS = -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -Wstrict-prototypes -Wmissing-prototypes -.PHONY: zlib_host -zlib_host: $(ZLIB_HOST_TARGET) - -$(ZLIB_HOST_TARGET): $(ZLIB_HOST_OBJECTS) $(ZLIB_OUT) +$(ZLIB_HOST_TARGET): $(ZLIB_HOST_OBJECTS) | $(ZLIB_OUT) $(ECHO_AR) $(host_ar) -r $@ $(ZLIB_HOST_OBJECTS) -$(ZLIB_HOST_OBJECTS): %.o : %.c $(ZLIB_BASE_DIR) +$(ZLIB_INT_)adler32.host.o: $(ZLIB_BASE_)adler32.c | $(ZLIB_INT) $(ECHO_CC) ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ +$(ZLIB_INT_)compress.host.o: $(ZLIB_BASE_)compress.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)crc32.host.o: $(ZLIB_BASE_)crc32.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)gzio.host.o: $(ZLIB_BASE_)gzio.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)uncompr.host.o: $(ZLIB_BASE_)uncompr.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)deflate.host.o: $(ZLIB_BASE_)deflate.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)trees.host.o: $(ZLIB_BASE_)trees.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)zutil.host.o: $(ZLIB_BASE_)zutil.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)inflate.host.o: $(ZLIB_BASE_)inflate.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)infblock.host.o: $(ZLIB_BASE_)infblock.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)inftrees.host.o: $(ZLIB_BASE_)inftrees.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)infcodes.host.o: $(ZLIB_BASE_)infcodes.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)infutil.host.o: $(ZLIB_BASE_)infutil.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +$(ZLIB_INT_)inffast.host.o: $(ZLIB_BASE_)inffast.c | $(ZLIB_INT) + $(ECHO_CC) + ${host_gcc} $(ZLIB_HOST_CFLAGS) -c $< -o $@ + +.PHONY: zlib_host +zlib_host: $(ZLIB_HOST_TARGET) + .PHONY: zlib_host_clean zlib_host_clean: -@$(rm) $(ZLIB_HOST_TARGET) $(ZLIB_HOST_OBJECTS) 2>$(NUL)
19 years, 7 months
1
0
0
0
[gvg] 15291: Don't include standard startup code
by gvg@svn.reactos.com
Don't include standard startup code Modified: branches/xmlbuildsystem/reactos/lib/gdi32/gdi32.xml Modified: branches/xmlbuildsystem/reactos/lib/user32/user32.xml _____ Modified: branches/xmlbuildsystem/reactos/lib/gdi32/gdi32.xml --- branches/xmlbuildsystem/reactos/lib/gdi32/gdi32.xml 2005-05-14 20:57:23 UTC (rev 15290) +++ branches/xmlbuildsystem/reactos/lib/gdi32/gdi32.xml 2005-05-14 21:35:54 UTC (rev 15291) @@ -36,5 +36,8 @@ <file>text.c</file> <file>utils.c</file> </directory> + <linkerflag>-lgcc</linkerflag> + <linkerflag>-nostartfiles</linkerflag> + <linkerflag>-nostdlib</linkerflag> <file>gdi32.rc</file> </module> _____ Modified: branches/xmlbuildsystem/reactos/lib/user32/user32.xml --- branches/xmlbuildsystem/reactos/lib/user32/user32.xml 2005-05-14 20:57:23 UTC (rev 15290) +++ branches/xmlbuildsystem/reactos/lib/user32/user32.xml 2005-05-14 21:35:54 UTC (rev 15291) @@ -74,5 +74,8 @@ <file>window.c</file> <file>winpos.c</file> </directory> + <linkerflag>-lgcc</linkerflag> + <linkerflag>-nostartfiles</linkerflag> + <linkerflag>-nostdlib</linkerflag> <file>user32.rc</file> </module>
19 years, 7 months
1
0
0
0
[greatlrd] 15290: fix Warining msg used uninitialized for gcc 3.4.3
by greatlrd@svn.reactos.com
fix Warining msg used uninitialized for gcc 3.4.3 Modified: trunk/reactos/subsys/win32k/ntuser/callback.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/callback.c --- trunk/reactos/subsys/win32k/ntuser/callback.c 2005-05-14 20:07:51 UTC (rev 15289) +++ trunk/reactos/subsys/win32k/ntuser/callback.c 2005-05-14 20:57:23 UTC (rev 15290) @@ -264,11 +264,11 @@ PVOID ResultPointer; ULONG ResultLength; PHOOKPROC_CALLBACK_ARGUMENTS Common; - CBT_CREATEWNDW *CbtCreateWnd; + CBT_CREATEWNDW *CbtCreateWnd =NULL; PCHAR Extra; - PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra; - PUNICODE_STRING WindowName; - PUNICODE_STRING ClassName; + PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra ; + PUNICODE_STRING WindowName = NULL; + PUNICODE_STRING ClassName = NULL; ArgumentLength = sizeof(HOOKPROC_CALLBACK_ARGUMENTS) - sizeof(WCHAR) + ModuleName->Length;
19 years, 7 months
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
82
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200