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
August 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
23 participants
669 discussions
Start a n
N
ew thread
[navaraf] 16968: - Remove the DoneInitYet hack.
by navaraf@svn.reactos.com
- Remove the DoneInitYet hack. - Add stub for PsSetProcessPriorityByClass. - Rename PsSetProcessWin32WindowStation to PsSetProcessWindowStation. Modified: trunk/reactos/ntoskrnl/ke/kthread.c Modified: trunk/reactos/ntoskrnl/ntoskrnl.def Modified: trunk/reactos/ntoskrnl/ps/process.c Modified: trunk/reactos/ntoskrnl/ps/psmgr.c _____ Modified: trunk/reactos/ntoskrnl/ke/kthread.c --- trunk/reactos/ntoskrnl/ke/kthread.c 2005-08-02 13:21:18 UTC (rev 16967) +++ trunk/reactos/ntoskrnl/ke/kthread.c 2005-08-02 13:52:10 UTC (rev 16968) @@ -28,7 +28,6 @@ LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY]; static ULONG PriorityListMask = 0; ULONG IdleProcessorMask = 0; -extern BOOLEAN DoneInitYet; extern PETHREAD PspReaperList; /* FUNCTIONS *****************************************************************/ @@ -232,7 +231,7 @@ { KIRQL OldIrql; - if (!DoneInitYet || KeGetCurrentPrcb()->IdleThread == NULL) { + if (KeGetCurrentPrcb()->IdleThread == NULL) { return; } _____ Modified: trunk/reactos/ntoskrnl/ntoskrnl.def --- trunk/reactos/ntoskrnl/ntoskrnl.def 2005-08-02 13:21:18 UTC (rev 16967) +++ trunk/reactos/ntoskrnl/ntoskrnl.def 2005-08-02 13:52:10 UTC (rev 16968) @@ -936,9 +936,10 @@ PsSetJobUIRestrictionsClass@8 PsSetLegoNotifyRoutine@4 PsSetProcessPriorityClass@8 +PsSetProcessPriorityByClass@8 PsSetProcessSecurityPort@8 PsSetProcessWin32Process@8 -PsSetProcessWin32WindowStation@8 +PsSetProcessWindowStation@8 PsSetThreadHardErrorsAreDisabled@8 PsSetThreadWin32Thread@8 PsSetLoadImageNotifyRoutine@4 _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-08-02 13:21:18 UTC (rev 16967) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-08-02 13:52:10 UTC (rev 16968) @@ -753,13 +753,25 @@ */ VOID STDCALL -PsSetProcessWin32WindowStation(PEPROCESS Process, - PVOID WindowStation) +PsSetProcessWindowStation(PEPROCESS Process, + PVOID WindowStation) { Process->Win32WindowStation = WindowStation; } /* + * @unimplemented + */ +NTSTATUS +STDCALL +PsSetProcessPriorityByClass(IN PEPROCESS Process, + IN ULONG Type) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +/* * FUNCTION: Creates a process. * ARGUMENTS: * ProcessHandle (OUT) = Caller supplied storage for the resulting _____ Modified: trunk/reactos/ntoskrnl/ps/psmgr.c --- trunk/reactos/ntoskrnl/ps/psmgr.c 2005-08-02 13:21:18 UTC (rev 16967) +++ trunk/reactos/ntoskrnl/ps/psmgr.c 2005-08-02 13:52:10 UTC (rev 16968) @@ -33,8 +33,6 @@ STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, THREAD_ALL_ACCESS}; -BOOLEAN DoneInitYet = FALSE; - extern ULONG NtBuildNumber; extern ULONG NtMajorVersion; extern ULONG NtMinorVersion; @@ -104,8 +102,6 @@ DPRINT("FirstThread %x\n",FirstThread); - DoneInitYet = TRUE; - ExInitializeWorkItem(&PspReaperWorkItem, PspReapRoutine, NULL); }
19 years, 4 months
1
0
0
0
[navaraf] 16967: Remove duplicate definitions.
by navaraf@svn.reactos.com
Remove duplicate definitions. Modified: trunk/reactos/lib/rtl/version.c _____ Modified: trunk/reactos/lib/rtl/version.c --- trunk/reactos/lib/rtl/version.c 2005-08-02 11:23:40 UTC (rev 16966) +++ trunk/reactos/lib/rtl/version.c 2005-08-02 13:21:18 UTC (rev 16967) @@ -240,26 +240,9 @@ Header hell made me do it, don't blame me. Please move these somewhere more sensible */ -#define VER_EQUAL 1 -#define VER_GREATER 2 -#define VER_GREATER_EQUAL 3 -#define VER_LESS 4 -#define VER_LESS_EQUAL 5 -#define VER_AND 6 -#define VER_OR 7 - #define VER_CONDITION_MASK 7 #define VER_NUM_BITS_PER_CONDITION_MASK 3 -#define VER_MINORVERSION 0x0000001 -#define VER_MAJORVERSION 0x0000002 -#define VER_BUILDNUMBER 0x0000004 -#define VER_PLATFORMID 0x0000008 -#define VER_SERVICEPACKMINOR 0x0000010 -#define VER_SERVICEPACKMAJOR 0x0000020 -#define VER_SUITENAME 0x0000040 -#define VER_PRODUCT_TYPE 0x0000080 - /* * @implemented */
19 years, 4 months
1
0
0
0
[weiden] 16966: fixed the CONTAINING_RECORD macro
by weiden@svn.reactos.com
fixed the CONTAINING_RECORD macro Modified: trunk/reactos/tools/mkhive/registry.h Modified: trunk/reactos/w32api/include/ddk/winddk.h Modified: trunk/reactos/w32api/include/winnt.h _____ Modified: trunk/reactos/tools/mkhive/registry.h --- trunk/reactos/tools/mkhive/registry.h 2005-08-02 03:56:29 UTC (rev 16965) +++ trunk/reactos/tools/mkhive/registry.h 2005-08-02 11:23:40 UTC (rev 16966) @@ -213,8 +213,8 @@ * Type = Type of the whole structure * Field = Name of the field whose address is none */ -#define CONTAINING_RECORD(Address,Type,Field) \ - (Type *)(((LONG)Address) - FIELD_OFFSET(Type,Field)) +#define CONTAINING_RECORD(address, type, field) \ + ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) #define REG_NONE 0 _____ Modified: trunk/reactos/w32api/include/ddk/winddk.h --- trunk/reactos/w32api/include/ddk/winddk.h 2005-08-02 03:56:29 UTC (rev 16965) +++ trunk/reactos/w32api/include/ddk/winddk.h 2005-08-02 11:23:40 UTC (rev 16966) @@ -4744,8 +4744,8 @@ * IN PCHAR Field); */ #ifndef CONTAINING_RECORD -#define CONTAINING_RECORD(Address, Type, Field) \ - ((Type *) (((ULONG_PTR) Address) - FIELD_OFFSET(Type, Field))) +#define CONTAINING_RECORD(address, type, field) \ + ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) #endif /* LONG _____ Modified: trunk/reactos/w32api/include/winnt.h --- trunk/reactos/w32api/include/winnt.h 2005-08-02 03:56:29 UTC (rev 16965) +++ trunk/reactos/w32api/include/winnt.h 2005-08-02 11:23:40 UTC (rev 16966) @@ -890,7 +890,7 @@ #define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) #ifndef CONTAINING_RECORD #define CONTAINING_RECORD(address, type, field) \ - ((type*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field))) + ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) #endif /* end winddk.h */ #define IMAGE_SIZEOF_FILE_HEADER 20
19 years, 4 months
1
0
0
0
[ion] 16965: - Add access state functions.
by ion@svn.reactos.com
- Add access state functions. Modified: trunk/reactos/include/ndk/sefuncs.h _____ Modified: trunk/reactos/include/ndk/sefuncs.h --- trunk/reactos/include/ndk/sefuncs.h 2005-08-01 19:42:19 UTC (rev 16964) +++ trunk/reactos/include/ndk/sefuncs.h 2005-08-02 03:56:29 UTC (rev 16965) @@ -27,12 +27,32 @@ NTSTATUS STDCALL +SeCreateAccessState( + PACCESS_STATE AccessState, + PAUX_DATA AuxData, + ACCESS_MASK Access, + PGENERIC_MAPPING GenericMapping +); + +VOID +STDCALL +SeDeleteAccessState(IN PACCESS_STATE AccessState); + +NTSTATUS +STDCALL SeReleaseSecurityDescriptor( IN PSECURITY_DESCRIPTOR CapturedSecurityDescriptor, IN KPROCESSOR_MODE CurrentMode, IN BOOLEAN CaptureIfKernelMode ); +VOID +STDCALL +SeSetAccessStateGenericMapping( + IN PACCESS_STATE AccessState, + IN PGENERIC_MAPPING GenericMapping +); + SECURITY_IMPERSONATION_LEVEL STDCALL SeTokenImpersonationLevel(
19 years, 4 months
1
0
0
0
[ekohl] 16964: Implement CM_Get_DevNode_Registry_Property[_Ex]A/W and CM_Set_DevNode_Registry_Property[_Ex]A/W partially.
by ekohl@svn.reactos.com
Implement CM_Get_DevNode_Registry_Property[_Ex]A/W and CM_Set_DevNode_Registry_Property[_Ex]A/W partially. Modified: trunk/reactos/include/idl/pnp.idl Modified: trunk/reactos/include/wine/cfgmgr32.h Modified: trunk/reactos/lib/setupapi/cfgmgr.c Modified: trunk/reactos/lib/setupapi/setupapi.spec Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/w32api/include/ddk/cfgmgr32.h _____ Modified: trunk/reactos/include/idl/pnp.idl --- trunk/reactos/include/idl/pnp.idl 2005-08-01 18:11:54 UTC (rev 16963) +++ trunk/reactos/include/idl/pnp.idl 2005-08-01 19:42:19 UTC (rev 16964) @@ -39,11 +39,36 @@ [in] DWORD Length, [in] DWORD Flags); + CONFIGRET PNP_EnumerateSubKeys(handle_t BindingHandle, + [in] unsigned long Branch, + [in] unsigned long Index, + [out, string, size_is(Length)] wchar_t *Buffer, + [in] unsigned long Length, + [out] unsigned long *RequiredLength, + [in] DWORD Flags); + CONFIGRET PNP_GetDepth(handle_t BindingHandle, [in, string] wchar_t *DeviceInstance, [out] unsigned long *Depth, [in] DWORD Flags); + CONFIGRET PNP_GetDeviceRegProp(handle_t BindingHandle, + [in, string] wchar_t *DeviceInstance, + [in] unsigned long Property, + [in, out] unsigned long *DataType, + [out, size_is(*TransferLen)] char *Buffer, + [in, out] unsigned long *TransferLen, + [in, out] unsigned long *Length, + [in] DWORD Flags); + + CONFIGRET PNP_SetDeviceRegProp(handle_t BindingHandle, + [in, string] wchar_t *DeviceId, + [in] unsigned long Property, + [in] unsigned long DataType, + [in, size_is(Length)] char *Buffer, + [in] unsigned long Length, + [in] unsigned long Flags); + CONFIGRET PNP_GetDeviceStatus(handle_t BindingHandle, [in, string] wchar_t *DeviceInstance, [out] unsigned long *Status, _____ Modified: trunk/reactos/include/wine/cfgmgr32.h --- trunk/reactos/include/wine/cfgmgr32.h 2005-08-01 18:11:54 UTC (rev 16963) +++ trunk/reactos/include/wine/cfgmgr32.h 2005-08-01 19:42:19 UTC (rev 16964) @@ -50,10 +50,12 @@ #define CR_REGISTRY_ERROR 0x0000001D #define CR_INVALID_DEVICE_ID 0x0000001E #define CR_INVALID_DATA 0x0000001F -#define CR_NO_SUCH_VALUE 0x00000025 +#define CR_NO_SUCH_VALUE 0x00000025 #define CR_NO_SUCH_REGISTRY_KEY 0x0000002E #define CR_INVALID_MACHINENAME 0x0000002F #define CR_ACCESS_DENIED 0x00000033 +#define CR_CALL_NOT_IMPLEMENTED 0x00000034 +#define CR_INVALID_PROPERTY 0x00000035 #define MAX_CLASS_NAME_LEN 32 #define MAX_GUID_STRING_LEN 39 @@ -105,6 +107,14 @@ CONFIGRET WINAPI CM_Get_Child_Ex( PDEVINST, DEVINST, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Depth( PULONG, DEVINST, ULONG ); CONFIGRET WINAPI CM_Get_Depth_Ex( PULONG, DEVINST, ULONG, HMACHINE ); +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG ); +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG ); +#define CM_Get_DevNode_Registry_Property WINELIB_NAME_AW(CM_Get_DevNode_Registry_Property) +CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExA( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG, HMACHINE ); +CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG, HMACHINE ); +#define CM_Get_DevNode_Registry_Property_Ex WINELIB_NAME_AW(CM_Get_DevNode_Registry_Property_Ex) +CONFIGRET WINAPI CM_Get_DevNode_Status( PULONG, PULONG, DEVINST, ULONG ); +CONFIGRET WINAPI CM_Get_DevNode_Status_Ex( PULONG, PULONG, DEVINST, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Device_IDA( DEVINST, PCHAR, ULONG, ULONG ); CONFIGRET WINAPI CM_Get_Device_IDW( DEVINST, PWCHAR, ULONG, ULONG ); #define CM_Get_Device_ID WINELIB_NAME_AW(CM_Get_Device_ID) @@ -125,8 +135,6 @@ #define CM_Get_Device_ID_List_Size_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Size_Ex) CONFIGRET WINAPI CM_Get_Device_ID_Size( PULONG, DEVINST, ULONG ); CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex( PULONG, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_DevNode_Status( PULONG, PULONG, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_DevNode_Status_Ex( PULONG, PULONG, DEVINST, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Global_State( PULONG, ULONG ); CONFIGRET WINAPI CM_Get_Global_State_Ex( PULONG, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Parent( PDEVINST, DEVINST, ULONG ); @@ -152,5 +160,11 @@ CONFIGRET WINAPI CM_Set_DevNode_Problem( DEVINST, ULONG, ULONG ); CONFIGRET WINAPI CM_Set_DevNode_Problem_Ex( DEVINST, ULONG, ULONG, HMACHINE ); +CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyA( DEVINST, ULONG, PCVOID, ULONG, ULONG ); +CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyW( DEVINST, ULONG, PCVOID, ULONG, ULONG ); +#define CM_Set_DevNode_Registry_Property WINELIB_NAME_AW(CM_Set_DevNode_Registry_Property) +CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExA( DEVINST, ULONG, PCVOID, ULONG, ULONG, HMACHINE ); +CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExW( DEVINST, ULONG, PCVOID, ULONG, ULONG, HMACHINE ); +#define CM_Set_DevNode_Registry_Property_Ex WINELIB_NAME_AW(CM_Set_DevNode_Registry_Property_Ex) #endif /* _CFGMGR32_H_ */ _____ Modified: trunk/reactos/lib/setupapi/cfgmgr.c --- trunk/reactos/lib/setupapi/cfgmgr.c 2005-08-01 18:11:54 UTC (rev 16963) +++ trunk/reactos/lib/setupapi/cfgmgr.c 2005-08-01 19:42:19 UTC (rev 16964) @@ -373,6 +373,128 @@ /*********************************************************************** + * CM_Get_DevNode_Registry_PropertyA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA( + DEVINST dnDevInst, ULONG ulProperty, PULONG pulRegDataType, + PVOID Buffer, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%lx %lu %p %p %p %lx\n", + dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength, ulFlags); + + return CM_Get_DevNode_Registry_Property_ExA(dnDevInst, ulProperty, + pulRegDataType, Buffer, + pulLength, ulFlags, NULL); +} + + +/********************************************************************** * + * CM_Get_DevNode_Registry_PropertyW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW( + DEVINST dnDevInst, ULONG ulProperty, PULONG pulRegDataType, + PVOID Buffer, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%lx %lu %p %p %p %lx\n", + dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength, ulFlags); + + return CM_Get_DevNode_Registry_Property_ExW(dnDevInst, ulProperty, + pulRegDataType, Buffer, + pulLength, ulFlags, NULL); +} + + +/********************************************************************** * + * CM_Get_DevNode_Registry_Property_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExA( + DEVINST dnDevInst, ULONG ulProperty, PULONG pulRegDataType, + PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%lx %lu %p %p %p %lx %lx\n", + dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength, + ulFlags, hMachine); + + return CR_CALL_NOT_IMPLEMENTED; +} + + +/********************************************************************** * + * CM_Get_DevNode_Registry_Property_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW( + DEVINST dnDevInst, ULONG ulProperty, PULONG pulRegDataType, + PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + CONFIGRET ret = CR_SUCCESS; + LPWSTR lpDevInst; + ULONG ulDataType = 0; + ULONG ulTransferLength = 0; + + FIXME("%lx %lu %p %p %p %lx %lx\n", + dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength, + ulFlags, hMachine); + + if (dnDevInst == 0) + return CR_INVALID_DEVNODE; + + if (ulProperty < 1 /* CM_DRP_MIN */ || ulProperty > 0x17 /* CM_DRP_MAX */) + return CR_INVALID_PROPERTY; + + /* pulRegDataType is optional */ + + /* Buffer is optional */ + + if (pulLength == NULL) + return CR_INVALID_POINTER; + + if (*pulLength == 0) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + ret = PNP_GetDeviceRegProp(BindingHandle, + lpDevInst, + ulProperty, + &ulDataType, + Buffer, + &ulTransferLength, + pulLength, + ulFlags); + if (ret == CR_SUCCESS) + { + if (pulRegDataType != NULL) + *pulRegDataType = ulDataType; + } + + return ret; +} + + +/********************************************************************** * * CM_Get_DevNode_Status [SETUPAPI.@] */ CONFIGRET WINAPI CM_Get_DevNode_Status( @@ -1171,3 +1293,105 @@ ulProblem, ulFlags); } + + +/********************************************************************** * + * CM_Set_DevNode_Registry_PropertyA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyA( + DEVINST dnDevInst, ULONG ulProperty, PCVOID Buffer, ULONG ulLength, + ULONG ulFlags) +{ + TRACE("%lx %lu %p %lx %lx\n", + dnDevInst, ulProperty, Buffer, ulLength, ulFlags); + return CM_Set_DevNode_Registry_Property_ExA(dnDevInst, ulProperty, + Buffer, ulLength, + ulFlags, NULL); +} + + +/********************************************************************** * + * CM_Set_DevNode_Registry_PropertyW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyW( + DEVINST dnDevInst, ULONG ulProperty, PCVOID Buffer, ULONG ulLength, + ULONG ulFlags) +{ + TRACE("%lx %lu %p %lx %lx\n", + dnDevInst, ulProperty, Buffer, ulLength, ulFlags); + return CM_Set_DevNode_Registry_Property_ExW(dnDevInst, ulProperty, + Buffer, ulLength, + ulFlags, NULL); +} + + +/********************************************************************** * + * CM_Set_DevNode_Registry_Property_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExA( + DEVINST dnDevInst, ULONG ulProperty, PCVOID Buffer, ULONG ulLength, + ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%lx %lu %p %lx %lx %lx\n", + dnDevInst, ulProperty, Buffer, ulLength, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/********************************************************************** * + * CM_Set_DevNode_Registry_Property_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExW( + DEVINST dnDevInst, ULONG ulProperty, PCVOID Buffer, ULONG ulLength, + ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + ULONG ulType; + + FIXME("%lx %lu %p %lx %lx %lx\n", + dnDevInst, ulProperty, Buffer, ulLength, ulFlags, hMachine); + + if (dnDevInst == 0) + return CR_INVALID_DEVNODE; + + if (ulProperty < 1 /* CM_DRP_MIN */ || ulProperty > 0x17 /* CM_DRP_MAX */) + return CR_INVALID_PROPERTY; + + if (Buffer != NULL && ulLength == 0) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpDevInst = StringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + ulType = REG_SZ; /* FIXME */ + + return PNP_SetDeviceRegProp(BindingHandle, + lpDevInst, + ulProperty, + ulType, + (char *)Buffer, + ulLength, + ulFlags); +} _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-08-01 18:11:54 UTC (rev 16963) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-08-01 19:42:19 UTC (rev 16964) @@ -65,10 +65,10 @@ @ stub CM_Get_Class_Name_ExW @ stdcall CM_Get_Depth(ptr long long) @ stdcall CM_Get_Depth_Ex(ptr long long long) -@ stub CM_Get_DevNode_Registry_PropertyA -@ stub CM_Get_DevNode_Registry_PropertyW -@ stub CM_Get_DevNode_Registry_Property_ExA -@ stub CM_Get_DevNode_Registry_Property_ExW +@ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) +@ stdcall CM_Get_DevNode_Registry_PropertyW(long long ptr ptr ptr long) +@ stdcall CM_Get_DevNode_Registry_Property_ExA(long long ptr ptr ptr long long) +@ stdcall CM_Get_DevNode_Registry_Property_ExW(long long ptr ptr ptr long long) @ stdcall CM_Get_DevNode_Status(ptr ptr long long) @ stdcall CM_Get_DevNode_Status_Ex(ptr ptr long long long) @ stdcall CM_Get_Device_IDA(long str long long) @@ -172,10 +172,10 @@ @ stub CM_Run_Detection_Ex @ stdcall CM_Set_DevNode_Problem(long long long) @ stdcall CM_Set_DevNode_Problem_Ex(long long long long) -@ stub CM_Set_DevNode_Registry_PropertyA -@ stub CM_Set_DevNode_Registry_PropertyW -@ stub CM_Set_DevNode_Registry_Property_ExA -@ stub CM_Set_DevNode_Registry_Property_ExW +@ stdcall CM_Set_DevNode_Registry_PropertyA(long long ptr long long) +@ stdcall CM_Set_DevNode_Registry_PropertyW(long long ptr long long) +@ stdcall CM_Set_DevNode_Registry_Property_ExA(long long ptr long long long) +@ stdcall CM_Set_DevNode_Registry_Property_ExW(long long ptr long long long) @ stub CM_Set_HW_Prof @ stub CM_Set_HW_Prof_Ex @ stub CM_Set_HW_Prof_FlagsA _____ Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c --- trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-08-01 18:11:54 UTC (rev 16963) +++ trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-08-01 19:42:19 UTC (rev 16964) @@ -54,6 +54,9 @@ static WCHAR szRootDeviceId[] = L"HTREE\\ROOT\\0"; +static HKEY hEnumKey = NULL; +static HKEY hClassKey = NULL; + /* FUNCTIONS *****************************************************************/ static DWORD WINAPI @@ -237,7 +240,7 @@ } DPRINT("PNP_GetRelatedDeviceInstance() done (returns %lx)\n", ret); - if (ret == 0) + if (ret == CR_SUCCESS) { DPRINT("RelatedDevice: %wZ\n", &PlugPlayData.RelatedDeviceInstance); } @@ -247,6 +250,59 @@ CONFIGRET +PNP_EnumerateSubKeys(handle_t BindingHandle, + unsigned long Branch, + unsigned long Index, + wchar_t *Buffer, + unsigned long Length, + unsigned long *RequiredLength, + DWORD Flags) +{ + CONFIGRET ret = CR_SUCCESS; + HKEY hKey; + DWORD dwError; + + DPRINT1("PNP_EnumerateSubKeys() called\n"); + + switch (Branch) + { + case 1: + hKey = hEnumKey; + break; + + case 2: + hKey = hClassKey; + break; + + default: + return CR_FAILURE; + } + + *RequiredLength = Length; + dwError = RegEnumKeyExW(hKey, + Index, + Buffer, + RequiredLength, + NULL, + NULL, + NULL, + NULL); + if (dwError != ERROR_SUCCESS) + { + ret = CR_FAILURE; + } + + DPRINT1("PNP_EnumerateSubKeys() done (returns %lx)\n", ret); + if (ret == CR_SUCCESS) + { + DPRINT1("Sub key: %S\n", Buffer); + } + + return ret; +} + + +CONFIGRET PNP_GetDepth(handle_t BindingHandle, wchar_t *DeviceInstance, unsigned long *Depth, @@ -256,7 +312,7 @@ CONFIGRET ret = CR_SUCCESS; NTSTATUS Status; - DPRINT1("PNP_GetDepth() called\n"); + DPRINT("PNP_GetDepth() called\n"); RtlInitUnicodeString(&PlugPlayData.DeviceInstance, DeviceInstance); @@ -273,13 +329,66 @@ ret = CR_FAILURE; /* FIXME */ } - DPRINT1("PNP_GetDepth() done (returns %lx)\n", ret); + DPRINT("PNP_GetDepth() done (returns %lx)\n", ret); return ret; } CONFIGRET +PNP_SetDeviceRegProp(handle_t BindingHandle, + wchar_t *DeviceId, + unsigned long Property, + unsigned long DataType, + char *Buffer, + unsigned long Length, + unsigned long Flags) +{ + CONFIGRET ret = CR_SUCCESS; +// ULONG Data; + + DPRINT1("PNP_SetDeviceRegProp() called\n"); + + DPRINT1("DeviceId: %S\n", DeviceId); + + DPRINT1("Property: %lu\n", Property); + DPRINT1("DataType: %lu\n", DataType); + DPRINT1("Length: %lu\n", Length); + + DPRINT1("Data: %lx\n", *((PULONG)Buffer)); + + DPRINT1("PNP_SetDeviceRegProp() done (returns %lx)\n", ret); + + return ret; +} + + +CONFIGRET +PNP_GetDeviceRegProp(handle_t BindingHandle, + wchar_t *DeviceInstance, + unsigned long Property, + unsigned long *DataType, + char *Buffer, + unsigned long *TransferLen, + unsigned long *Length, + DWORD Flags) +{ + CONFIGRET ret = CR_SUCCESS; + ULONG Data; + + DPRINT1("PNP_GetDeviceRegProp() called\n"); + + Data = 0xbaadf00d; + memcpy(Buffer, &Data, sizeof(ULONG)); + *Length = sizeof(ULONG); + + DPRINT1("PNP_GetDeviceRegProp() done (returns %lx)\n", ret); + + return ret; +} + + +CONFIGRET PNP_GetDeviceStatus(handle_t BindingHandle, wchar_t *DeviceInstance, unsigned long *pStatus, @@ -290,7 +399,7 @@ CONFIGRET ret = CR_SUCCESS; NTSTATUS Status; - DPRINT1("PNP_GetDeviceStatus() called\n"); + DPRINT("PNP_GetDeviceStatus() called\n"); RtlInitUnicodeString(&PlugPlayData.DeviceInstance, DeviceInstance); @@ -309,7 +418,7 @@ ret = CR_FAILURE; /* FIXME */ } - DPRINT1("PNP_GetDeviceStatus() done (returns %lx)\n", ret); + DPRINT("PNP_GetDeviceStatus() done (returns %lx)\n", ret); return ret; } @@ -424,8 +533,32 @@ int main(int argc, char *argv[]) { + DWORD dwError; + DPRINT("Umpnpmgr: main() started\n"); + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Enum", + 0, + KEY_ALL_ACCESS, + &hEnumKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Could not open the Enum Key! (Error %lu)\n", dwError); + return dwError; + } + + dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Control\\Class", + 0, + KEY_ALL_ACCESS, + &hClassKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT1("Could not open the Class Key! (Error %lu)\n", dwError); + return dwError; + } + StartServiceCtrlDispatcher(ServiceTable); DPRINT("Umpnpmgr: main() done\n"); _____ Modified: trunk/reactos/w32api/include/ddk/cfgmgr32.h --- trunk/reactos/w32api/include/ddk/cfgmgr32.h 2005-08-01 18:11:54 UTC (rev 16963) +++ trunk/reactos/w32api/include/ddk/cfgmgr32.h 2005-08-01 19:42:19 UTC (rev 16964) @@ -1017,11 +1017,73 @@ /* FIXME: Obsolete CM_Get_Device_Interface_List_Size_Ex */ /* FIXME: Obsolete CM_Get_DevNode_Custom_Property */ /* FIXME: Obsolete CM_Get_DevNode_Custom_Property_Ex */ -/* FIXME: Obsolete CM_Get_DevNode_Registry_Property */ CMAPI CONFIGRET WINAPI +CM_Get_DevNode_Registry_PropertyA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_PropertyW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_Property_ExA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Get_DevNode_Registry_Property_ExW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + OUT PULONG pulRegDataType, OPTIONAL + OUT PVOID Buffer, OPTIONAL + IN OUT PULONG pulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Get_DevInst_Registry_PropertyW CM_Get_DevNode_Registry_PropertyW +#define CM_Get_DevInst_Registry_PropertyA CM_Get_DevNode_Registry_PropertyA +#define CM_Get_DevInst_Registry_Property_ExW CM_Get_DevNode_Registry_Property_ExW +#define CM_Get_DevInst_Registry_Property_ExA CM_Get_DevNode_Registry_Property_ExA + +#ifdef UNICODE +#define CM_Get_DevInst_Registry_Property CM_Get_DevNode_Registry_PropertyW +#define CM_Get_DevInst_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExW +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyW +#define CM_Get_DevNode_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExW +#else +#define CM_Get_DevInst_Registry_Property CM_Get_DevNode_Registry_PropertyA +#define CM_Get_DevInst_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExA +#define CM_Get_DevNode_Registry_Property CM_Get_DevNode_Registry_PropertyA +#define CM_Get_DevNode_Registry_Property_Ex CM_Get_DevNode_Registry_Property_ExA +#endif /* UNICODE */ + +CMAPI +CONFIGRET +WINAPI CM_Get_DevNode_Status( OUT PULONG pulStatus, OUT PULONG pulProblemNumber, @@ -1513,8 +1575,66 @@ /* FIXME: Obsolete CM_Set_Class_Registry_Property */ /* FIXME: Obsolete CM_Set_DevNode_Problem */ /* FIXME: Obsolete CM_Set_DevNode_Problem_Ex */ -/* FIXME: Obsolete CM_Set_DevNode_Registry_Property */ -/* FIXME: Obsolete CM_Set_DevNode_Registry_Property_Ex */ + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_PropertyA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_PropertyW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_Property_ExA( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +CMAPI +CONFIGRET +WINAPI +CM_Set_DevNode_Registry_Property_ExW( + IN DEVINST dnDevInst, + IN ULONG ulProperty, + IN PCVOID Buffer, OPTIONAL + IN ULONG ulLength, + IN ULONG ulFlags, + IN HMACHINE hMachine); + +#define CM_Set_DevInst_Registry_PropertyW CM_Set_DevNode_Registry_PropertyW +#define CM_Set_DevInst_Registry_PropertyA CM_Set_DevNode_Registry_PropertyA +#define CM_Set_DevInst_Registry_Property_ExW CM_Set_DevNode_Registry_Property_ExW +#define CM_Set_DevInst_Registry_Property_ExA CM_Set_DevNode_Registry_Property_ExA + +#ifdef UNICODE +#define CM_Set_DevInst_Registry_Property CM_Set_DevNode_Registry_PropertyW +#define CM_Set_DevInst_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExW +#define CM_Set_DevNode_Registry_Property CM_Set_DevNode_Registry_PropertyW +#define CM_Set_DevNode_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExW +#else +#define CM_Set_DevInst_Registry_Property CM_Set_DevNode_Registry_PropertyA +#define CM_Set_DevInst_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExA +#define CM_Set_DevNode_Registry_Property CM_Set_DevNode_Registry_PropertyA +#define CM_Set_DevNode_Registry_Property_Ex CM_Set_DevNode_Registry_Property_ExA +#endif /* UNICODE */ + /* FIXME: Obsolete CM_Set_HW_Prof */ /* FIXME: Obsolete CM_Set_HW_Prof_Ex */ /* FIXME: Obsolete CM_Set_HW_Prof_Flags */
19 years, 4 months
1
0
0
0
[navaraf] 16963: Don't fallback to linear search for exports, it's not needed.
by navaraf@svn.reactos.com
Don't fallback to linear search for exports, it's not needed. Modified: trunk/reactos/lib/ntdll/ldr/utils.c _____ Modified: trunk/reactos/lib/ntdll/ldr/utils.c --- trunk/reactos/lib/ntdll/ldr/utils.c 2005-08-01 18:04:49 UTC (rev 16962) +++ trunk/reactos/lib/ntdll/ldr/utils.c 2005-08-01 18:11:54 UTC (rev 16963) @@ -1077,7 +1077,6 @@ PDWORD * ExFunctions; PDWORD * ExNames; USHORT * ExOrdinals; - ULONG i; PVOID ExName; ULONG Ordinal; PVOID Function; @@ -1142,7 +1141,7 @@ } /* - * Try a binary search first + * Binary search */ minn = 0; maxn = ExportDir->NumberOfNames - 1; @@ -1188,31 +1187,6 @@ } } - /* - * Fall back on a linear search - */ - DPRINT("LdrGetExportByName(): Falling back on a linear search of export table\n"); - for (i = 0; i < ExportDir->NumberOfNames; i++) - { - ExName = RVA(BaseAddress, ExNames[i]); - if (strcmp(ExName, (PCHAR)SymbolName) == 0) - { - Ordinal = ExOrdinals[i]; - Function = RVA(BaseAddress, ExFunctions[Ordinal]); - DPRINT("%x %x %x\n", Function, ExportDir, ExportDir + ExportDirSize); - if (((ULONG)Function >= (ULONG)ExportDir) && - ((ULONG)Function < (ULONG)ExportDir + (ULONG)ExportDirSize)) - { - DPRINT("Forward: %s\n", (PCHAR)Function); - Function = LdrFixupForward((PCHAR)Function); - } - if (Function == NULL) - { - break; - } - return Function; - } - } DPRINT1("LdrGetExportByName(): failed to find %s\n",SymbolName); return (PVOID)NULL; }
19 years, 4 months
1
0
0
0
[navaraf] 16962: Don't do linear search for exports, it's not needed.
by navaraf@svn.reactos.com
Don't do linear search for exports, it's not needed. Modified: trunk/reactos/ntoskrnl/ldr/loader.c _____ Modified: trunk/reactos/ntoskrnl/ldr/loader.c --- trunk/reactos/ntoskrnl/ldr/loader.c 2005-08-01 17:58:47 UTC (rev 16961) +++ trunk/reactos/ntoskrnl/ldr/loader.c 2005-08-01 18:04:49 UTC (rev 16962) @@ -1116,7 +1116,7 @@ /* * Don't relocate within the relocation section itself. - * GCC/LD generates sometimes relocation records for the relecotion section. + * GCC/LD generates sometimes relocation records for the relocation section. * This is a bug in GCC/LD. */ if ((ULONG_PTR)ShortPtr < (ULONG_PTR)RelocationDir || @@ -1242,11 +1242,10 @@ PDWORD * ExFunctions; PDWORD * ExNames; USHORT * ExOrdinals; - ULONG i; PVOID ExName; ULONG Ordinal; PVOID Function; - LONG minn, maxn; + LONG minn, maxn, mid, res; ULONG ExportDirSize; DPRINT("LdrPEGetExportByName %x %s %hu\n", BaseAddress, SymbolName, Hint); @@ -1305,15 +1304,12 @@ } /* - * Try a binary search first + * Binary search */ minn = 0; maxn = ExportDir->NumberOfNames - 1; while (minn <= maxn) { - LONG mid; - LONG res; - mid = (minn + maxn) / 2; ExName = RVA(BaseAddress, ExNames[mid]); @@ -1338,11 +1334,6 @@ return Function; } } - else if (minn == maxn) - { - DPRINT("LdrPEGetExportByName(): binary search failed\n"); - break; - } else if (res > 0) { maxn = mid - 1; @@ -1353,31 +1344,7 @@ } } - /* - * Fall back on a linear search - */ - DPRINT("LdrPEGetExportByName(): Falling back on a linear search of export table\n"); - for (i = 0; i < ExportDir->NumberOfNames; i++) - { - ExName = RVA(BaseAddress, ExNames[i]); - if (strcmp(ExName, (PCHAR)SymbolName) == 0) - { - Ordinal = ExOrdinals[i]; - Function = RVA(BaseAddress, ExFunctions[Ordinal]); - DPRINT("%x %x %x\n", Function, ExportDir, ExportDir + ExportDirSize); - if ((ULONG_PTR)Function >= (ULONG_PTR)ExportDir && - (ULONG_PTR)Function < (ULONG_PTR)ExportDir + ExportDirSize) - { - DPRINT("Forward: %s\n", (PCHAR)Function); - Function = LdrPEFixupForward((PCHAR)Function); - } - if (Function == NULL) - { - break; - } - return Function; - } - } + ExName = RVA(BaseAddress, ExNames[mid]); DPRINT1("LdrPEGetExportByName(): failed to find %s\n",SymbolName); return (PVOID)NULL; }
19 years, 4 months
1
0
0
0
[navaraf] 16961: Remove the PESUM tool, the PEFIXUP tool can be used instead.
by navaraf@svn.reactos.com
Remove the PESUM tool, the PEFIXUP tool can be used instead. Deleted: trunk/reactos/apps/utils/pesum/
19 years, 4 months
1
0
0
0
[navaraf] 16960: Add new PEFIXUP tool and use it in the build system.
by navaraf@svn.reactos.com
Add new PEFIXUP tool and use it in the build system. Added: trunk/reactos/tools/pefixup.c Added: trunk/reactos/tools/pefixup.mak Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Modified: trunk/reactos/tools/tools.mak _____ Added: trunk/reactos/tools/pefixup.c --- trunk/reactos/tools/pefixup.c 2005-08-01 16:28:11 UTC (rev 16959) +++ trunk/reactos/tools/pefixup.c 2005-08-01 17:56:41 UTC (rev 16960) @@ -0,0 +1,374 @@ +/* + * PE Fixup Utility + * Copyright (C) 2005 Filip Navara + * + * The purpose of this utility is fix PE binaries generated by binutils and + * to manipulate flags that can't be set by binutils. + * + * Currently two features are implemented: + * + * - Setting flags on PE sections for use by drivers. The sections + * .text, .data, .idata, .bss are marked as non-pageable and + * non-discarable, section PAGE is marked as pageable and section + * INIT is marked as discaradable. + * + * - Sorting of export name table in executables. DLLTOOL has bug + * in sorting algorithm when the --kill-at flag is used. The exports + * are sorted in the decorated form and so the fastcall symbols are + * incorrectly put at the beginning of export table. This option + * allow to correct sort the table, so binary search can be used + * to process them. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <fcntl.h> + +/* The following definitions are ripped from MinGW W32API headers. We don't + use these headers directly in order to allow compilation on Linux hosts. */ + +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef unsigned int DWORD; +typedef int LONG; + +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_SIZEOF_SHORT_NAME 8 +#define IMAGE_DOS_SIGNATURE 0x5A4D +#define IMAGE_NT_SIGNATURE 0x00004550 +#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000 +#define IMAGE_SCN_MEM_NOT_PAGED 0x8000000 +#define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) +#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEAD ERS)(h))->FileHeader.SizeOfOptionalHeader)) +#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 + +#pragma pack(push,2) +typedef struct _IMAGE_DOS_HEADER { + WORD e_magic; + WORD e_cblp; + WORD e_cp; + WORD e_crlc; + WORD e_cparhdr; + WORD e_minalloc; + WORD e_maxalloc; + WORD e_ss; + WORD e_sp; + WORD e_csum; + WORD e_ip; + WORD e_cs; + WORD e_lfarlc; + WORD e_ovno; + WORD e_res[4]; + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; + LONG e_lfanew; +} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; +#pragma pack(pop) +#pragma pack(push,4) +typedef struct _IMAGE_EXPORT_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + DWORD Name; + DWORD Base; + DWORD NumberOfFunctions; + DWORD NumberOfNames; + DWORD AddressOfFunctions; + DWORD AddressOfNames; + DWORD AddressOfNameOrdinals; +} IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY; +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; +typedef struct _IMAGE_OPTIONAL_HEADER { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Reserved1; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER,*PIMAGE_OPTIONAL_HEADER; +typedef struct _IMAGE_NT_HEADERS { + DWORD Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER OptionalHeader; +} IMAGE_NT_HEADERS,*PIMAGE_NT_HEADERS; +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; +#pragma pack(pop) + +/* End of ripped definitions */ + +typedef struct _export_t { + DWORD name; + WORD ordinal; +} export_t; + +unsigned char *buffer; +PIMAGE_DOS_HEADER dos_header; +PIMAGE_NT_HEADERS nt_header; + +void *rva_to_ptr(DWORD rva) +{ + PIMAGE_SECTION_HEADER section_header; + unsigned int i; + + for (i = 0, section_header = IMAGE_FIRST_SECTION(nt_header); + i < nt_header->OptionalHeader.NumberOfRvaAndSizes; + i++, section_header++) + { + if (rva >= section_header->VirtualAddress && + rva < section_header->VirtualAddress + + section_header->Misc.VirtualSize) + { + return buffer + rva - section_header->VirtualAddress + + section_header->PointerToRawData; + } + } + + return NULL; +} + +int export_compare_func(const void *a, const void *b) +{ + const export_t *ap = a; + const export_t *bp = b; + char *an = rva_to_ptr(ap->name); + char *bn = rva_to_ptr(bp->name); + return strcmp(an, bn); +} + +int main(int argc, char **argv) +{ + int fd_in, fd_out; + long len; + PIMAGE_SECTION_HEADER section_header; + PIMAGE_DATA_DIRECTORY data_dir; + unsigned int i; + unsigned long checksum; + int fixup_exports = 0; + int fixup_sections = 0; + + /* + * Process parameters. + */ + + if (argc < 2) + { + printf("Usage: %s <filename> <options>\n" + "Options:\n" + " -sections Sets section flags for PE image.\n" + " -exports Sort the names in export table.\n", + argv[0]); + return 1; + } + + for (i = 2; i < argc; i++) + { + if (!strcmp(argv[i], "-sections")) + fixup_sections = 1; + else if (!strcmp(argv[i], "-exports")) + fixup_exports = 1; + else + { printf("Invalid option: %s\n", argv[i]); return 1; } + } + + if (fixup_sections == 0 && fixup_exports == 0) + { + printf("Nothing to do.\n"); + return 0; + } + + /* + * Read the whole file to memory. + */ + + fd_in = open(argv[1], O_RDONLY | O_BINARY); + if (fd_in == 0) + { + printf("Can't open input file.\n"); + return 1; + } + + len = lseek(fd_in, 0, SEEK_END); + if (len < sizeof(IMAGE_DOS_HEADER)) + { + close(fd_in); + printf("'%s' isn't a PE image.\n", argv[1]); + return 1; + } + + buffer = malloc((len + 1) & ~1); + if (buffer == NULL) + { + close(fd_in); + printf("Not enough memory available.\n"); + return 1; + } + + /* Read the whole input file into a buffer */ + lseek(fd_in, 0, SEEK_SET); + read(fd_in, buffer, len); + if (len & 1) + buffer[len] = 0; + + close(fd_in); + + /* + * Check the headers and save pointers to them. + */ + + dos_header = (PIMAGE_DOS_HEADER)buffer; + nt_header = (PIMAGE_NT_HEADERS)(buffer + dos_header->e_lfanew); + + if (dos_header->e_magic != IMAGE_DOS_SIGNATURE || + nt_header->Signature != IMAGE_NT_SIGNATURE) + { + printf("'%s' isn't a PE image.\n", argv[1]); + free(buffer); + return 1; + } + + if (fixup_exports) + { + /* Sort export directory */ + data_dir = &nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT]; + if (data_dir->Size != 0) + { + PIMAGE_EXPORT_DIRECTORY export_directory; + DWORD *name_ptr; + WORD *ordinal_ptr; + export_t *exports; + + export_directory = (PIMAGE_EXPORT_DIRECTORY)rva_to_ptr(data_dir->VirtualAddress); + if (export_directory != NULL) + { + exports = malloc(sizeof(export_t) * export_directory->NumberOfNames); + if (exports == NULL) + { + printf("Not enough memory.\n"); + free(buffer); + return 1; + } + + name_ptr = (DWORD *)rva_to_ptr(export_directory->AddressOfNames); + ordinal_ptr = (WORD *)rva_to_ptr(export_directory->AddressOfNameOrdinals); + + for (i = 0; i < export_directory->NumberOfNames; i++) + { + exports[i].name = name_ptr[i]; + exports[i].ordinal = ordinal_ptr[i]; + } + + qsort(exports, export_directory->NumberOfNames, sizeof(export_t), + export_compare_func); + + for (i = 0; i < export_directory->NumberOfNames; i++) + { + name_ptr[i] = exports[i].name; + ordinal_ptr[i] = exports[i].ordinal; + } + + free(exports); + } + } + } + + if (fixup_sections) + { + /* Update section flags */ + for (i = 0, section_header = IMAGE_FIRST_SECTION(nt_header); + i < nt_header->OptionalHeader.NumberOfRvaAndSizes; + i++, section_header++) + { + if (section_header->VirtualAddress) + break; + + if (!strcmp(section_header->Name, ".text") || + !strcmp(section_header->Name, ".data") || + !strcmp(section_header->Name, ".idata") || + !strcmp(section_header->Name, ".bss")) + { + section_header->Characteristics |= IMAGE_SCN_MEM_NOT_PAGED; + section_header->Characteristics &= ~IMAGE_SCN_MEM_DISCARDABLE; + } + else if (!strcmp(section_header->Name, "INIT")) + { + section_header->Characteristics |= IMAGE_SCN_MEM_DISCARDABLE; + } + else if (!strcmp(section_header->Name, "PAGE")) + { + section_header->Characteristics |= IMAGE_SCN_MEM_NOT_PAGED; + } + } + } + + /* Recalculate checksum */ + nt_header->OptionalHeader.CheckSum = 0; + checksum = 0; + for (i = 0; i < len; i += 2) + { + checksum += *(unsigned short *)(buffer + i); + checksum = (checksum + (checksum >> 16)) & 0xffff; + } + checksum += len; + nt_header->OptionalHeader.CheckSum = checksum; + + /* Write the output file */ + fd_out = open(argv[1], O_WRONLY | O_BINARY); + write(fd_out, buffer, len); + close(fd_out); + + return 0; +} _____ Added: trunk/reactos/tools/pefixup.mak --- trunk/reactos/tools/pefixup.mak 2005-08-01 16:28:11 UTC (rev 16959) +++ trunk/reactos/tools/pefixup.mak 2005-08-01 17:56:41 UTC (rev 16960) @@ -0,0 +1,36 @@ +PEFIXUP_BASE = $(TOOLS_BASE) +PEFIXUP_BASE_ = $(PEFIXUP_BASE)$(SEP) + +PEFIXUP_INT = $(INTERMEDIATE_)$(PEFIXUP_BASE) +PEFIXUP_INT_ = $(PEFIXUP_INT)$(SEP) +PEFIXUP_OUT = $(OUTPUT_)$(PEFIXUP_BASE) +PEFIXUP_OUT_ = $(PEFIXUP_OUT)$(SEP) + +PEFIXUP_TARGET = \ + $(EXEPREFIX)$(PEFIXUP_OUT_)pefixup$(EXEPOSTFIX) + +PEFIXUP_SOURCES = \ + $(PEFIXUP_BASE_)pefixup.c + +PEFIXUP_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(PEFIXUP_SOURCES:.c=.o)) + +PEFIXUP_HOST_CFLAGS = $(TOOLS_CFLAGS) + +PEFIXUP_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: pefixup +pefixup: $(PEFIXUP_TARGET) + +$(PEFIXUP_TARGET): $(PEFIXUP_OBJECTS) | $(PEFIXUP_OUT) + $(ECHO_LD) + ${host_gcc} $(PEFIXUP_OBJECTS) $(PEFIXUP_HOST_LFLAGS) -o $@ + +$(PEFIXUP_INT_)pefixup.o: $(PEFIXUP_BASE_)pefixup.c | $(PEFIXUP_INT) + $(ECHO_CC) + ${host_gcc} $(PEFIXUP_HOST_CFLAGS) -c $< -o $@ + +.PHONY: pefixup_clean +pefixup_clean: + -@$(rm) $(PEFIXUP_TARGET) $(PEFIXUP_OBJECTS) 2>$(NUL) +clean: pefixup_clean _____ Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp 2005-08-01 16:28:11 UTC (rev 16959) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp 2005-08-01 17:56:41 UTC (rev 16960) @@ -1419,7 +1419,7 @@ string def_file = GetDefinitionFilename (); fprintf ( fMakefile, - "%s: %s %s $(RSYM_TARGET) | %s\n", + "%s: %s %s $(RSYM_TARGET) $(PEFIXUP_TARGET) | %s\n", target.c_str (), def_file.c_str (), dependencies.c_str (), @@ -1451,6 +1451,10 @@ GetLinkerMacro ().c_str () ); fprintf ( fMakefile, + "\t$(Q)$(PEFIXUP_TARGET) %s -exports\n", + target.c_str () ); + + fprintf ( fMakefile, "\t-@${rm} %s 2>$(NUL)\n", temp_exp.c_str () ); } _____ Modified: trunk/reactos/tools/tools.mak --- trunk/reactos/tools/tools.mak 2005-08-01 16:28:11 UTC (rev 16959) +++ trunk/reactos/tools/tools.mak 2005-08-01 17:56:41 UTC (rev 16960) @@ -22,6 +22,7 @@ include tools/bin2c.mak include tools/rsym.mak +include tools/pefixup.mak include tools/bin2res/bin2res.mak include tools/buildno/buildno.mak include tools/cabman/cabman.mak
19 years, 4 months
1
0
0
0
[weiden] 16959: print percentage character for the memory load in debug message (GlobalMemoryStatusEx). Suggested by WaxDragon
by weiden@svn.reactos.com
print percentage character for the memory load in debug message (GlobalMemoryStatusEx). Suggested by WaxDragon Modified: trunk/reactos/lib/kernel32/mem/global.c _____ Modified: trunk/reactos/lib/kernel32/mem/global.c --- trunk/reactos/lib/kernel32/mem/global.c 2005-08-01 16:11:29 UTC (rev 16958) +++ trunk/reactos/lib/kernel32/mem/global.c 2005-08-01 16:28:11 UTC (rev 16959) @@ -409,7 +409,7 @@ SysPerfInfo.AvailablePages) * 100 / SysBasicInfo.NumberOfPhysicalPages; - DPRINT1("Memory Load: %d\n",lpBuffer->dwMemoryLoad ); + DPRINT1("Memory Load: %d%%\n",lpBuffer->dwMemoryLoad ); lpBuffer->ullTotalPhys = SysBasicInfo.NumberOfPhysicalPages * SysBasicInfo.PageSize;
19 years, 4 months
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
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
Results per page:
10
25
50
100
200