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
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
June 2005
----- 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
22 participants
649 discussions
Start a n
N
ew thread
[hpoussin] 16139: Implement IOCTL_USB_GET_NODE_CONNECTION_NAME, IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME
by hpoussin@svn.reactos.com
Implement IOCTL_USB_GET_NODE_CONNECTION_NAME, IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME Fix indices in IOCTL_USB_GET_NODE_CONNECTION_INFORMATION Modified: trunk/reactos/drivers/usb/cromwell/hub/fdo.c Modified: trunk/reactos/drivers/usb/cromwell/hub/pdo.c Modified: trunk/reactos/drivers/usb/cromwell/hub/usbhub.h _____ Modified: trunk/reactos/drivers/usb/cromwell/hub/fdo.c --- trunk/reactos/drivers/usb/cromwell/hub/fdo.c 2005-06-20 05:36:32 UTC (rev 16138) +++ trunk/reactos/drivers/usb/cromwell/hub/fdo.c 2005-06-20 05:54:19 UTC (rev 16139) @@ -7,6 +7,7 @@ * PROGRAMMERS: HervÚ Poussineau (hpoussin(a)reactos.com) */ +#define INITGUID #define NDEBUG #include "usbhub.h" @@ -117,7 +118,7 @@ sprintf(Buffer[0], "USB\\Vid_%04x&Pid_%04x&Rev_%04x", PdoExtension->dev->descriptor.idVendor, PdoExtension->dev->descriptor.idProduct, - 0 /* FIXME: need to put the revision */); + PdoExtension->dev->descriptor.bcdDevice); sprintf(Buffer[1], "USB\\Vid_%04x&Pid_%04x", PdoExtension->dev->descriptor.idVendor, PdoExtension->dev->descriptor.idProduct); @@ -293,19 +294,47 @@ } case IOCTL_USB_GET_NODE_CONNECTION_NAME: { + PHUB_DEVICE_EXTENSION DeviceExtension; PUSB_NODE_CONNECTION_NAME ConnectionName; + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + ConnectionName = (PUSB_NODE_CONNECTION_NAME)BufferOut; DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME\n"); if (LengthOut < sizeof(USB_NODE_CONNECTION_NAME)) Status = STATUS_BUFFER_TOO_SMALL; + else if (BufferOut == NULL) + Status = STATUS_INVALID_PARAMETER; + else if (ConnectionName->ConnectionIndex < 1 + || ConnectionName->ConnectionIndex > USB_MAXCHILDREN) + Status = STATUS_INVALID_PARAMETER; + else if (DeviceExtension->Children[ConnectionName->ConnectionIndex - 1] == NULL) + Status = STATUS_INVALID_PARAMETER; else { - ConnectionName = (PUSB_NODE_CONNECTION_NAME)BufferOut; - DPRINT1("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME unimplemented\n"); - ConnectionName->ActualLength = 0; - ConnectionName->NodeName[0] = UNICODE_NULL; - Information = sizeof(USB_NODE_CONNECTION_NAME); - Status = STATUS_SUCCESS; + ULONG NeededStructureSize; + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceExtension->Children[ConnectionName->Connect ionIndex - 1]->DeviceExtension; + NeededStructureSize = DeviceExtension->SymbolicLinkName.Length + sizeof(UNICODE_NULL) + FIELD_OFFSET(USB_NODE_CONNECTION_NAME, NodeName); + if (ConnectionName->ActualLength < NeededStructureSize / sizeof(WCHAR) + || LengthOut < NeededStructureSize) + { + /* Buffer too small */ + ConnectionName->ActualLength = NeededStructureSize / sizeof(WCHAR); + Information = sizeof(USB_NODE_CONNECTION_NAME); + Status = STATUS_BUFFER_TOO_SMALL; + } + else + { + RtlCopyMemory( + ConnectionName->NodeName, + DeviceExtension->SymbolicLinkName.Buffer, + DeviceExtension->SymbolicLinkName.Length); + ConnectionName->NodeName[DeviceExtension->SymbolicLinkName.Length / sizeof(WCHAR)] = UNICODE_NULL; + DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_NAME returns '%S'\n", ConnectionName->NodeName); + ConnectionName->ActualLength = NeededStructureSize / sizeof(WCHAR); + Information = NeededStructureSize; + Status = STATUS_SUCCESS; + } + Information = LengthOut; } break; } @@ -313,23 +342,29 @@ { PUSB_NODE_CONNECTION_INFORMATION ConnectionInformation; struct usb_device* dev; - //ULONG i; + ConnectionInformation = (PUSB_NODE_CONNECTION_INFORMATION)BufferOut; DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_INFORMATION\n"); if (LengthOut < sizeof(USB_NODE_CONNECTION_INFORMATION)) Status = STATUS_BUFFER_TOO_SMALL; else if (BufferOut == NULL) Status = STATUS_INVALID_PARAMETER; + else if (ConnectionInformation->ConnectionIndex < 1 + || ConnectionInformation->ConnectionIndex > USB_MAXCHILDREN) + Status = STATUS_INVALID_PARAMETER; else { - ConnectionInformation = (PUSB_NODE_CONNECTION_INFORMATION)BufferOut; DPRINT1("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_INFORMATION partially implemented\n"); dev = ((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->dev; - dev = dev->children[ConnectionInformation->ConnectionIndex = 0]; + dev = dev->children[ConnectionInformation->ConnectionIndex - 1]; if (dev == NULL) { /* No device connected to this port */ - RtlZeroMemory(ConnectionInformation, sizeof(USB_NODE_CONNECTION_INFORMATION)); + RtlZeroMemory( + &ConnectionInformation->DeviceDescriptor, + sizeof(USB_NODE_CONNECTION_INFORMATION) - FIELD_OFFSET(USB_NODE_CONNECTION_INFORMATION, DeviceDescriptor)); + ConnectionInformation->ConnectionStatus = NoDeviceConnected; + Information = sizeof(USB_NODE_CONNECTION_INFORMATION); Status = STATUS_SUCCESS; break; } @@ -366,6 +401,41 @@ Status = STATUS_NOT_IMPLEMENTED; break; } + case IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME: + { + PHUB_DEVICE_EXTENSION DeviceExtension; + PUSB_NODE_CONNECTION_DRIVERKEY_NAME StringDescriptor; + DPRINT("Usbhub: IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME\n"); + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + StringDescriptor = (PUSB_NODE_CONNECTION_DRIVERKEY_NAME)BufferOut; + if (LengthOut < sizeof(USB_NODE_CONNECTION_DRIVERKEY_NAME)) + Status = STATUS_BUFFER_TOO_SMALL; + else if (StringDescriptor == NULL) + Status = STATUS_INVALID_PARAMETER; + else if (StringDescriptor->ConnectionIndex < 1 + || StringDescriptor->ConnectionIndex > USB_MAXCHILDREN) + Status = STATUS_INVALID_PARAMETER; + else if (DeviceExtension->Children[StringDescriptor->ConnectionIndex - 1] == NULL) + Status = STATUS_INVALID_PARAMETER; + else + { + ULONG StringSize; + Status = IoGetDeviceProperty( + DeviceExtension->Children[StringDescriptor->ConnectionIndex - 1], + DevicePropertyDriverKeyName, + LengthOut - FIELD_OFFSET(USB_NODE_CONNECTION_DRIVERKEY_NAME, DriverKeyName), + StringDescriptor->DriverKeyName, + &StringSize); + if (NT_SUCCESS(Status) || Status == STATUS_BUFFER_TOO_SMALL) + { + DPRINT("Usbhub: IOCTL_GET_HCD_DRIVERKEY_NAME returns '%S'\n", StringDescriptor->DriverKeyName); + StringDescriptor->ActualLength = StringSize + FIELD_OFFSET(USB_NODE_CONNECTION_DRIVERKEY_NAME, DriverKeyName); + Information = LengthOut; + Status = STATUS_SUCCESS; + } + } + break; + } default: { /* Pass Irp to lower driver */ _____ Modified: trunk/reactos/drivers/usb/cromwell/hub/pdo.c --- trunk/reactos/drivers/usb/cromwell/hub/pdo.c 2005-06-20 05:36:32 UTC (rev 16138) +++ trunk/reactos/drivers/usb/cromwell/hub/pdo.c 2005-06-20 05:54:19 UTC (rev 16139) @@ -7,7 +7,7 @@ * PROGRAMMERS: HervÚ Poussineau (hpoussin(a)reactos.com) */ -//#define NDEBUG +#define NDEBUG #include <stdio.h> #include "usbhub.h" @@ -44,6 +44,42 @@ } static NTSTATUS +UsbhubPdoStartDevice( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PHUB_DEVICE_EXTENSION DeviceExtension; + NTSTATUS Status; + + DeviceExtension = (PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + DbgBreakPoint(); + + /* Register device interface */ + /* FIXME: when should we activate this interface? */ + Status = IoRegisterDeviceInterface( + DeviceObject, + DeviceExtension->dev->descriptor.bDeviceClass == USB_CLASS_HUB ? + &GUID_DEVINTERFACE_USB_HUB : + &GUID_DEVINTERFACE_USB_DEVICE, + NULL, /* Reference string */ + &DeviceExtension->SymbolicLinkName); + if (!NT_SUCCESS(Status)) + { + DPRINT("Usbhub: IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status); + return Status; + } + + Status = IoSetDeviceInterfaceState(&DeviceExtension->SymbolicLinkName, TRUE); + if (!NT_SUCCESS(Status)) + { + DPRINT("Usbhub: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status); + return Status; + } + + return STATUS_SUCCESS; +} + +static NTSTATUS UsbhubPdoQueryId( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, @@ -111,6 +147,12 @@ switch (MinorFunction) { + case IRP_MN_START_DEVICE: /* 0x0 */ + { + DPRINT("Usbhub: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); + Status = UsbhubPdoStartDevice(DeviceObject, Irp); + break; + } case IRP_MN_QUERY_ID: /* 0x13 */ { Status = UsbhubPdoQueryId(DeviceObject, Irp, &Information); _____ Modified: trunk/reactos/drivers/usb/cromwell/hub/usbhub.h --- trunk/reactos/drivers/usb/cromwell/hub/usbhub.h 2005-06-20 05:36:32 UTC (rev 16138) +++ trunk/reactos/drivers/usb/cromwell/hub/usbhub.h 2005-06-20 05:54:19 UTC (rev 16139) @@ -28,6 +28,7 @@ UNICODE_STRING InstanceId; // REG_SZ UNICODE_STRING HardwareIds; // REG_MULTI_SZ UNICODE_STRING CompatibleIds; // REG_MULTI_SZ + UNICODE_STRING SymbolicLinkName; } HUB_DEVICE_EXTENSION, *PHUB_DEVICE_EXTENSION; /* createclose.c */
19 years, 6 months
1
0
0
0
[ion] 16138: Major cleanup to rtlfuncs.h. Not yet perfect but much better organized.
by ion@svn.reactos.com
Major cleanup to rtlfuncs.h. Not yet perfect but much better organized. Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/lib/kernel32/k32.h Modified: trunk/reactos/lib/kernel32/misc/lzexpand_main.c _____ Modified: trunk/reactos/include/ndk/rtlfuncs.h --- trunk/reactos/include/ndk/rtlfuncs.h 2005-06-20 05:11:48 UTC (rev 16137) +++ trunk/reactos/include/ndk/rtlfuncs.h 2005-06-20 05:36:32 UTC (rev 16138) @@ -9,226 +9,118 @@ #ifndef _RTLFUNCS_H #define _RTLFUNCS_H +/* DEPENDENCIES **************************************************************/ #include <ndk/rtltypes.h> #include <ndk/pstypes.h> +/* PROTOTYPES ****************************************************************/ + /* FIXME: FILE NEEDS TO BE CLEANED UP AT THE END WHEN ALL THE FUNCTIONS HAVE BEEN ADDED */ -/* - * VOID - * InitializeListHead ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: Initializes a double linked list - * ARGUMENTS: - * ListHead = Caller supplied storage for the head of the list - */ -static __inline VOID +/* List Macros */ +static __inline +VOID InitializeListHead( - IN PLIST_ENTRY ListHead) + IN PLIST_ENTRY ListHead) { - ListHead->Flink = ListHead->Blink = ListHead; + ListHead->Flink = ListHead->Blink = ListHead; } - -/* - * VOID - * InsertHeadList ( - * PLIST_ENTRY ListHead, - * PLIST_ENTRY Entry - * ); - * - * FUNCTION: Inserts an entry in a double linked list - * ARGUMENTS: - * ListHead = Head of the list - * Entry = Entry to insert - */ -static __inline VOID +static __inline +VOID InsertHeadList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY Entry) + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY Entry) { - PLIST_ENTRY OldFlink; - OldFlink = ListHead->Flink; - Entry->Flink = OldFlink; - Entry->Blink = ListHead; - OldFlink->Blink = Entry; - ListHead->Flink = Entry; + PLIST_ENTRY OldFlink; + OldFlink = ListHead->Flink; + Entry->Flink = OldFlink; + Entry->Blink = ListHead; + OldFlink->Blink = Entry; + ListHead->Flink = Entry; } - -/* - * VOID - * InsertTailList ( - * PLIST_ENTRY ListHead, - * PLIST_ENTRY Entry - * ); - * - * FUNCTION: - * Inserts an entry in a double linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * Entry = Entry to insert - */ -static __inline VOID +static __inline +VOID InsertTailList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY Entry) + IN PLIST_ENTRY ListHead, + IN PLIST_ENTRY Entry) { - PLIST_ENTRY OldBlink; - OldBlink = ListHead->Blink; - Entry->Flink = ListHead; - Entry->Blink = OldBlink; - OldBlink->Flink = Entry; - ListHead->Blink = Entry; + PLIST_ENTRY OldBlink; + OldBlink = ListHead->Blink; + Entry->Flink = ListHead; + Entry->Blink = OldBlink; + OldBlink->Flink = Entry; + ListHead->Blink = Entry; } -/* - * BOOLEAN - * IsListEmpty ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Checks if a double linked list is empty - * - * ARGUMENTS: - * ListHead = Head of the list -*/ #define IsListEmpty(ListHead) \ - ((ListHead)->Flink == (ListHead)) + ((ListHead)->Flink == (ListHead)) - -/* - * PSINGLE_LIST_ENTRY - * PopEntryList ( - * PSINGLE_LIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Removes an entry from the head of a single linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * - * RETURNS: - * The removed entry - */ #define PopEntryList(ListHead) \ - (ListHead)->Next; \ - { \ - PSINGLE_LIST_ENTRY _FirstEntry; \ - _FirstEntry = (ListHead)->Next; \ - if (_FirstEntry != NULL) \ - (ListHead)->Next = _FirstEntry->Next; \ - } + (ListHead)->Next; \ + { \ + PSINGLE_LIST_ENTRY _FirstEntry; \ + _FirstEntry = (ListHead)->Next; \ + if (_FirstEntry != NULL) \ + (ListHead)->Next = _FirstEntry->Next; \ + } #define PushEntryList(_ListHead, _Entry) \ - (_Entry)->Next = (_ListHead)->Next; \ - (_ListHead)->Next = (_Entry); \ + (_Entry)->Next = (_ListHead)->Next; \ + (_ListHead)->Next = (_Entry); \ -/* - *BOOLEAN - *RemoveEntryList ( - * PLIST_ENTRY Entry - * ); - * - * FUNCTION: - * Removes an entry from a double linked list - * - * ARGUMENTS: - * ListEntry = Entry to remove - */ -static __inline BOOLEAN +static __inline +BOOLEAN RemoveEntryList( - IN PLIST_ENTRY Entry) + IN PLIST_ENTRY Entry) { - PLIST_ENTRY OldFlink; - PLIST_ENTRY OldBlink; + PLIST_ENTRY OldFlink; + PLIST_ENTRY OldBlink; - OldFlink = Entry->Flink; - OldBlink = Entry->Blink; - OldFlink->Blink = OldBlink; - OldBlink->Flink = OldFlink; - return (OldFlink == OldBlink); + OldFlink = Entry->Flink; + OldBlink = Entry->Blink; + OldFlink->Blink = OldBlink; + OldBlink->Flink = OldFlink; + return (OldFlink == OldBlink); } - -/* - * PLIST_ENTRY - * RemoveHeadList ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Removes the head entry from a double linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * - * RETURNS: - * The removed entry - */ -static __inline PLIST_ENTRY +static __inline +PLIST_ENTRY RemoveHeadList( - IN PLIST_ENTRY ListHead) + IN PLIST_ENTRY ListHead) { - PLIST_ENTRY Flink; - PLIST_ENTRY Entry; + PLIST_ENTRY Flink; + PLIST_ENTRY Entry; - Entry = ListHead->Flink; - Flink = Entry->Flink; - ListHead->Flink = Flink; - Flink->Blink = ListHead; - return Entry; + Entry = ListHead->Flink; + Flink = Entry->Flink; + ListHead->Flink = Flink; + Flink->Blink = ListHead; + return Entry; } - -/* - * PLIST_ENTRY - * RemoveTailList ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Removes the tail entry from a double linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * - * RETURNS: - * The removed entry - */ -static __inline PLIST_ENTRY +static __inline +PLIST_ENTRY RemoveTailList( - IN PLIST_ENTRY ListHead) + IN PLIST_ENTRY ListHead) { - PLIST_ENTRY Blink; - PLIST_ENTRY Entry; + PLIST_ENTRY Blink; + PLIST_ENTRY Entry; - Entry = ListHead->Blink; - Blink = Entry->Blink; - ListHead->Blink = Blink; - Blink->Flink = ListHead; - return Entry; + Entry = ListHead->Blink; + Blink = Entry->Blink; + ListHead->Blink = Blink; + Blink->Flink = ListHead; + return Entry; } -/* - * BOOLEAN - * IsXstEntry ( - * PLIST_ENTRY ListHead, - * PLIST_ENTRY Entry - * ); -*/ -#define IsFirstEntry(ListHead, Entry) ((ListHead)->Flink == Entry) +#define IsFirstEntry(ListHead, Entry) \ + ((ListHead)->Flink == Entry) -#define IsLastEntry(ListHead, Entry) ((ListHead)->Blink == Entry) - - -#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap) - +#define IsLastEntry(ListHead, Entry) \ + ((ListHead)->Blink == Entry) + #define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ {\ PLIST_ENTRY current;\ @@ -247,7 +139,6 @@ InsertTailList(current, &((NewEntry)->ListEntryField));\ } - #define InsertDescendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ {\ PLIST_ENTRY current;\ @@ -266,7 +157,6 @@ InsertTailList(current, &((NewEntry)->ListEntryField));\ } - #define InsertAscendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\ {\ PLIST_ENTRY current;\ @@ -285,7 +175,6 @@ InsertTailList(current, &((NewEntry)->ListEntryField));\ } - #define InsertDescendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\ {\ PLIST_ENTRY current;\ @@ -304,19 +193,128 @@ InsertTailList(current, &((NewEntry)->ListEntryField));\ } +/* + * Debug Functions + */ + ULONG CDECL DbgPrint( - IN PCH Format, - IN ...); + IN PCH Format, + IN ... +); VOID STDCALL DbgBreakPoint(VOID); +VOID +STDCALL +RtlAssert( + PVOID FailedAssertion, + PVOID FileName, + ULONG LineNumber, + PCHAR Message +); + +ULONG +STDCALL +RtlNtStatusToDosError(IN NTSTATUS Status); + +VOID +STDCALL +RtlRaiseException(IN PEXCEPTION_RECORD ExceptionRecord); + +VOID +STDCALL +RtlRaiseStatus(NTSTATUS Status); + +VOID +STDCALL +RtlUnwind( + PEXCEPTION_REGISTRATION RegistrationFrame, + PVOID ReturnAddress, + PEXCEPTION_RECORD ExceptionRecord, + DWORD EaxValue +); + +/* + * Heap Functions + */ + +PVOID +STDCALL +RtlAllocateHeap( + IN HANDLE HeapHandle, + IN ULONG Flags, + IN ULONG Size +); + +PVOID +STDCALL +RtlCreateHeap( + IN ULONG Flags, + IN PVOID BaseAddress OPTIONAL, + IN ULONG SizeToReserve OPTIONAL, + IN ULONG SizeToCommit OPTIONAL, + IN PVOID Lock OPTIONAL, + IN PRTL_HEAP_DEFINITION Definition OPTIONAL +); + +HANDLE +STDCALL +RtlDestroyHeap(HANDLE hheap); + +BOOLEAN +STDCALL +RtlFreeHeap( + IN HANDLE HeapHandle, + IN ULONG Flags, + IN PVOID P +); + +PVOID +STDCALL +RtlReAllocateHeap( + HANDLE Heap, + ULONG Flags, + PVOID Ptr, + ULONG Size +); + +BOOLEAN +STDCALL +RtlLockHeap(IN HANDLE Heap); + +BOOLEAN +STDCALL +RtlUnlockHeap(IN HANDLE Heap); + +ULONG +STDCALL +RtlSizeHeap( + IN PVOID HeapHandle, + IN ULONG Flags, + IN PVOID MemoryPointer +); + +BOOLEAN +STDCALL +RtlValidateHeap( + HANDLE Heap, + ULONG Flags, + PVOID pmem +); + +#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap) + + +/* + * Security Functions + */ NTSTATUS STDCALL -RtlAbsoluteToSelfRelativeSD ( +RtlAbsoluteToSelfRelativeSD( IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor, IN PULONG BufferLength @@ -324,7 +322,7 @@ NTSTATUS STDCALL -RtlAddAccessAllowedAce ( +RtlAddAccessAllowedAce( PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, @@ -333,7 +331,7 @@ NTSTATUS STDCALL -RtlAllocateAndInitializeSid ( +RtlAllocateAndInitializeSid( IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount, IN ULONG SubAuthority0, @@ -347,47 +345,8 @@ OUT PSID *Sid ); -PVOID -STDCALL -RtlAllocateHeap ( - IN HANDLE HeapHandle, - IN ULONG Flags, - IN ULONG Size -); - -NTSTATUS -STDCALL -RtlAppendUnicodeToString ( - PUNICODE_STRING Destination, - PCWSTR Source -); - -NTSTATUS -STDCALL -RtlAppendUnicodeStringToString ( - PUNICODE_STRING Destination, - PUNICODE_STRING Source -); - -NTSTATUS -STDCALL -RtlAddAtomToAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN PWSTR AtomName, - OUT PRTL_ATOM Atom -); - VOID STDCALL -RtlAssert ( - PVOID FailedAssertion, - PVOID FileName, - ULONG LineNumber, - PCHAR Message - ); - -VOID -STDCALL RtlCopyLuid( IN PLUID LuidDest, IN PLUID LuidSrc @@ -413,73 +372,22 @@ PULONG RemainingSidAreaSize ); -SIZE_T -STDCALL -RtlCompareMemory(IN const VOID *Source1, - IN const VOID *Source2, - IN SIZE_T Length); - -LONG -STDCALL -RtlCompareUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN CaseInsensitive -); - -BOOLEAN -STDCALL -RtlEqualUnicodeString ( - PCUNICODE_STRING String1, - PCUNICODE_STRING String2, - BOOLEAN CaseInsensitive -); - -VOID -STDCALL -RtlAcquirePebLock ( - VOID - ); - -VOID -STDCALL -RtlReleasePebLock ( - VOID - ); - NTSTATUS STDCALL -RtlCompressBuffer ( - IN USHORT CompressionFormatAndEngine, - IN PUCHAR UncompressedBuffer, - IN ULONG UncompressedBufferSize, - OUT PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - IN ULONG UncompressedChunkSize, - OUT PULONG FinalCompressedSize, - IN PVOID WorkSpace -); - -NTSTATUS -STDCALL -RtlConvertSidToUnicodeString ( +RtlConvertSidToUnicodeString( OUT PUNICODE_STRING DestinationString, - IN PSID Sid, - IN BOOLEAN AllocateDestinationString + IN PSID Sid, + IN BOOLEAN AllocateDestinationString ); NTSTATUS STDCALL -RtlCopySid ( - IN ULONG Length, - IN PSID Destination, - IN PSID Source +RtlCopySid( + IN ULONG Length, + IN PSID Destination, + IN PSID Source ); -VOID STDCALL -RtlCopyUnicodeString(PUNICODE_STRING DestinationString, - PUNICODE_STRING SourceString); - NTSTATUS STDCALL RtlCreateAcl( @@ -488,535 +396,525 @@ ULONG AclRevision ); -PVOID -STDCALL -RtlCreateHeap( - IN ULONG Flags, - IN PVOID BaseAddress OPTIONAL, - IN ULONG SizeToReserve OPTIONAL, - IN ULONG SizeToCommit OPTIONAL, - IN PVOID Lock OPTIONAL, - IN PRTL_HEAP_DEFINITION Definition OPTIONAL -); - NTSTATUS STDCALL -RtlCreateAtomTable( - IN ULONG TableSize, - IN OUT PRTL_ATOM_TABLE *AtomTable -); - -NTSTATUS -STDCALL RtlCreateSecurityDescriptor( PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG Revision ); -NTSTATUS STDCALL +NTSTATUS +STDCALL RtlCreateSecurityDescriptorRelative( PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, ULONG Revision ); -NTSTATUS +BOOLEAN STDCALL -RtlCreateUserThread ( - IN HANDLE ProcessHandle, - IN PSECURITY_DESCRIPTOR SecurityDescriptor, - IN BOOLEAN CreateSuspended, - IN LONG StackZeroBits, - IN OUT PULONG StackReserve, - IN OUT PULONG StackCommit, - IN PTHREAD_START_ROUTINE StartAddress, - IN PVOID Parameter, - IN OUT PHANDLE ThreadHandle, - IN OUT PCLIENT_ID ClientId +RtlEqualSid ( + IN PSID Sid1, + IN PSID Sid2 ); -BOOLEAN +PVOID STDCALL -RtlCreateUnicodeString( - OUT PUNICODE_STRING DestinationString, - IN PCWSTR SourceString +RtlFreeSid ( + IN PSID Sid ); NTSTATUS STDCALL -RtlDecompressBuffer ( - IN USHORT CompressionFormat, - OUT PUCHAR UncompressedBuffer, - IN ULONG UncompressedBufferSize, - IN PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - OUT PULONG FinalUncompressedSize +RtlGetDaclSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + OUT PBOOLEAN DaclPresent, + OUT PACL *Dacl, + OUT PBOOLEAN DaclDefaulted ); NTSTATUS STDCALL -RtlExpandEnvironmentStrings_U ( - PWSTR Environment, - PUNICODE_STRING Source, - PUNICODE_STRING Destination, - PULONG Length +RtlGetSaclSecurityDescriptor( + PSECURITY_DESCRIPTOR SecurityDescriptor, + PBOOLEAN SaclPresent, + PACL* Sacl, + PBOOLEAN SaclDefaulted ); -PRTL_USER_PROCESS_PARAMETERS +NTSTATUS STDCALL -RtlDeNormalizeProcessParams ( - IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters +RtlGetGroupSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + OUT PSID *Group, + OUT PBOOLEAN GroupDefaulted ); -PRTL_USER_PROCESS_PARAMETERS +NTSTATUS STDCALL -RtlNormalizeProcessParams ( - IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters +RtlGetOwnerSecurityDescriptor( + IN PSECURITY_DESCRIPTOR SecurityDescriptor, + OUT PSID *Owner, + OUT PBOOLEAN OwnerDefaulted ); NTSTATUS STDCALL -RtlDeleteAtomFromAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom +RtlInitializeSid( + IN OUT PSID Sid, + IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, + IN UCHAR SubAuthorityCount ); +ULONG +STDCALL +RtlLengthRequiredSid(IN UCHAR SubAuthorityCount); + +ULONG +STDCALL +RtlLengthSid(IN PSID Sid); + +#if (VER_PRODUCTBUILD >= 2195) + NTSTATUS STDCALL -RtlDeleteCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection +RtlSelfRelativeToAbsoluteSD( + IN PSECURITY_DESCRIPTOR SelfRelativeSD, + OUT PSECURITY_DESCRIPTOR AbsoluteSD, + IN PULONG AbsoluteSDSize, + IN PACL Dacl, + IN PULONG DaclSize, + IN PACL Sacl, + IN PULONG SaclSize, + IN PSID Owner, + IN PULONG OwnerSize, + IN PSID PrimaryGroup, + IN PULONG PrimaryGroupSize ); -NTSTATUS +#endif /* (VER_PRODUCTBUILD >= 2195) */ + +NTSTATUS STDCALL -RtlDestroyAtomTable ( - IN PRTL_ATOM_TABLE AtomTable +RtlSetDaclSecurityDescriptor ( + PSECURITY_DESCRIPTOR SecurityDescriptor, + BOOLEAN DaclPresent, + PACL Dacl, + BOOLEAN DaclDefaulted ); NTSTATUS STDCALL -RtlEnterCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection +RtlSetGroupSecurityDescriptor( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSID Group, + IN BOOLEAN GroupDefaulted ); -NTSTATUS +NTSTATUS STDCALL -RtlInitializeCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection +RtlSetOwnerSecurityDescriptor( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN PSID Owner, + IN BOOLEAN OwnerDefaulted ); NTSTATUS STDCALL -RtlLeaveCriticalSection ( - PRTL_CRITICAL_SECTION CriticalSection +RtlSetSaclSecurityDescriptor( + IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, + IN BOOLEAN SaclPresent, + IN PACL Sacl, + IN BOOLEAN SaclDefaulted ); -VOID +PUCHAR STDCALL -RtlInitializeBitMap( - IN PRTL_BITMAP BitMapHeader, - IN PULONG BitMapBuffer, - IN ULONG SizeOfBitMap); - -BOOLEAN +RtlSubAuthorityCountSid( + IN PSID Sid +); + +PULONG STDCALL -RtlAreBitsClear( - IN PRTL_BITMAP BitMapHeader, - IN ULONG StartingIndex, - IN ULONG Length); +RtlSubAuthoritySid( + IN PSID Sid, + IN ULONG SubAuthority +); BOOLEAN STDCALL -RtlAreBitsSet( - IN PRTL_BITMAP BitMapHeader, - IN ULONG StartingIndex, - IN ULONG Length); +RtlValidSid(IN PSID Sid); -VOID +BOOLEAN STDCALL -RtlClearBits ( - IN PRTL_BITMAP BitMapHeader, - IN ULONG StartingIndex, - IN ULONG NumberToClear - ); +RtlValidAcl(PACL Acl); -ULONG +/* + * Single-Character Functions + */ +NTSTATUS STDCALL -RtlFindClearBits ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); +RtlLargeIntegerToChar( + IN PLARGE_INTEGER Value, + IN ULONG Base, + IN ULONG Length, + IN OUT PCHAR String +); + +CHAR +STDCALL +RtlUpperChar(CHAR Source); -ULONG +WCHAR STDCALL -RtlFindClearBitsAndSet ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); +RtlUpcaseUnicodeChar(WCHAR Source); +WCHAR +STDCALL +RtlDowncaseUnicodeChar(IN WCHAR Source); + NTSTATUS STDCALL -RtlMultiByteToUnicodeN ( - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - const PCHAR MbString, - ULONG MbSize +RtlIntegerToChar( + IN ULONG Value, + IN ULONG Base, + IN ULONG Length, + IN OUT PCHAR String ); +NTSTATUS +STDCALL +RtlIntegerToUnicode( + IN ULONG Value, + IN ULONG Base OPTIONAL, + IN ULONG Length OPTIONAL, + IN OUT LPWSTR String +); + NTSTATUS STDCALL -RtlMultiByteToUnicodeSize ( - PULONG UnicodeSize, - PCHAR MbString, - ULONG MbSize +RtlIntegerToUnicodeString( + IN ULONG Value, + IN ULONG Base, + IN OUT PUNICODE_STRING String ); -BOOLEAN +NTSTATUS STDCALL -RtlPrefixUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN CaseInsensitive - ); +RtlCharToInteger( + PCSZ String, + ULONG Base, + PULONG Value +); -CHAR STDCALL -RtlUpperChar (CHAR Source); +USHORT +FASTCALL +RtlUshortByteSwap(IN USHORT Source); -WCHAR +/* + * Unicode->Ansi String Functions + */ +ULONG STDCALL -RtlUpcaseUnicodeChar ( - WCHAR Source - ); - +RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString); + NTSTATUS STDCALL -RtlAnsiStringToUnicodeString ( - PUNICODE_STRING DestinationString, - PANSI_STRING SourceString, - BOOLEAN AllocateDestinationString - ); - -ULONG +RtlUnicodeStringToAnsiString( + PANSI_STRING DestinationString, + PUNICODE_STRING SourceString, + BOOLEAN AllocateDestinationString +); + +/* + * Unicode->OEM String Functions + */ +NTSTATUS STDCALL -RtlAnsiStringToUnicodeSize ( - PANSI_STRING AnsiString - ); +RtlUpcaseUnicodeStringToOemString( + POEM_STRING DestinationString, + PUNICODE_STRING SourceString, + BOOLEAN AllocateDestinationString +); NTSTATUS STDCALL -RtlUnicodeToMultiByteN ( - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -ULONG +RtlUpcaseUnicodeStringToCountedOemString( + IN OUT POEM_STRING DestinationString, + IN PUNICODE_STRING SourceString, + IN BOOLEAN AllocateDestinationString [truncated at 1000 lines; 1114 more skipped]
19 years, 6 months
1
0
0
0
[hyperion] 16137: make SVN merge happy
by hyperion@svn.reactos.com
make SVN merge happy Deleted: branches/rox-u/reactos/include/msvcrt/
19 years, 6 months
1
0
0
0
[ion] 16136: Cleanup kernel usage to decrease compilation time/memory
by ion@svn.reactos.com
Cleanup kernel usage to decrease compilation time/memory Modified: trunk/reactos/lib/kernel32/k32.h Modified: trunk/reactos/lib/kernel32/misc/computername.c Modified: trunk/reactos/lib/kernel32/misc/toolhelp.c Modified: trunk/reactos/lib/kernel32/misc/version.c Modified: trunk/reactos/lib/kernel32/process/create.c Modified: trunk/reactos/lib/kernel32/thread/fiber.c Modified: trunk/reactos/lib/kernel32/thread/thread.c _____ Modified: trunk/reactos/lib/kernel32/k32.h --- trunk/reactos/lib/kernel32/k32.h 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/k32.h 2005-06-20 04:30:23 UTC (rev 16136) @@ -28,14 +28,6 @@ #include <ntdll/csr.h> #include <ntdll/ldr.h> -/* Toolhelp & CSRSS Header */ -#include <tlhelp32.h> -#include <csrss/csrss.h> - -/* FIXME: KILL ROSRTL */ -#include <rosrtl/thread.h> -#include <rosrtl/registry.h> - /* Internal Kernel32 Header */ #include "include/kernel32.h" @@ -44,5 +36,5 @@ /* Helper Header */ #include <reactos/helper.h> -#include <reactos/buildno.h> +/* EOF */ _____ Modified: trunk/reactos/lib/kernel32/misc/computername.c --- trunk/reactos/lib/kernel32/misc/computername.c 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/misc/computername.c 2005-06-20 04:30:23 UTC (rev 16136) @@ -29,6 +29,9 @@ #include <k32.h> +/* FIXME */ +#include <rosrtl/registry.h> + #define NDEBUG #include "../include/debug.h" _____ Modified: trunk/reactos/lib/kernel32/misc/toolhelp.c --- trunk/reactos/lib/kernel32/misc/toolhelp.c 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/misc/toolhelp.c 2005-06-20 04:30:23 UTC (rev 16136) @@ -38,6 +38,8 @@ #include <k32.h> +#include <tlhelp32.h> + #define NDEBUG #include "../include/debug.h" _____ Modified: trunk/reactos/lib/kernel32/misc/version.c --- trunk/reactos/lib/kernel32/misc/version.c 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/misc/version.c 2005-06-20 04:30:23 UTC (rev 16136) @@ -10,6 +10,7 @@ */ #include <k32.h> +#include <reactos/buildno.h> #define NDEBUG #include "../include/debug.h" _____ Modified: trunk/reactos/lib/kernel32/process/create.c --- trunk/reactos/lib/kernel32/process/create.c 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/process/create.c 2005-06-20 04:30:23 UTC (rev 16136) @@ -12,8 +12,10 @@ /* INCLUDES ****************************************************************/ #include <k32.h> -#include <pseh/framebased.h> +/* FIXME */ +#include <rosrtl/thread.h> + #define NDEBUG #include "../include/debug.h" _____ Modified: trunk/reactos/lib/kernel32/thread/fiber.c --- trunk/reactos/lib/kernel32/thread/fiber.c 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/thread/fiber.c 2005-06-20 04:30:23 UTC (rev 16136) @@ -7,6 +7,9 @@ */ #include <k32.h> +/* FIXME */ +#include <rosrtl/thread.h> + #define NDEBUG #include "../include/debug.h" _____ Modified: trunk/reactos/lib/kernel32/thread/thread.c --- trunk/reactos/lib/kernel32/thread/thread.c 2005-06-20 04:18:03 UTC (rev 16135) +++ trunk/reactos/lib/kernel32/thread/thread.c 2005-06-20 04:30:23 UTC (rev 16136) @@ -15,6 +15,9 @@ #include <k32.h> +/* FIXME */ +#include <rosrtl/thread.h> + #define NDEBUG #include "../include/debug.h"
19 years, 6 months
1
0
0
0
[ion] 16135: Remove rosrtl string macros
by ion@svn.reactos.com
Remove rosrtl string macros Modified: trunk/reactos/lib/kernel32/file/find.c Modified: trunk/reactos/lib/kernel32/k32.h Modified: trunk/reactos/lib/kernel32/misc/comm.c Modified: trunk/reactos/lib/kernel32/misc/computername.c Modified: trunk/reactos/lib/kernel32/misc/dllmain.c Modified: trunk/reactos/lib/kernel32/misc/lang.c _____ Modified: trunk/reactos/lib/kernel32/file/find.c --- trunk/reactos/lib/kernel32/file/find.c 2005-06-20 04:07:49 UTC (rev 16134) +++ trunk/reactos/lib/kernel32/file/find.c 2005-06-20 04:18:03 UTC (rev 16135) @@ -94,7 +94,7 @@ PKERNEL32_FIND_FILE_DATA IData; IO_STATUS_BLOCK IoStatusBlock; UNICODE_STRING NtPathU; - UNICODE_STRING PatternStr; + UNICODE_STRING PatternStr = RTL_CONSTANT_STRING(L"*"); NTSTATUS Status; PWSTR e1, e2; WCHAR CurrentDir[256]; @@ -234,12 +234,8 @@ } /* change pattern: "*.*" --> "*" */ - if (!wcscmp (SearchPattern, L"*.*")) + if (wcscmp (SearchPattern, L"*.*")) { - RtlRosInitUnicodeStringFromLiteral(&PatternStr, L"*"); - } - else - { RtlInitUnicodeString(&PatternStr, SearchPattern); } _____ Modified: trunk/reactos/lib/kernel32/k32.h --- trunk/reactos/lib/kernel32/k32.h 2005-06-20 04:07:49 UTC (rev 16134) +++ trunk/reactos/lib/kernel32/k32.h 2005-06-20 04:18:03 UTC (rev 16135) @@ -34,7 +34,6 @@ /* FIXME: KILL ROSRTL */ #include <rosrtl/thread.h> -#include <rosrtl/string.h> #include <rosrtl/registry.h> /* Internal Kernel32 Header */ _____ Modified: trunk/reactos/lib/kernel32/misc/comm.c --- trunk/reactos/lib/kernel32/misc/comm.c 2005-06-20 04:07:49 UTC (rev 16134) +++ trunk/reactos/lib/kernel32/misc/comm.c 2005-06-20 04:18:03 UTC (rev 16135) @@ -210,8 +210,8 @@ BOOL bRetVal; ULONG_PTR nValue; static COMMDCB_PARAM_STRFLAG a_BoolFlags[] = { - { ROS_STRING_INITIALIZER(L"off"), FALSE }, - { ROS_STRING_INITIALIZER(L"on"), TRUE } + { RTL_CONSTANT_STRING(L"off"), FALSE }, + { RTL_CONSTANT_STRING(L"on"), TRUE } }; /* try to recognize the next flag as a boolean */ @@ -339,9 +339,9 @@ BOOL bRetVal; ULONG_PTR nValue; static COMMDCB_PARAM_STRFLAG a_DTRFlags[] = { - { ROS_STRING_INITIALIZER(L"hs"), DTR_CONTROL_HANDSHAKE }, - { ROS_STRING_INITIALIZER(L"off"), DTR_CONTROL_DISABLE }, - { ROS_STRING_INITIALIZER(L"on"), DTR_CONTROL_ENABLE } + { RTL_CONSTANT_STRING(L"hs"), DTR_CONTROL_HANDSHAKE }, + { RTL_CONSTANT_STRING(L"off"), DTR_CONTROL_DISABLE }, + { RTL_CONSTANT_STRING(L"on"), DTR_CONTROL_ENABLE } }; (void)Timeouts; @@ -450,10 +450,10 @@ DWORD nRetVal; ULONG_PTR nValue; static COMMDCB_PARAM_STRFLAG a_RTSFlags[] = { - { ROS_STRING_INITIALIZER(L"hs"), RTS_CONTROL_HANDSHAKE }, - { ROS_STRING_INITIALIZER(L"off"), RTS_CONTROL_DISABLE }, - { ROS_STRING_INITIALIZER(L"on"), RTS_CONTROL_ENABLE }, - { ROS_STRING_INITIALIZER(L"tg"), RTS_CONTROL_TOGGLE } + { RTL_CONSTANT_STRING(L"hs"), RTS_CONTROL_HANDSHAKE }, + { RTL_CONSTANT_STRING(L"off"), RTS_CONTROL_DISABLE }, + { RTL_CONSTANT_STRING(L"on"), RTS_CONTROL_ENABLE }, + { RTL_CONSTANT_STRING(L"tg"), RTS_CONTROL_TOGGLE } }; (void)Timeouts; @@ -480,9 +480,9 @@ BOOL bRetVal; ULONG_PTR nValue; static COMMDCB_PARAM_STRFLAG a_StopFlags[] = { - { ROS_STRING_INITIALIZER(L"1"), ONESTOPBIT }, - { ROS_STRING_INITIALIZER(L"1.5"), ONE5STOPBITS }, - { ROS_STRING_INITIALIZER(L"2"), TWOSTOPBITS } + { RTL_CONSTANT_STRING(L"1"), ONESTOPBIT }, + { RTL_CONSTANT_STRING(L"1.5"), ONE5STOPBITS }, + { RTL_CONSTANT_STRING(L"2"), TWOSTOPBITS } }; (void)Timeouts; @@ -572,7 +572,7 @@ /* FUNCTIONS */ #define COMMDCB_PARAM(__P__) \ { \ - ROS_STRING_INITIALIZER( L""#__P__ ), \ + RTL_CONSTANT_STRING( L""#__P__ ), \ (ULONG_PTR)&COMMDCB_ ## __P__ ## Param \ } _____ Modified: trunk/reactos/lib/kernel32/misc/computername.c --- trunk/reactos/lib/kernel32/misc/computername.c 2005-06-20 04:07:49 UTC (rev 16134) +++ trunk/reactos/lib/kernel32/misc/computername.c 2005-06-20 04:18:03 UTC (rev 16135) @@ -144,7 +144,9 @@ case ComputerNameDnsFullyQualified: RtlInitUnicodeString(&Dot,L"."); - RosInitializeString(&ResultString,0,*nSize * sizeof(WCHAR),lpBuffer); + RtlInitUnicodeString(&ResultString, NULL); + ResultString.Length = *nSize * sizeof(WCHAR); + ResultString.MaximumLength = *nSize * sizeof(WCHAR); RtlInitUnicodeString(&RegKey, L"\\Registry\\Machine\\System" L"\\CurrentControlSet\\Services\\Tcpip" _____ Modified: trunk/reactos/lib/kernel32/misc/dllmain.c --- trunk/reactos/lib/kernel32/misc/dllmain.c 2005-06-20 04:07:49 UTC (rev 16134) +++ trunk/reactos/lib/kernel32/misc/dllmain.c 2005-06-20 04:18:03 UTC (rev 16135) @@ -47,7 +47,7 @@ OpenBaseDirectory(PHANDLE DirHandle) { OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING Name = ROS_STRING_INITIALIZER(L"\\BaseNamedObjects"); + UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\BaseNamedObjects"); NTSTATUS Status; InitializeObjectAttributes(&ObjectAttributes, _____ Modified: trunk/reactos/lib/kernel32/misc/lang.c --- trunk/reactos/lib/kernel32/misc/lang.c 2005-06-20 04:07:49 UTC (rev 16134) +++ trunk/reactos/lib/kernel32/misc/lang.c 2005-06-20 04:18:03 UTC (rev 16135) @@ -293,7 +293,8 @@ { NTSTATUS result; HANDLE langKey; - UNICODE_STRING langKeyName; + UNICODE_STRING langKeyName = RTL_CONSTANT_STRING( + L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Locale") ; OBJECT_ATTRIBUTES objectAttributes; ULONG index, length; unsigned char fullInfo[sizeof(KEY_VALUE_FULL_INFORMATION)+255*2]; //FIXME: MAX_PATH*2 @@ -314,9 +315,6 @@ // Open language registry key //FIXME: Should we use critical section here? - RtlRosInitUnicodeStringFromLiteral(&langKeyName, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Locale") ; - InitializeObjectAttributes(&objectAttributes, &langKeyName, OBJ_CASE_INSENSITIVE,
19 years, 6 months
1
0
0
0
[ion] 16134: Build kernel32 with NDK
by ion@svn.reactos.com
Build kernel32 with NDK Modified: trunk/reactos/lib/kernel32/file/dir.c Modified: trunk/reactos/lib/kernel32/file/move.c Modified: trunk/reactos/lib/kernel32/file/npipe.c Modified: trunk/reactos/lib/kernel32/k32.h Modified: trunk/reactos/lib/kernel32/mem/global.c Modified: trunk/reactos/lib/kernel32/misc/lzexpand_main.c Modified: trunk/reactos/lib/kernel32/misc/sysinfo.c Modified: trunk/reactos/lib/kernel32/misc/time.c Modified: trunk/reactos/lib/kernel32/process/create.c Modified: trunk/reactos/lib/kernel32/process/proc.c _____ Modified: trunk/reactos/lib/kernel32/file/dir.c --- trunk/reactos/lib/kernel32/file/dir.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/file/dir.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -578,7 +578,7 @@ DWORD shortlen ) { - WCHAR tmpshortpath[PATH_MAX]; + WCHAR tmpshortpath[MAX_PATH]; LPCWSTR p; DWORD sp = 0, lp = 0; DWORD tmplen; _____ Modified: trunk/reactos/lib/kernel32/file/move.c --- trunk/reactos/lib/kernel32/file/move.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/file/move.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -12,6 +12,7 @@ /* INCLUDES *****************************************************************/ #include <k32.h> +#include <malloc.h> #define NDEBUG #include "../include/debug.h" _____ Modified: trunk/reactos/lib/kernel32/file/npipe.c --- trunk/reactos/lib/kernel32/file/npipe.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/file/npipe.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -177,7 +177,7 @@ if (nMaxInstances >= PIPE_UNLIMITED_INSTANCES) { - nMaxInstances = ULONG_MAX; + nMaxInstances = 0xFFFFFFFF; } DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000LL; _____ Modified: trunk/reactos/lib/kernel32/k32.h --- trunk/reactos/lib/kernel32/k32.h 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/k32.h 2005-06-20 04:07:49 UTC (rev 16134) @@ -1,38 +1,49 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS System Libraries + * FILE: lib/ntdll/inc/ntdll.h + * PURPOSE: Native Libary Header + * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +/* PSDK/NDK Headers */ +#include <windows.h> #define NTOS_MODE_USER -#include <ntos.h> -#include <ctype.h> -#include <stdarg.h> -#include <stdio.h> -#include <malloc.h> -#include <limits.h> +#include <ndk/ntndk.h> + +/* C Headers */ #include <wchar.h> -#include <string.h> -#include <ddk/ntddk.h> + +/* DDK Driver Headers */ #include <ddk/ntddbeep.h> #include <ddk/ntddser.h> -#include <windows.h> -#include <tlhelp32.h> +#include <ddk/ntddtape.h> + +/* FIXME: Clean this sh*t up */ #include <ntdll/base.h> #include <ntdll/rtl.h> #include <ntdll/dbg.h> #include <ntdll/csr.h> #include <ntdll/ldr.h> -#include <napi/i386/segment.h> -#include <napi/teb.h> -#include <napi/npipe.h> -#include <napi/types.h> + +/* Toolhelp & CSRSS Header */ +#include <tlhelp32.h> #include <csrss/csrss.h> -#include <reactos/buildno.h> + +/* FIXME: KILL ROSRTL */ #include <rosrtl/thread.h> #include <rosrtl/string.h> -#include <ntos/ldrtypes.h> -#include <ntos/zwtypes.h> -#include <ddk/ldrfuncs.h> -#include <ddk/ntifs.h> - -#include <rosrtl/string.h> #include <rosrtl/registry.h> +/* Internal Kernel32 Header */ #include "include/kernel32.h" +/* PSEH for SEH Support */ #include <pseh.h> + +/* Helper Header */ +#include <reactos/helper.h> +#include <reactos/buildno.h> + _____ Modified: trunk/reactos/lib/kernel32/mem/global.c --- trunk/reactos/lib/kernel32/mem/global.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/mem/global.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -407,38 +407,38 @@ */ lpBuffer->dwMemoryLoad = (SysBasicInfo.NumberOfPhysicalPages - SysPerfInfo.AvailablePages) * 100 / - SysBasicInfo.NumberOfPhysicalPages; + SysBasicInfo.PageSize; DPRINT1("Memory Load: %d\n",lpBuffer->dwMemoryLoad ); lpBuffer->ullTotalPhys = SysBasicInfo.NumberOfPhysicalPages * - SysBasicInfo.PhysicalPageSize; + SysBasicInfo.PageSize; lpBuffer->ullAvailPhys = SysPerfInfo.AvailablePages * - SysBasicInfo.PhysicalPageSize; + SysBasicInfo.PageSize; DPRINT("%d\n",SysPerfInfo.AvailablePages ); DPRINT("%d\n",lpBuffer->ullAvailPhys ); - lpBuffer->ullTotalPageFile = SysPerfInfo.TotalCommitLimit * - SysBasicInfo.PhysicalPageSize; + lpBuffer->ullTotalPageFile = SysPerfInfo.CommitLimit * + SysBasicInfo.PageSize; DPRINT("%d\n",lpBuffer->ullTotalPageFile ); - lpBuffer->ullAvailPageFile = ((SysPerfInfo.TotalCommitLimit - - SysPerfInfo.TotalCommittedPages) * - SysBasicInfo.PhysicalPageSize); + lpBuffer->ullAvailPageFile = ((SysPerfInfo.CommitLimit - + SysPerfInfo.CommittedPages) * + SysBasicInfo.PageSize); /* VM available to the calling processes, User Mem? */ - lpBuffer->ullTotalVirtual = SysBasicInfo.HighestUserAddress - - SysBasicInfo.LowestUserAddress; + lpBuffer->ullTotalVirtual = SysBasicInfo.MaximumUserModeAddress - + SysBasicInfo.MinimumUserModeAddress; lpBuffer->ullAvailVirtual = (lpBuffer->ullTotalVirtual - (UserMemory * - SysBasicInfo.PhysicalPageSize)); + SysBasicInfo.PageSize)); DPRINT("%d\n",lpBuffer->ullAvailVirtual ); DPRINT("%d\n",UserMemory); - DPRINT("%d\n",SysBasicInfo.PhysicalPageSize); + DPRINT("%d\n",SysBasicInfo.PageSize); /* lol! Memory from beyond! */ lpBuffer->ullAvailExtendedVirtual = 0; _____ Modified: trunk/reactos/lib/kernel32/misc/lzexpand_main.c --- trunk/reactos/lib/kernel32/misc/lzexpand_main.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/misc/lzexpand_main.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -28,6 +28,7 @@ #define NDEBUG #include "../include/debug.h" #include "lzexpand.h" +#include <ctype.h> #define HFILE_ERROR ((HFILE)-1) _____ Modified: trunk/reactos/lib/kernel32/misc/sysinfo.c --- trunk/reactos/lib/kernel32/misc/sysinfo.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/misc/sysinfo.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -58,11 +58,11 @@ Si->wProcessorArchitecture = Spi.ProcessorArchitecture; /* For future use: always zero */ Si->wReserved = 0; - Si->dwPageSize = Sbi.PhysicalPageSize; - Si->lpMinimumApplicationAddress = (PVOID)Sbi.LowestUserAddress; - Si->lpMaximumApplicationAddress = (PVOID)Sbi.HighestUserAddress; - Si->dwActiveProcessorMask = Sbi.ActiveProcessors; - Si->dwNumberOfProcessors = Sbi.NumberProcessors; + Si->dwPageSize = Sbi.PageSize; + Si->lpMinimumApplicationAddress = (PVOID)Sbi.MinimumUserModeAddress; + Si->lpMaximumApplicationAddress = (PVOID)Sbi.MaximumUserModeAddress; + Si->dwActiveProcessorMask = Sbi.ActiveProcessorsAffinityMask; + Si->dwNumberOfProcessors = Sbi.NumberOfProcessors; /* * Compatibility (no longer relevant): * PROCESSOR_INTEL_386 386 _____ Modified: trunk/reactos/lib/kernel32/misc/time.c --- trunk/reactos/lib/kernel32/misc/time.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/misc/time.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -366,7 +366,7 @@ DPRINT("SetTimeZoneInformation()\n"); - Status = RtlSetTimeZoneInformation((PTIME_ZONE_INFORMATION)lpTimeZoneInformation) ; + Status = RtlSetTimeZoneInformation((LPTIME_ZONE_INFORMATION)lpTimeZoneInformation ); if (!NT_SUCCESS(Status)) { DPRINT1("RtlSetTimeZoneInformation() failed (Status %lx)\n", Status); @@ -442,12 +442,12 @@ PDWORD lpTimeIncrement, PBOOL lpTimeAdjustmentDisabled) { - SYSTEM_QUERY_TIME_ADJUSTMENT Buffer; + SYSTEM_QUERY_TIME_ADJUST_INFORMATION Buffer; NTSTATUS Status; Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation, &Buffer, - sizeof(SYSTEM_QUERY_TIME_ADJUSTMENT), + sizeof(SYSTEM_QUERY_TIME_ADJUST_INFORMATION), NULL); if (!NT_SUCCESS(Status)) { @@ -456,8 +456,8 @@ } *lpTimeAdjustment = (DWORD)Buffer.TimeAdjustment; - *lpTimeIncrement = (DWORD)Buffer.MaximumIncrement; - *lpTimeAdjustmentDisabled = (BOOL)Buffer.TimeSynchronization; + *lpTimeIncrement = (DWORD)Buffer.TimeIncrement; + *lpTimeAdjustmentDisabled = (BOOL)Buffer.Enable; return TRUE; } @@ -471,14 +471,14 @@ BOOL bTimeAdjustmentDisabled) { NTSTATUS Status; - SYSTEM_SET_TIME_ADJUSTMENT Buffer; + SYSTEM_SET_TIME_ADJUST_INFORMATION Buffer; Buffer.TimeAdjustment = (ULONG)dwTimeAdjustment; - Buffer.TimeSynchronization = (BOOLEAN)bTimeAdjustmentDisabled; + Buffer.Enable = (BOOLEAN)bTimeAdjustmentDisabled; Status = NtSetSystemInformation(SystemTimeAdjustmentInformation, &Buffer, - sizeof(SYSTEM_SET_TIME_ADJUSTMENT)); + sizeof(SYSTEM_SET_TIME_ADJUST_INFORMATION)); if (!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); _____ Modified: trunk/reactos/lib/kernel32/process/create.c --- trunk/reactos/lib/kernel32/process/create.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/process/create.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -139,11 +139,11 @@ BOOL bRetVal; STARTUPINFOW wsiStartupInfo; - NTSTATUS STDCALL_FUNC (*pTrue)(UNICODE_STRING *, + NTSTATUS (STDCALL *pTrue)(UNICODE_STRING *, ANSI_STRING *, BOOLEAN); - ULONG STDCALL_FUNC (*pRtlMbStringToUnicodeSize)(ANSI_STRING *); + ULONG (STDCALL *pRtlMbStringToUnicodeSize)(ANSI_STRING *); DPRINT("dwCreationFlags %x, lpEnvironment %x, lpCurrentDirectory %x, " "lpStartupInfo %x, lpProcessInformation %x\n", @@ -1156,7 +1156,7 @@ */ CsrRequest.Type = CSRSS_CREATE_PROCESS; CsrRequest.Data.CreateProcessRequest.NewProcessId = - ProcessBasicInfo.UniqueProcessId; + (HANDLE)ProcessBasicInfo.UniqueProcessId; if (Sii.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { /* Do not create a console for GUI applications */ @@ -1306,7 +1306,7 @@ if (IsConsoleHandle(Ppb->hStdError)) { CsrRequest.Type = CSRSS_DUPLICATE_HANDLE; - CsrRequest.Data.DuplicateHandleRequest.ProcessId = ProcessBasicInfo.UniqueProcessId; + CsrRequest.Data.DuplicateHandleRequest.ProcessId = (HANDLE)ProcessBasicInfo.UniqueProcessId; CsrRequest.Data.DuplicateHandleRequest.Handle = CsrReply.Data.CreateProcessReply.OutputHandle; Status = CsrClientCallServer(&CsrRequest, &CsrReply, _____ Modified: trunk/reactos/lib/kernel32/process/proc.c --- trunk/reactos/lib/kernel32/process/proc.c 2005-06-20 04:07:34 UTC (rev 16133) +++ trunk/reactos/lib/kernel32/process/proc.c 2005-06-20 04:07:49 UTC (rev 16134) @@ -62,7 +62,7 @@ } *lpProcessAffinityMask = (DWORD)ProcessInfo.AffinityMask; - *lpSystemAffinityMask = (DWORD)SystemInfo.ActiveProcessors; + *lpSystemAffinityMask = (DWORD)SystemInfo.ActiveProcessorsAffinityMask; return TRUE; }
19 years, 6 months
1
0
0
0
[ion] 16133: Final NDK fixes for kernel32
by ion@svn.reactos.com
Final NDK fixes for kernel32 Modified: trunk/reactos/include/ndk/pstypes.h Modified: trunk/reactos/include/ndk/rtlfuncs.h _____ Modified: trunk/reactos/include/ndk/pstypes.h --- trunk/reactos/include/ndk/pstypes.h 2005-06-20 04:07:19 UTC (rev 16132) +++ trunk/reactos/include/ndk/pstypes.h 2005-06-20 04:07:34 UTC (rev 16133) @@ -102,6 +102,12 @@ PVOID Handle; } CURDIR, *PCURDIR; +typedef struct _DESCRIPTOR_TABLE_ENTRY +{ + ULONG Selector; + LDT_ENTRY Descriptor; +} DESCRIPTOR_TABLE_ENTRY, *PDESCRIPTOR_TABLE_ENTRY; + typedef struct _PEB_FREE_BLOCK { struct _PEB_FREE_BLOCK* Next; _____ Modified: trunk/reactos/include/ndk/rtlfuncs.h --- trunk/reactos/include/ndk/rtlfuncs.h 2005-06-20 04:07:19 UTC (rev 16132) +++ trunk/reactos/include/ndk/rtlfuncs.h 2005-06-20 04:07:34 UTC (rev 16133) @@ -631,6 +631,30 @@ IN ULONG StartingIndex, IN ULONG Length); +VOID +STDCALL +RtlClearBits ( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG NumberToClear + ); + +ULONG +STDCALL +RtlFindClearBits ( + PRTL_BITMAP BitMapHeader, + ULONG NumberToFind, + ULONG HintIndex + ); + +ULONG +STDCALL +RtlFindClearBitsAndSet ( + PRTL_BITMAP BitMapHeader, + ULONG NumberToFind, + ULONG HintIndex + ); + NTSTATUS STDCALL RtlMultiByteToUnicodeN (
19 years, 6 months
1
0
0
0
[ion] 16132: Apply kjk's change to thread.c too
by ion@svn.reactos.com
Apply kjk's change to thread.c too Modified: trunk/reactos/lib/kernel32/thread/thread.c _____ Modified: trunk/reactos/lib/kernel32/thread/thread.c --- trunk/reactos/lib/kernel32/thread/thread.c 2005-06-20 03:55:42 UTC (rev 16131) +++ trunk/reactos/lib/kernel32/thread/thread.c 2005-06-20 04:07:19 UTC (rev 16132) @@ -20,46 +20,27 @@ /* FUNCTIONS *****************************************************************/ - -/* FIXME: please put this in some header */ -static EXCEPTION_DISPOSITION __cdecl -_except_handler(EXCEPTION_RECORD *ExceptionRecord, - void * EstablisherFrame, - CONTEXT *ContextRecord, - void * DispatcherContext) +_SEH_FILTER(BaseThreadExceptionFilter) { - EXCEPTION_POINTERS ExceptionInfo; - EXCEPTION_DISPOSITION ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER; + EXCEPTION_POINTERS * ExceptionInfo = _SEH_GetExceptionPointers(); + LONG ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER; - ExceptionInfo.ExceptionRecord = ExceptionRecord; - ExceptionInfo.ContextRecord = ContextRecord; - if (GlobalTopLevelExceptionFilter != NULL) { _SEH_TRY { - ExceptionDisposition = GlobalTopLevelExceptionFilter(&ExceptionInfo); + ExceptionDisposition = GlobalTopLevelExceptionFilter(ExceptionInfo); } _SEH_HANDLE { - ExceptionDisposition = UnhandledExceptionFilter(&ExceptionInfo); + ExceptionDisposition = UnhandledExceptionFilter(ExceptionInfo); } _SEH_END; } - if (ExceptionDisposition == EXCEPTION_EXECUTE_HANDLER) - ExitThread(ExceptionRecord->ExceptionCode); - - /* translate EXCEPTION_XXX defines into EXCEPTION_DISPOSITION enum values */ - if (ExceptionDisposition == EXCEPTION_CONTINUE_EXECUTION) - return ExceptionContinueExecution; - else if (ExceptionDisposition == EXCEPTION_CONTINUE_SEARCH) - return ExceptionContinueSearch; - - return -1; /* unknown return from UnhandledExceptionFilter */ + return ExceptionDisposition; } - __declspec(noreturn) void STDCALL ThreadStartup ( @@ -69,13 +50,16 @@ { volatile UINT uExitCode = 0; - __try1(_except_handler) - { - /* FIXME: notify csrss of thread creation ?? */ - uExitCode = (lpStartAddress)(lpParameter); - } - __except1 - + _SEH_TRY + { + uExitCode = (lpStartAddress)((PVOID)lpParameter); + } + _SEH_EXCEPT(BaseThreadExceptionFilter) + { + uExitCode = _SEH_GetExceptionCode(); + } + _SEH_END; + ExitThread(uExitCode); }
19 years, 6 months
1
0
0
0
[ion] 16131: Some NDK Fixes, kernel32 almost compiles
by ion@svn.reactos.com
Some NDK Fixes, kernel32 almost compiles Modified: trunk/reactos/include/ndk/pstypes.h Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ndk/umtypes.h Modified: trunk/reactos/include/ndk/zwtypes.h _____ Modified: trunk/reactos/include/ndk/pstypes.h --- trunk/reactos/include/ndk/pstypes.h 2005-06-20 03:42:05 UTC (rev 16130) +++ trunk/reactos/include/ndk/pstypes.h 2005-06-20 03:55:42 UTC (rev 16131) @@ -38,7 +38,13 @@ #define USER_SHARED_DATA (0x7FFE0000) -#define PROCESS_PRIORITY_CLASS_NORMAL (2) /* FIXME */ +/* Process priority classes */ +#define PROCESS_PRIORITY_CLASS_HIGH (4) /* FIXME */ +#define PROCESS_PRIORITY_CLASS_IDLE (0) /* FIXME */ +#define PROCESS_PRIORITY_CLASS_NORMAL (2) /* FIXME */ +#define PROCESS_PRIORITY_CLASS_REALTIME (5) /* FIXME */ +#define PROCESS_PRIORITY_CLASS_BELOW_NORMAL (1) /* FIXME */ +#define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL (3) /* FIXME */ /* Global Flags */ #define FLG_STOP_ON_EXCEPTION 0x00000001 _____ Modified: trunk/reactos/include/ndk/rtlfuncs.h --- trunk/reactos/include/ndk/rtlfuncs.h 2005-06-20 03:42:05 UTC (rev 16130) +++ trunk/reactos/include/ndk/rtlfuncs.h 2005-06-20 03:55:42 UTC (rev 16131) @@ -12,8 +12,7 @@ #include <ndk/rtltypes.h> #include <ndk/pstypes.h> -/*FIXME: REORGANIZE THIS */ -/* FIXME: SOME FUNCTIONS MUST BE PROTECTED AGAINST DDK/IFS. */ +/* FIXME: FILE NEEDS TO BE CLEANED UP AT THE END WHEN ALL THE FUNCTIONS HAVE BEEN ADDED */ /* * VOID @@ -675,6 +674,12 @@ BOOLEAN AllocateDestinationString ); +ULONG +STDCALL +RtlAnsiStringToUnicodeSize ( + PANSI_STRING AnsiString + ); + NTSTATUS STDCALL RtlUnicodeToMultiByteN ( @@ -905,7 +910,53 @@ PVOID BaseAddress, ULONG Rva ); + +NTSTATUS +STDCALL +RtlIntegerToChar ( + IN ULONG Value, + IN ULONG Base, + IN ULONG Length, + IN OUT PCHAR String + ); + +NTSTATUS +STDCALL +RtlIntegerToUnicode( + IN ULONG Value, + IN ULONG Base OPTIONAL, + IN ULONG Length OPTIONAL, + IN OUT LPWSTR String + ); + +NTSTATUS +STDCALL +RtlIntegerToUnicodeString ( + IN ULONG Value, + IN ULONG Base, + IN OUT PUNICODE_STRING String + ); + + NTSTATUS +STDCALL +RtlCharToInteger ( + PCSZ String, + ULONG Base, + PULONG Value + ); + +USHORT FASTCALL +RtlUshortByteSwap (IN USHORT Source); + +ULONG +STDCALL +RtlIsTextUnicode ( + PVOID Buffer, + ULONG Length, + ULONG *Flags + ); + NTSTATUS STDCALL RtlInitializeSid ( @@ -922,6 +973,13 @@ IN PUSHORT CaseTableBase, OUT PNLSTABLEINFO NlsTable ); + +VOID +STDCALL +RtlInitCodePageTable ( + IN PUSHORT TableBase, + OUT PCPTABLEINFO CodePageTable + ); NTSTATUS STDCALL @@ -1110,9 +1168,20 @@ IN PUNICODE_STRING SourceString, IN BOOLEAN AllocateDestinationString ); + +NTSTATUS STDCALL +RtlSetTimeZoneInformation (IN OUT LPTIME_ZONE_INFORMATION TimeZoneInformation); NTSTATUS STDCALL +RtlUpcaseUnicodeString ( + IN OUT PUNICODE_STRING DestinationString, + IN PCUNICODE_STRING SourceString, + IN BOOLEAN AllocateDestinationString + ); + +NTSTATUS +STDCALL RtlUnicodeStringToOemString ( IN OUT POEM_STRING DestinationString, IN PUNICODE_STRING SourceString, @@ -1137,6 +1206,19 @@ IN ULONG Length, IN OUT PCHAR String ); + + NTSTATUS +STDCALL +RtlVerifyVersionInfo( + IN PRTL_OSVERSIONINFOEXW VersionInfo, + IN ULONG TypeMask, + IN ULONGLONG ConditionMask + ); + +NTSTATUS +STDCALL +RtlGetVersion( + IN OUT PRTL_OSVERSIONINFOW lpVersionInformation); BOOLEAN STDCALL @@ -1187,7 +1269,37 @@ PEXCEPTION_RECORD ExceptionRecord, DWORD EaxValue ); - + +HANDLE STDCALL +RtlDestroyHeap (HANDLE hheap); + +PVOID STDCALL +RtlReAllocateHeap ( + HANDLE Heap, + ULONG Flags, + PVOID Ptr, + ULONG Size + ); +BOOLEAN STDCALL +RtlLockHeap (IN HANDLE Heap); + +BOOLEAN STDCALL +RtlUnlockHeap (IN HANDLE Heap); + +ULONG STDCALL +RtlSizeHeap( + IN PVOID HeapHandle, + IN ULONG Flags, + IN PVOID MemoryPointer + ); + +BOOLEAN STDCALL +RtlValidateHeap ( + HANDLE Heap, + ULONG Flags, + PVOID pmem + ); + BOOLEAN STDCALL RtlValidSid ( _____ Modified: trunk/reactos/include/ndk/umtypes.h --- trunk/reactos/include/ndk/umtypes.h 2005-06-20 03:42:05 UTC (rev 16130) +++ trunk/reactos/include/ndk/umtypes.h 2005-06-20 03:55:42 UTC (rev 16131) @@ -61,34 +61,6 @@ #define FSCTL_MAILSLOT_PEEK \ CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA) -/* I/O Control Codes for communicating with Network Drivers */ -#define IOCTL_REDIR_QUERY_PATH \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_SET_CONFIGURATION_INFO \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_GET_CONFIGURATION_INFO \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_GET_CONNECTION_INFO \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_ENUMERATE_CONNECTIONS \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_DELETE_CONNECTION \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_GET_STATISTICS \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_SET_DOMAIN_NAME \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT \ - CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS) - /* I/O Control Codes for communicating with Pipes */ #define FSCTL_PIPE_ASSIGN_EVENT \ CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -186,6 +158,7 @@ /* Device Charactertics */ #define FILE_REMOVABLE_MEDIA 0x00000001 +#define FILE_REMOTE_DEVICE 0x00000010 /* SID Constants */ #define SID_MAX_SUB_AUTHORITIES 15 @@ -283,6 +256,12 @@ SynchronizationTimer } TIMER_TYPE; +typedef enum _WAIT_TYPE +{ + WaitAll, + WaitAny +} WAIT_TYPE; + typedef enum _INTERFACE_TYPE { InterfaceTypeUndefined = -1, @@ -582,12 +561,12 @@ typedef UCHAR KIRQL, *PKIRQL; typedef ULONG KAFFINITY, *PKAFFINITY; typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK; -typedef ULONG WAIT_TYPE; typedef struct _PEB *PPEB; typedef ULONG KPROCESSOR_MODE; typedef struct _OBJECT_TYPE *POBJECT_TYPE; struct _ETHREAD; struct _EVENT_TRACE_HEADER; /* <--- We might want to declare this one */ +typedef ULONG EXECUTION_STATE; /* Basic NT Types */ typedef struct _UNICODE_STRING @@ -925,13 +904,35 @@ ULONG Characteristics; } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION; +typedef struct _FILE_FS_ATTRIBUTE_INFORMATION +{ + ULONG FileSystemAttributes; + ULONG MaximumComponentNameLength; + ULONG FileSystemNameLength; + WCHAR FileSystemName[1]; +} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION; + +typedef struct _FILE_FS_SIZE_INFORMATION +{ + LARGE_INTEGER TotalAllocationUnits; + LARGE_INTEGER AvailableAllocationUnits; + ULONG SectorsPerAllocationUnit; + ULONG BytesPerSector; +} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION; + +typedef struct _FILE_FS_LABEL_INFORMATION +{ + ULONG VolumeLabelLength; + WCHAR VolumeLabel[1]; +} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION; + typedef struct _FILE_FS_VOLUME_INFORMATION { - LARGE_INTEGER VolumeCreationTime; - ULONG VolumeSerialNumber; - ULONG VolumeLabelLength; - BOOLEAN SupportsObjects; - WCHAR VolumeLabel[1]; + LARGE_INTEGER VolumeCreationTime; + ULONG VolumeSerialNumber; + ULONG VolumeLabelLength; + BOOLEAN SupportsObjects; + WCHAR VolumeLabel[1]; } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION; /* @@ -941,19 +942,19 @@ /* Class 0 */ typedef struct _KEY_VALUE_ENTRY { - PUNICODE_STRING ValueName; - ULONG DataLength; - ULONG DataOffset; - ULONG Type; + PUNICODE_STRING ValueName; + ULONG DataLength; + ULONG DataOffset; + ULONG Type; } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; /* Class 1 */ typedef struct _KEY_VALUE_PARTIAL_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG DataLength; - UCHAR Data[1]; + ULONG TitleIndex; + ULONG Type; + ULONG DataLength; + UCHAR Data[1]; } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; /* Class 2 */ @@ -989,21 +990,6 @@ WCHAR Name[1]; } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; -/* - * Process - */ - -/* Class 0 */ -typedef struct _PROCESS_BASIC_INFORMATION -{ - NTSTATUS ExitStatus; - PPEB PebBaseAddress; - KAFFINITY AffinityMask; - KPRIORITY BasePriority; - ULONG UniqueProcessId; - ULONG InheritedFromUniqueProcessId; -} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; - /* File Pipe Structures for the FSCTLs */ typedef struct _FILE_PIPE_WAIT_FOR_BUFFER { _____ Modified: trunk/reactos/include/ndk/zwtypes.h --- trunk/reactos/include/ndk/zwtypes.h 2005-06-20 03:42:05 UTC (rev 16130) +++ trunk/reactos/include/ndk/zwtypes.h 2005-06-20 03:55:42 UTC (rev 16131) @@ -17,6 +17,9 @@ /* CONSTANTS *****************************************************************/ #define MAX_BUS_NAME 24 +#define EVENT_READ_ACCESS 1 +#define EVENT_WRITE_ACCESS 2 + #define EVENT_PAIR_ALL_ACCESS (0x1F0000L) /* ENUMERATIONS **************************************************************/ @@ -381,6 +384,35 @@ /* * Process */ + +/* Class 0 */ +typedef struct _PROCESS_BASIC_INFORMATION +{ + NTSTATUS ExitStatus; + PPEB PebBaseAddress; + KAFFINITY AffinityMask; + KPRIORITY BasePriority; + ULONG UniqueProcessId; + ULONG InheritedFromUniqueProcessId; +} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; + + +/* Class 4 */ +typedef struct _KERNEL_USER_TIMES +{ + LARGE_INTEGER CreateTime; + LARGE_INTEGER ExitTime; + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; +} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES; + +/* Class 16 */ +typedef struct _PROCESS_PRIORITY_CLASS +{ + BOOLEAN Foreground; + UCHAR PriorityClass; +} PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS; + /* Class 23 */ typedef struct _PROCESS_DEVICEMAP_INFORMATION { @@ -398,6 +430,12 @@ }; } PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION; +/* Class 24 */ +typedef struct _PROCESS_SESSION_INFORMATION +{ + ULONG SessionId; +} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION; + /* * System */
19 years, 6 months
1
0
0
0
[hyperion] 16130: Converted kernel32 process creation to use PSEH (untested change to help Alex)
by hyperion@svn.reactos.com
Converted kernel32 process creation to use PSEH (untested change to help Alex) Modified: trunk/reactos/lib/kernel32/process/create.c _____ Modified: trunk/reactos/lib/kernel32/process/create.c --- trunk/reactos/lib/kernel32/process/create.c 2005-06-20 01:52:47 UTC (rev 16129) +++ trunk/reactos/lib/kernel32/process/create.c 2005-06-20 03:42:05 UTC (rev 16130) @@ -276,45 +276,25 @@ } -static EXCEPTION_DISPOSITION __cdecl -_except_handler(EXCEPTION_RECORD *ExceptionRecord, - void * EstablisherFrame, - CONTEXT *ContextRecord, - void * DispatcherContext) +_SEH_FILTER(BaseExceptionFilter) { - EXCEPTION_POINTERS ExceptionInfo; - EXCEPTION_DISPOSITION ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER; + EXCEPTION_POINTERS * ExceptionInfo = _SEH_GetExceptionPointers(); + LONG ExceptionDisposition = EXCEPTION_EXECUTE_HANDLER; - ExceptionInfo.ExceptionRecord = ExceptionRecord; - ExceptionInfo.ContextRecord = ContextRecord; - if (GlobalTopLevelExceptionFilter != NULL) { _SEH_TRY { - ExceptionDisposition = GlobalTopLevelExceptionFilter(&ExceptionInfo); + ExceptionDisposition = GlobalTopLevelExceptionFilter(ExceptionInfo); } _SEH_HANDLE { - ExceptionDisposition = UnhandledExceptionFilter(&ExceptionInfo); + ExceptionDisposition = UnhandledExceptionFilter(ExceptionInfo); } _SEH_END; } - if (ExceptionDisposition == EXCEPTION_EXECUTE_HANDLER) - ExitProcess(ExceptionRecord->ExceptionCode); - - /* translate EXCEPTION_XXX defines into EXCEPTION_DISPOSITION enum values */ - if (ExceptionDisposition == EXCEPTION_CONTINUE_EXECUTION) - { - return ExceptionContinueExecution; - } - else if (ExceptionDisposition == EXCEPTION_CONTINUE_SEARCH) - { - return ExceptionContinueSearch; - } - - return -1; /* unknown return from UnhandledExceptionFilter */ + return ExceptionDisposition; } @@ -326,10 +306,15 @@ DPRINT("BaseProcessStart(..) - setting up exception frame.\n"); - __try1(_except_handler) + _SEH_TRY { uExitCode = (lpStartAddress)((PVOID)lpParameter); - } __except1 + } + _SEH_EXCEPT(BaseExceptionFilter) + { + uExitCode = _SEH_GetExceptionCode(); + } + _SEH_END; ExitProcess(uExitCode); }
19 years, 6 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
65
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
Results per page:
10
25
50
100
200