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
September 2008
----- 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
27 participants
747 discussions
Start a n
N
ew thread
[cgutman] 36363: - Set MiniportBusy to TRUE in MiniDequeueWorkItem instead of MiniQueueWorkItem - Fail if another miniport request is still in progress
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Sep 20 21:35:23 2008 New Revision: 36363 URL:
http://svn.reactos.org/svn/reactos?rev=36363&view=rev
Log: - Set MiniportBusy to TRUE in MiniDequeueWorkItem instead of MiniQueueWorkItem - Fail if another miniport request is still in progress Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sat Sep 20 21:35:23 2008 @@ -634,8 +634,6 @@ KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); - Adapter->MiniportBusy = TRUE; - return NDIS_STATUS_SUCCESS; } @@ -663,6 +661,12 @@ NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); + if (Adapter->MiniportBusy) { + NDIS_DbgPrint(MID_TRACE, ("Waiting for miniport to become free.\n")); + KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); + return NDIS_STATUS_FAILURE; + } + Item = Adapter->WorkQueueHead; if (Item) @@ -677,6 +681,8 @@ *WorkItemContext = Item->WorkItemContext; ExFreePool(Item); + + Adapter->MiniportBusy = TRUE; return NDIS_STATUS_SUCCESS; } @@ -900,6 +906,9 @@ } } + if( NdisStatus != NDIS_STATUS_PENDING ) + Adapter->MiniportBusy = FALSE; + ExFreePool(WorkItem); }
16 years, 3 months
1
0
0
0
[cgutman] 36362: - Remove some unneeded code - Set MiniportBusy to TRUE if MiniDoRequest returns NDIS_STATUS_PENDING
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Sep 20 20:55:16 2008 New Revision: 36362 URL:
http://svn.reactos.org/svn/reactos?rev=36362&view=rev
Log: - Remove some unneeded code - Set MiniportBusy to TRUE if MiniDoRequest returns NDIS_STATUS_PENDING Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Sat Sep 20 20:55:16 2008 @@ -143,11 +143,6 @@ { if(Adapter->MiniportBusy) QueueWorkItem = TRUE; - else - { - NDIS_DbgPrint(MAX_TRACE, ("Setting adapter 0x%x to busy\n")); - Adapter->MiniportBusy = TRUE; - } } /* MiniQueueWorkItem must be called at IRQL >= DISPATCH_LEVEL */ @@ -160,18 +155,10 @@ KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); - NdisStatus = MiniDoRequest(&Adapter->NdisMiniportBlock, NdisRequest); - - NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n")); - KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); - { - NDIS_DbgPrint(MAX_TRACE, ("Setting adapter 0x%x to free\n")); - Adapter->MiniportBusy = FALSE; - - if (Adapter->WorkQueueHead) - KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); - } - KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); + NdisStatus = MiniDoRequest(&Adapter->NdisMiniportBlock, NdisRequest); + + if( NdisStatus == NDIS_STATUS_PENDING ) + Adapter->MiniportBusy = TRUE; return NdisStatus; }
16 years, 3 months
1
0
0
0
[tkreuzer] 36361: Make MmGetPageDirectory an inline function
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 20 19:47:15 2008 New Revision: 36361 URL:
http://svn.reactos.org/svn/reactos?rev=36361&view=rev
Log: Make MmGetPageDirectory an inline function Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/mm.h [iso-8859-1] Sat Sep 20 19:47:15 2008 @@ -6,7 +6,13 @@ #define __NTOSKRNL_INCLUDE_INTERNAL_AMD64_MM_H struct _EPROCESS; -PULONG_PTR MmGetPageDirectory(VOID); + +PULONG64 +FORCEINLINE +MmGetPageDirectory(VOID) +{ + return (PULONG64)__readcr3(); +} #define PAGE_MASK(x) ((x)&(~0xfff)) #define PAE_PAGE_MASK(x) ((x)&(~0xfffLL))
16 years, 3 months
1
0
0
0
[tkreuzer] 36360: use FIELD_OFFSET instead of a constant
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 20 19:45:49 2008 New Revision: 36360 URL:
http://svn.reactos.org/svn/reactos?rev=36360&view=rev
Log: use FIELD_OFFSET instead of a constant Modified: branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h Modified: branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] Sat Sep 20 19:45:49 2008 @@ -30,7 +30,7 @@ // //#define K0IPCR ((ULONG_PTR)(KIP0PCRADDRESS)) //#define PCR ((volatile KPCR * const)K0IPCR) -#define PCR ((volatile KPCR * const)__readgsqword(KPCR_SELF)) +#define PCR ((volatile KPCR * const)__readgsqword(FIELD_OFFSET(KPCR, Self))) //#if defined(CONFIG_SMP) || defined(NT_BUILD) //#undef KeGetPcr //#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C))
16 years, 3 months
1
0
0
0
[cgutman] 36359: - Only call MiniSendComplete if ProIndicatePacket didn't return NDIS_STATUS_PENDING
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Sep 20 18:08:56 2008 New Revision: 36359 URL:
http://svn.reactos.org/svn/reactos?rev=36359&view=rev
Log: - Only call MiniSendComplete if ProIndicatePacket didn't return NDIS_STATUS_PENDING Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sat Sep 20 18:08:56 2008 @@ -853,7 +853,9 @@ */ /* XXX atm ProIndicatePacket sends a packet up via the loopback adapter only */ NdisStatus = ProIndicatePacket(Adapter, (PNDIS_PACKET)WorkItemContext); - MiniSendComplete((NDIS_HANDLE)Adapter, (PNDIS_PACKET)WorkItemContext, NdisStatus); + + if( NdisStatus != NDIS_STATUS_PENDING ) + MiniSendComplete((NDIS_HANDLE)Adapter, (PNDIS_PACKET)WorkItemContext, NdisStatus); break; case NdisWorkItemReturnPackets:
16 years, 3 months
1
0
0
0
[cgutman] 36358: - Revert r36337 because the callers don't depend on the memory being zeroed
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Sep 20 16:29:31 2008 New Revision: 36358 URL:
http://svn.reactos.org/svn/reactos?rev=36358&view=rev
Log: - Revert r36337 because the callers don't depend on the memory being zeroed Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/pool.c [iso-8859-1] Sat Sep 20 16:29:31 2008 @@ -25,8 +25,6 @@ /* FIXME: Get buffer from a free buffer pool with enough room */ Buffer = ExAllocatePool(NonPagedPool, Size); - - RtlZeroMemory(Buffer, Size); TI_DbgPrint(DEBUG_MEMORY, ("Allocated (%i) bytes at (0x%X).\n", Size, Buffer));
16 years, 3 months
1
0
0
0
[ekohl] 36357: [FORMATTING] No code changes!
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Sep 20 15:28:23 2008 New Revision: 36357 URL:
http://svn.reactos.org/svn/reactos?rev=36357&view=rev
Log: [FORMATTING] No code changes! Modified: trunk/reactos/dll/win32/advapi32/misc/hwprofiles.c trunk/reactos/dll/win32/advapi32/misc/logon.c trunk/reactos/dll/win32/advapi32/misc/shutdown.c Modified: trunk/reactos/dll/win32/advapi32/misc/hwprofiles.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/hw…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/hwprofiles.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/hwprofiles.c [iso-8859-1] Sat Sep 20 15:28:23 2008 @@ -30,53 +30,53 @@ BOOL STDCALL GetCurrentHwProfileA(LPHW_PROFILE_INFOA lpHwProfileInfo) { - HW_PROFILE_INFOW ProfileInfo; - UNICODE_STRING StringU; - ANSI_STRING StringA; - BOOL bResult; - NTSTATUS Status; + HW_PROFILE_INFOW ProfileInfo; + UNICODE_STRING StringU; + ANSI_STRING StringA; + BOOL bResult; + NTSTATUS Status; - TRACE("GetCurrentHwProfileA() called\n"); + TRACE("GetCurrentHwProfileA() called\n"); - bResult = GetCurrentHwProfileW(&ProfileInfo); - if (bResult == FALSE) - return FALSE; + bResult = GetCurrentHwProfileW(&ProfileInfo); + if (bResult == FALSE) + return FALSE; - lpHwProfileInfo->dwDockInfo = ProfileInfo.dwDockInfo; + lpHwProfileInfo->dwDockInfo = ProfileInfo.dwDockInfo; - /* Convert the profile GUID to ANSI */ - StringU.Buffer = (PWCHAR)ProfileInfo.szHwProfileGuid; - StringU.Length = wcslen(ProfileInfo.szHwProfileGuid) * sizeof(WCHAR); - StringU.MaximumLength = HW_PROFILE_GUIDLEN * sizeof(WCHAR); - StringA.Buffer = (PCHAR)&lpHwProfileInfo->szHwProfileGuid; - StringA.Length = 0; - StringA.MaximumLength = HW_PROFILE_GUIDLEN; - Status = RtlUnicodeStringToAnsiString(&StringA, - &StringU, - FALSE); - if (!NT_SUCCESS(Status)) + /* Convert the profile GUID to ANSI */ + StringU.Buffer = (PWCHAR)ProfileInfo.szHwProfileGuid; + StringU.Length = wcslen(ProfileInfo.szHwProfileGuid) * sizeof(WCHAR); + StringU.MaximumLength = HW_PROFILE_GUIDLEN * sizeof(WCHAR); + StringA.Buffer = (PCHAR)&lpHwProfileInfo->szHwProfileGuid; + StringA.Length = 0; + StringA.MaximumLength = HW_PROFILE_GUIDLEN; + Status = RtlUnicodeStringToAnsiString(&StringA, + &StringU, + FALSE); + if (!NT_SUCCESS(Status)) { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; } - /* Convert the profile name to ANSI */ - StringU.Buffer = (PWCHAR)ProfileInfo.szHwProfileName; - StringU.Length = wcslen(ProfileInfo.szHwProfileName) * sizeof(WCHAR); - StringU.MaximumLength = MAX_PROFILE_LEN * sizeof(WCHAR); - StringA.Buffer = (PCHAR)&lpHwProfileInfo->szHwProfileName; - StringA.Length = 0; - StringA.MaximumLength = MAX_PROFILE_LEN; - Status = RtlUnicodeStringToAnsiString(&StringA, - &StringU, - FALSE); - if (!NT_SUCCESS(Status)) + /* Convert the profile name to ANSI */ + StringU.Buffer = (PWCHAR)ProfileInfo.szHwProfileName; + StringU.Length = wcslen(ProfileInfo.szHwProfileName) * sizeof(WCHAR); + StringU.MaximumLength = MAX_PROFILE_LEN * sizeof(WCHAR); + StringA.Buffer = (PCHAR)&lpHwProfileInfo->szHwProfileName; + StringA.Length = 0; + StringA.MaximumLength = MAX_PROFILE_LEN; + Status = RtlUnicodeStringToAnsiString(&StringA, + &StringU, + FALSE); + if (!NT_SUCCESS(Status)) { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; } - return TRUE; + return TRUE; } @@ -86,114 +86,114 @@ BOOL STDCALL GetCurrentHwProfileW(LPHW_PROFILE_INFOW lpHwProfileInfo) { - WCHAR szKeyName[256]; - HKEY hDbKey; - HKEY hProfileKey; - DWORD dwLength; - DWORD dwConfigId; + WCHAR szKeyName[256]; + HKEY hDbKey; + HKEY hProfileKey; + DWORD dwLength; + DWORD dwConfigId; - TRACE("GetCurrentHwProfileW() called\n"); + TRACE("GetCurrentHwProfileW() called\n"); - if (lpHwProfileInfo == NULL) + if (lpHwProfileInfo == NULL) { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"System\\CurrentControlSet\\Control\\IDConfigDB", - 0, - KEY_QUERY_VALUE, - &hDbKey)) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"System\\CurrentControlSet\\Control\\IDConfigDB", + 0, + KEY_QUERY_VALUE, + &hDbKey)) { - SetLastError(ERROR_REGISTRY_CORRUPT); - return FALSE; + SetLastError(ERROR_REGISTRY_CORRUPT); + return FALSE; } - dwLength = sizeof(DWORD); - if (RegQueryValueExW(hDbKey, - L"CurrentConfig", - 0, - NULL, - (LPBYTE)&dwConfigId, - &dwLength)) + dwLength = sizeof(DWORD); + if (RegQueryValueExW(hDbKey, + L"CurrentConfig", + 0, + NULL, + (LPBYTE)&dwConfigId, + &dwLength)) { - RegCloseKey(hDbKey); - SetLastError(ERROR_REGISTRY_CORRUPT); - return FALSE; + RegCloseKey(hDbKey); + SetLastError(ERROR_REGISTRY_CORRUPT); + return FALSE; } - swprintf(szKeyName, - L"Hardware Profile\\%04lu", - dwConfigId); + swprintf(szKeyName, + L"Hardware Profile\\%04lu", + dwConfigId); - if (RegOpenKeyExW(hDbKey, - szKeyName, - 0, - KEY_QUERY_VALUE | KEY_SET_VALUE, - &hProfileKey)) + if (RegOpenKeyExW(hDbKey, + szKeyName, + 0, + KEY_QUERY_VALUE | KEY_SET_VALUE, + &hProfileKey)) { - RegCloseKey(hDbKey); - SetLastError(ERROR_REGISTRY_CORRUPT); - return FALSE; + RegCloseKey(hDbKey); + SetLastError(ERROR_REGISTRY_CORRUPT); + return FALSE; } - dwLength = sizeof(DWORD); - if (RegQueryValueExW(hProfileKey, - L"DockState", - 0, - NULL, - (LPBYTE)&lpHwProfileInfo->dwDockInfo, - &dwLength)) + dwLength = sizeof(DWORD); + if (RegQueryValueExW(hProfileKey, + L"DockState", + 0, + NULL, + (LPBYTE)&lpHwProfileInfo->dwDockInfo, + &dwLength)) { - lpHwProfileInfo->dwDockInfo = - DOCKINFO_DOCKED | DOCKINFO_UNDOCKED | DOCKINFO_USER_SUPPLIED; + lpHwProfileInfo->dwDockInfo = + DOCKINFO_DOCKED | DOCKINFO_UNDOCKED | DOCKINFO_USER_SUPPLIED; } - dwLength = HW_PROFILE_GUIDLEN * sizeof(WCHAR); - if (RegQueryValueExW(hProfileKey, - L"HwProfileGuid", - 0, - NULL, - (LPBYTE)&lpHwProfileInfo->szHwProfileGuid, - &dwLength)) + dwLength = HW_PROFILE_GUIDLEN * sizeof(WCHAR); + if (RegQueryValueExW(hProfileKey, + L"HwProfileGuid", + 0, + NULL, + (LPBYTE)&lpHwProfileInfo->szHwProfileGuid, + &dwLength)) { - /* FIXME: Create a new GUID */ - wcscpy(lpHwProfileInfo->szHwProfileGuid, - L"{00000000-0000-0000-0000-000000000000}"); + /* FIXME: Create a new GUID */ + wcscpy(lpHwProfileInfo->szHwProfileGuid, + L"{00000000-0000-0000-0000-000000000000}"); - dwLength = (wcslen(lpHwProfileInfo->szHwProfileGuid) + 1) * sizeof(WCHAR); - RegSetValueExW(hProfileKey, - L"HwProfileGuid", - 0, - REG_SZ, - (LPBYTE)lpHwProfileInfo->szHwProfileGuid, - dwLength); + dwLength = (wcslen(lpHwProfileInfo->szHwProfileGuid) + 1) * sizeof(WCHAR); + RegSetValueExW(hProfileKey, + L"HwProfileGuid", + 0, + REG_SZ, + (LPBYTE)lpHwProfileInfo->szHwProfileGuid, + dwLength); } - dwLength = MAX_PROFILE_LEN * sizeof(WCHAR); - if (RegQueryValueExW(hProfileKey, - L"FriendlyName", - 0, - NULL, - (LPBYTE)&lpHwProfileInfo->szHwProfileName, - &dwLength)) + dwLength = MAX_PROFILE_LEN * sizeof(WCHAR); + if (RegQueryValueExW(hProfileKey, + L"FriendlyName", + 0, + NULL, + (LPBYTE)&lpHwProfileInfo->szHwProfileName, + &dwLength)) { - wcscpy(lpHwProfileInfo->szHwProfileName, - L"Noname Hardware Profile"); - dwLength = (wcslen(lpHwProfileInfo->szHwProfileName) + 1) * sizeof(WCHAR); - RegSetValueExW(hProfileKey, - L"FriendlyName", - 0, - REG_SZ, - (LPBYTE)lpHwProfileInfo->szHwProfileName, - dwLength); + wcscpy(lpHwProfileInfo->szHwProfileName, + L"Noname Hardware Profile"); + dwLength = (wcslen(lpHwProfileInfo->szHwProfileName) + 1) * sizeof(WCHAR); + RegSetValueExW(hProfileKey, + L"FriendlyName", + 0, + REG_SZ, + (LPBYTE)lpHwProfileInfo->szHwProfileName, + dwLength); } - RegCloseKey(hProfileKey); - RegCloseKey(hDbKey); + RegCloseKey(hProfileKey); + RegCloseKey(hDbKey); - return TRUE; + return TRUE; } /* EOF */ Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Sat Sep 20 15:28:23 2008 @@ -18,57 +18,57 @@ * @implemented */ BOOL STDCALL -CreateProcessAsUserA (HANDLE hToken, - LPCSTR lpApplicationName, - LPSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, - LPSTARTUPINFOA lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation) +CreateProcessAsUserA(HANDLE hToken, + LPCSTR lpApplicationName, + LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { - PROCESS_ACCESS_TOKEN AccessToken; - NTSTATUS Status; - - /* Create the process with a suspended main thread */ - if (!CreateProcessA (lpApplicationName, - lpCommandLine, - lpProcessAttributes, - lpThreadAttributes, - bInheritHandles, - dwCreationFlags | CREATE_SUSPENDED, - lpEnvironment, - lpCurrentDirectory, - lpStartupInfo, - lpProcessInformation)) - { - return FALSE; - } - - AccessToken.Token = hToken; - AccessToken.Thread = NULL; - - /* Set the new process token */ - Status = NtSetInformationProcess (lpProcessInformation->hProcess, - ProcessAccessToken, - (PVOID)&AccessToken, - sizeof (AccessToken)); - if (!NT_SUCCESS (Status)) - { - SetLastError (RtlNtStatusToDosError (Status)); - return FALSE; - } - - /* Resume the main thread */ - if (!(dwCreationFlags & CREATE_SUSPENDED)) - { - ResumeThread (lpProcessInformation->hThread); - } - - return TRUE; + PROCESS_ACCESS_TOKEN AccessToken; + NTSTATUS Status; + + /* Create the process with a suspended main thread */ + if (!CreateProcessA(lpApplicationName, + lpCommandLine, + lpProcessAttributes, + lpThreadAttributes, + bInheritHandles, + dwCreationFlags | CREATE_SUSPENDED, + lpEnvironment, + lpCurrentDirectory, + lpStartupInfo, + lpProcessInformation)) + { + return FALSE; + } + + AccessToken.Token = hToken; + AccessToken.Thread = NULL; + + /* Set the new process token */ + Status = NtSetInformationProcess(lpProcessInformation->hProcess, + ProcessAccessToken, + (PVOID)&AccessToken, + sizeof(AccessToken)); + if (!NT_SUCCESS (Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + /* Resume the main thread */ + if (!(dwCreationFlags & CREATE_SUSPENDED)) + { + ResumeThread(lpProcessInformation->hThread); + } + + return TRUE; } @@ -76,57 +76,57 @@ * @implemented */ BOOL STDCALL -CreateProcessAsUserW (HANDLE hToken, - LPCWSTR lpApplicationName, - LPWSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, - LPSTARTUPINFOW lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation) +CreateProcessAsUserW(HANDLE hToken, + LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { - PROCESS_ACCESS_TOKEN AccessToken; - NTSTATUS Status; - - /* Create the process with a suspended main thread */ - if (!CreateProcessW (lpApplicationName, - lpCommandLine, - lpProcessAttributes, - lpThreadAttributes, - bInheritHandles, - dwCreationFlags | CREATE_SUSPENDED, - lpEnvironment, - lpCurrentDirectory, - lpStartupInfo, - lpProcessInformation)) - { - return FALSE; - } - - AccessToken.Token = hToken; - AccessToken.Thread = NULL; - - /* Set the new process token */ - Status = NtSetInformationProcess (lpProcessInformation->hProcess, - ProcessAccessToken, - (PVOID)&AccessToken, - sizeof (AccessToken)); - if (!NT_SUCCESS (Status)) - { - SetLastError (RtlNtStatusToDosError (Status)); - return FALSE; - } - - /* Resume the main thread */ - if (!(dwCreationFlags & CREATE_SUSPENDED)) - { - ResumeThread (lpProcessInformation->hThread); - } - - return TRUE; + PROCESS_ACCESS_TOKEN AccessToken; + NTSTATUS Status; + + /* Create the process with a suspended main thread */ + if (!CreateProcessW(lpApplicationName, + lpCommandLine, + lpProcessAttributes, + lpThreadAttributes, + bInheritHandles, + dwCreationFlags | CREATE_SUSPENDED, + lpEnvironment, + lpCurrentDirectory, + lpStartupInfo, + lpProcessInformation)) + { + return FALSE; + } + + AccessToken.Token = hToken; + AccessToken.Thread = NULL; + + /* Set the new process token */ + Status = NtSetInformationProcess(lpProcessInformation->hProcess, + ProcessAccessToken, + (PVOID)&AccessToken, + sizeof(AccessToken)); + if (!NT_SUCCESS (Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + /* Resume the main thread */ + if (!(dwCreationFlags & CREATE_SUSPENDED)) + { + ResumeThread(lpProcessInformation->hThread); + } + + return TRUE; } @@ -199,215 +199,214 @@ static BOOL STDCALL -SamGetUserSid (LPCWSTR UserName, - PSID *Sid) +SamGetUserSid(LPCWSTR UserName, + PSID *Sid) { - PSID lpSid; - DWORD dwLength; - HKEY hUsersKey; - HKEY hUserKey; - - if (Sid != NULL) - *Sid = NULL; - - /* Open the Users key */ - if (RegOpenKeyExW (HKEY_LOCAL_MACHINE, - L"SAM\\SAM\\Domains\\Account\\Users", - 0, - KEY_READ, - &hUsersKey)) - { - ERR("Failed to open Users key! (Error %lu)\n", GetLastError()); - return FALSE; - } - - /* Open the user key */ - if (RegOpenKeyExW (hUsersKey, - UserName, - 0, - KEY_READ, - &hUserKey)) - { - if (GetLastError () == ERROR_FILE_NOT_FOUND) - { - ERR("Invalid user name!\n"); - SetLastError (ERROR_NO_SUCH_USER); - } - else - { - ERR("Failed to open user key! (Error %lu)\n", GetLastError()); - } - - RegCloseKey (hUsersKey); - return FALSE; - } - - RegCloseKey (hUsersKey); - - /* Get SID size */ - dwLength = 0; - if (RegQueryValueExW (hUserKey, - L"Sid", - NULL, - NULL, - NULL, - &dwLength)) - { - ERR("Failed to read the SID size! (Error %lu)\n", GetLastError()); - RegCloseKey (hUserKey); - return FALSE; - } - - /* Allocate sid buffer */ - TRACE("Required SID buffer size: %lu\n", dwLength); - lpSid = (PSID)RtlAllocateHeap (RtlGetProcessHeap (), - 0, - dwLength); - if (lpSid == NULL) - { - ERR("Failed to allocate SID buffer!\n"); - RegCloseKey (hUserKey); - return FALSE; - } - - /* Read sid */ - if (RegQueryValueExW (hUserKey, - L"Sid", - NULL, - NULL, - (LPBYTE)lpSid, - &dwLength)) - { - ERR("Failed to read the SID! (Error %lu)\n", GetLastError()); - RtlFreeHeap (RtlGetProcessHeap (), - 0, - lpSid); - RegCloseKey (hUserKey); - return FALSE; - } - - RegCloseKey (hUserKey); - - *Sid = lpSid; - - return TRUE; + PSID lpSid; + DWORD dwLength; + HKEY hUsersKey; + HKEY hUserKey; + + if (Sid != NULL) + *Sid = NULL; + + /* Open the Users key */ + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SAM\\SAM\\Domains\\Account\\Users", + 0, + KEY_READ, + &hUsersKey)) + { + ERR("Failed to open Users key! (Error %lu)\n", GetLastError()); + return FALSE; + } + + /* Open the user key */ + if (RegOpenKeyExW(hUsersKey, + UserName, + 0, + KEY_READ, + &hUserKey)) + { + if (GetLastError() == ERROR_FILE_NOT_FOUND) + { + ERR("Invalid user name!\n"); + SetLastError(ERROR_NO_SUCH_USER); + } + else + { + ERR("Failed to open user key! (Error %lu)\n", GetLastError()); + } + + RegCloseKey(hUsersKey); + return FALSE; + } + + RegCloseKey (hUsersKey); + + /* Get SID size */ + dwLength = 0; + if (RegQueryValueExW(hUserKey, + L"Sid", + NULL, + NULL, + NULL, + &dwLength)) + { + ERR("Failed to read the SID size! (Error %lu)\n", GetLastError()); + RegCloseKey(hUserKey); + return FALSE; + } + + /* Allocate sid buffer */ + TRACE("Required SID buffer size: %lu\n", dwLength); + lpSid = (PSID)RtlAllocateHeap(RtlGetProcessHeap(), + 0, + dwLength); + if (lpSid == NULL) + { + ERR("Failed to allocate SID buffer!\n"); + RegCloseKey(hUserKey); + return FALSE; + } + + /* Read sid */ + if (RegQueryValueExW(hUserKey, + L"Sid", + NULL, + NULL, + (LPBYTE)lpSid, + &dwLength)) + { + ERR("Failed to read the SID! (Error %lu)\n", GetLastError()); + RtlFreeHeap(RtlGetProcessHeap(), + 0, + lpSid); + RegCloseKey(hUserKey); + return FALSE; + } + + RegCloseKey(hUserKey); + + *Sid = lpSid; + + return TRUE; } static BOOL STDCALL SamGetDomainSid(PSID *Sid) { - PSID lpSid; - DWORD dwLength; - HKEY hDomainKey; - - TRACE("SamGetDomainSid() called\n"); - - if (Sid != NULL) - *Sid = NULL; - - /* Open the account domain key */ - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SAM\\SAM\\Domains\\Account", - 0, - KEY_READ, - &hDomainKey)) - { - ERR("Failed to open the account domain key! (Error %lu)\n", GetLastError()); - return FALSE; - } - - /* Get SID size */ - dwLength = 0; - if (RegQueryValueExW(hDomainKey, - L"Sid", - NULL, - NULL, - NULL, - &dwLength)) - { - ERR("Failed to read the SID size! (Error %lu)\n", GetLastError()); - RegCloseKey(hDomainKey); - return FALSE; - } - - /* Allocate sid buffer */ - TRACE("Required SID buffer size: %lu\n", dwLength); - lpSid = (PSID)RtlAllocateHeap(RtlGetProcessHeap(), - 0, - dwLength); - if (lpSid == NULL) - { - ERR("Failed to allocate SID buffer!\n"); - RegCloseKey(hDomainKey); - return FALSE; - } - - /* Read sid */ - if (RegQueryValueExW(hDomainKey, - L"Sid", - NULL, - NULL, - (LPBYTE)lpSid, - &dwLength)) - { - ERR("Failed to read the SID! (Error %lu)\n", GetLastError()); - RtlFreeHeap(RtlGetProcessHeap(), - 0, - lpSid); - RegCloseKey(hDomainKey); - return FALSE; - } - - RegCloseKey(hDomainKey); - - *Sid = lpSid; - - TRACE("SamGetDomainSid() done\n"); - - return TRUE; + PSID lpSid; + DWORD dwLength; + HKEY hDomainKey; + + TRACE("SamGetDomainSid() called\n"); + + if (Sid != NULL) + *Sid = NULL; + + /* Open the account domain key */ + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SAM\\SAM\\Domains\\Account", + 0, + KEY_READ, + &hDomainKey)) + { + ERR("Failed to open the account domain key! (Error %lu)\n", GetLastError()); + return FALSE; + } + + /* Get SID size */ + dwLength = 0; + if (RegQueryValueExW(hDomainKey, + L"Sid", + NULL, + NULL, + NULL, + &dwLength)) + { + ERR("Failed to read the SID size! (Error %lu)\n", GetLastError()); + RegCloseKey(hDomainKey); + return FALSE; + } + + /* Allocate sid buffer */ + TRACE("Required SID buffer size: %lu\n", dwLength); + lpSid = (PSID)RtlAllocateHeap(RtlGetProcessHeap(), + 0, + dwLength); + if (lpSid == NULL) + { + ERR("Failed to allocate SID buffer!\n"); + RegCloseKey(hDomainKey); + return FALSE; + } + + /* Read sid */ + if (RegQueryValueExW(hDomainKey, + L"Sid", + NULL, + NULL, + (LPBYTE)lpSid, + &dwLength)) + { + ERR("Failed to read the SID! (Error %lu)\n", GetLastError()); + RtlFreeHeap(RtlGetProcessHeap(), + 0, + lpSid); + RegCloseKey(hDomainKey); + return FALSE; + } + + RegCloseKey(hDomainKey); + + *Sid = lpSid; + + TRACE("SamGetDomainSid() done\n"); + + return TRUE; } static PSID AppendRidToSid(PSID SrcSid, - ULONG Rid) + ULONG Rid) { - ULONG Rids[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - UCHAR RidCount; - PSID DstSid; - ULONG i; - - RidCount = *RtlSubAuthorityCountSid(SrcSid); - if (RidCount >= 8) - return NULL; - - for (i = 0; i < RidCount; i++) - Rids[i] = *RtlSubAuthoritySid(SrcSid, i); - - Rids[RidCount] = Rid; - RidCount++; - - RtlAllocateAndInitializeSid(RtlIdentifierAuthoritySid(SrcSid), - RidCount, - Rids[0], - Rids[1], - Rids[2], - Rids[3], - Rids[4], - Rids[5], - Rids[6], - Rids[7], - &DstSid); - - return DstSid; + ULONG Rids[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + UCHAR RidCount; + PSID DstSid; + ULONG i; + + RidCount = *RtlSubAuthorityCountSid(SrcSid); + if (RidCount >= 8) + return NULL; + + for (i = 0; i < RidCount; i++) + Rids[i] = *RtlSubAuthoritySid(SrcSid, i); + + Rids[RidCount] = Rid; + RidCount++; + + RtlAllocateAndInitializeSid(RtlIdentifierAuthoritySid(SrcSid), + RidCount, + Rids[0], + Rids[1], + Rids[2], + Rids[3], + Rids[4], + Rids[5], + Rids[6], + Rids[7], + &DstSid); + + return DstSid; } static PTOKEN_GROUPS -AllocateGroupSids( - OUT PSID *PrimaryGroupSid, - OUT PSID *OwnerSid) +AllocateGroupSids(OUT PSID *PrimaryGroupSid, + OUT PSID *OwnerSid) { SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY}; SID_IDENTIFIER_AUTHORITY LocalAuthority = {SECURITY_LOCAL_SID_AUTHORITY}; @@ -442,132 +441,133 @@ /* Member of the domain */ TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; *PrimaryGroupSid = Sid; GroupCount++; /* Member of 'Everyone' */ - RtlAllocateAndInitializeSid( - &WorldAuthority, - 1, - SECURITY_WORLD_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&WorldAuthority, + 1, + SECURITY_WORLD_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; GroupCount++; #if 1 /* Member of 'Administrators' */ - RtlAllocateAndInitializeSid( - &SystemAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&SystemAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; GroupCount++; #else TRACE("Not adding user to Administrators group\n"); #endif /* Member of 'Users' */ - RtlAllocateAndInitializeSid( - &SystemAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_USERS, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&SystemAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_USERS, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; GroupCount++; /* Logon SID */ - RtlAllocateAndInitializeSid( - &SystemAuthority, - SECURITY_LOGON_IDS_RID_COUNT, - SECURITY_LOGON_IDS_RID, - Luid.HighPart, - Luid.LowPart, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&SystemAuthority, + SECURITY_LOGON_IDS_RID_COUNT, + SECURITY_LOGON_IDS_RID, + Luid.HighPart, + Luid.LowPart, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY | SE_GROUP_LOGON_ID; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY | SE_GROUP_LOGON_ID; GroupCount++; *OwnerSid = Sid; /* Member of 'Local users */ - RtlAllocateAndInitializeSid( - &LocalAuthority, - 1, - SECURITY_LOCAL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&LocalAuthority, + 1, + SECURITY_LOCAL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; GroupCount++; /* Member of 'Interactive users' */ - RtlAllocateAndInitializeSid( - &SystemAuthority, - 1, - SECURITY_INTERACTIVE_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&SystemAuthority, + 1, + SECURITY_INTERACTIVE_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; GroupCount++; /* Member of 'Authenticated users' */ - RtlAllocateAndInitializeSid( - &SystemAuthority, - 1, - SECURITY_AUTHENTICATED_USER_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); + RtlAllocateAndInitializeSid(&SystemAuthority, + 1, + SECURITY_AUTHENTICATED_USER_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &Sid); TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; + TokenGroups->Groups[GroupCount].Attributes = + SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; GroupCount++; TokenGroups->GroupCount = GroupCount; @@ -580,15 +580,15 @@ static VOID FreeGroupSids(PTOKEN_GROUPS TokenGroups) { - ULONG i; - - for (i = 0; i < TokenGroups->GroupCount; i++) - { - if (TokenGroups->Groups[i].Sid != NULL) - RtlFreeHeap(GetProcessHeap(), 0, TokenGroups->Groups[i].Sid); - } - - RtlFreeHeap(GetProcessHeap(), 0, TokenGroups); + ULONG i; + + for (i = 0; i < TokenGroups->GroupCount; i++) + { + if (TokenGroups->Groups[i].Sid != NULL) + RtlFreeHeap(GetProcessHeap(), 0, TokenGroups->Groups[i].Sid); + } + + RtlFreeHeap(GetProcessHeap(), 0, TokenGroups); } @@ -596,20 +596,20 @@ * @unimplemented */ BOOL STDCALL -LogonUserW (LPWSTR lpszUsername, - LPWSTR lpszDomain, - LPWSTR lpszPassword, - DWORD dwLogonType, - DWORD dwLogonProvider, - PHANDLE phToken) +LogonUserW(LPWSTR lpszUsername, + LPWSTR lpszDomain, + LPWSTR lpszPassword, + DWORD dwLogonType, + DWORD dwLogonProvider, + PHANDLE phToken) { - /* FIXME shouldn't use hard-coded list of privileges */ - static struct + /* FIXME shouldn't use hard-coded list of privileges */ + static struct { LPCWSTR PrivName; DWORD Attributes; } - DefaultPrivs[] = + DefaultPrivs[] = { { L"SeUnsolicitedInputPrivilege", 0 }, { L"SeMachineAccountPrivilege", 0 }, @@ -633,176 +633,178 @@ { L"SeImpersonatePrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT }, { L"SeCreateGlobalPrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT } }; - OBJECT_ATTRIBUTES ObjectAttributes; - SECURITY_QUALITY_OF_SERVICE Qos; - TOKEN_USER TokenUser; - TOKEN_OWNER TokenOwner; - TOKEN_PRIMARY_GROUP TokenPrimaryGroup; - PTOKEN_GROUPS TokenGroups; - PTOKEN_PRIVILEGES TokenPrivileges; - TOKEN_DEFAULT_DACL TokenDefaultDacl; - LARGE_INTEGER ExpirationTime; - LUID AuthenticationId; - TOKEN_SOURCE TokenSource; - PSID UserSid = NULL; - PSID PrimaryGroupSid = NULL; - PSID OwnerSid = NULL; - PSID LocalSystemSid; - PACL Dacl; - NTSTATUS Status; - SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; - unsigned i; - - Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); - Qos.ImpersonationLevel = SecurityAnonymous; - Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING; - Qos.EffectiveOnly = FALSE; - - ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES); - ObjectAttributes.RootDirectory = NULL; - ObjectAttributes.ObjectName = NULL; - ObjectAttributes.Attributes = 0; - ObjectAttributes.SecurityDescriptor = NULL; - ObjectAttributes.SecurityQualityOfService = &Qos; - - Status = NtAllocateLocallyUniqueId(&AuthenticationId); - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - ExpirationTime.QuadPart = -1; - - /* Get the user SID from the registry */ - if (!SamGetUserSid (lpszUsername, &UserSid)) - { - ERR("SamGetUserSid() failed\n"); - return FALSE; - } - - TokenUser.User.Sid = UserSid; - TokenUser.User.Attributes = 0; - - /* Allocate and initialize token groups */ - TokenGroups = AllocateGroupSids(&PrimaryGroupSid, - &OwnerSid); - if (NULL == TokenGroups) - { - RtlFreeSid(UserSid); - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - - /* Allocate and initialize token privileges */ - TokenPrivileges = RtlAllocateHeap(GetProcessHeap(), 0, - sizeof(TOKEN_PRIVILEGES) + OBJECT_ATTRIBUTES ObjectAttributes; + SECURITY_QUALITY_OF_SERVICE Qos; + TOKEN_USER TokenUser; + TOKEN_OWNER TokenOwner; + TOKEN_PRIMARY_GROUP TokenPrimaryGroup; + PTOKEN_GROUPS TokenGroups; + PTOKEN_PRIVILEGES TokenPrivileges; + TOKEN_DEFAULT_DACL TokenDefaultDacl; + LARGE_INTEGER ExpirationTime; + LUID AuthenticationId; + TOKEN_SOURCE TokenSource; + PSID UserSid = NULL; + PSID PrimaryGroupSid = NULL; + PSID OwnerSid = NULL; + PSID LocalSystemSid; + PACL Dacl; + NTSTATUS Status; + SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; + unsigned i; + + Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); + Qos.ImpersonationLevel = SecurityAnonymous; + Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING; + Qos.EffectiveOnly = FALSE; + + ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES); + ObjectAttributes.RootDirectory = NULL; + ObjectAttributes.ObjectName = NULL; + ObjectAttributes.Attributes = 0; + ObjectAttributes.SecurityDescriptor = NULL; + ObjectAttributes.SecurityQualityOfService = &Qos; + + Status = NtAllocateLocallyUniqueId(&AuthenticationId); + if (!NT_SUCCESS(Status)) + { + return FALSE; + } + + ExpirationTime.QuadPart = -1; + + /* Get the user SID from the registry */ + if (!SamGetUserSid (lpszUsername, &UserSid)) + { + ERR("SamGetUserSid() failed\n"); + return FALSE; + } + + TokenUser.User.Sid = UserSid; + TokenUser.User.Attributes = 0; + + /* Allocate and initialize token groups */ + TokenGroups = AllocateGroupSids(&PrimaryGroupSid, + &OwnerSid); + if (NULL == TokenGroups) + { + RtlFreeSid(UserSid); + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + + /* Allocate and initialize token privileges */ + TokenPrivileges = RtlAllocateHeap(GetProcessHeap(), 0, + sizeof(TOKEN_PRIVILEGES) + sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]) * sizeof(LUID_AND_ATTRIBUTES)); - if (NULL == TokenPrivileges) - { - FreeGroupSids(TokenGroups); - RtlFreeSid(UserSid); - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - - TokenPrivileges->PrivilegeCount = 0; - for (i = 0; i < sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]); i++) - { - if (! LookupPrivilegeValueW(NULL, DefaultPrivs[i].PrivName, - &TokenPrivileges->Privileges[TokenPrivileges->PrivilegeCount].Luid)) + if (NULL == TokenPrivileges) + { + FreeGroupSids(TokenGroups); + RtlFreeSid(UserSid); + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + + TokenPrivileges->PrivilegeCount = 0; + for (i = 0; i < sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]); i++) + { + if (! LookupPrivilegeValueW(NULL, + DefaultPrivs[i].PrivName, + &TokenPrivileges->Privileges[TokenPrivileges->PrivilegeCount].Luid)) { - WARN("Can't set privilege %S\n", DefaultPrivs[i].PrivName); + WARN("Can't set privilege %S\n", DefaultPrivs[i].PrivName); } - else + else { - TokenPrivileges->Privileges[TokenPrivileges->PrivilegeCount].Attributes = DefaultPrivs[i].Attributes; - TokenPrivileges->PrivilegeCount++; + TokenPrivileges->Privileges[TokenPrivileges->PrivilegeCount].Attributes = DefaultPrivs[i].Attributes; + TokenPrivileges->PrivilegeCount++; } } - TokenOwner.Owner = OwnerSid; - TokenPrimaryGroup.PrimaryGroup = PrimaryGroupSid; - - - Dacl = RtlAllocateHeap(GetProcessHeap(), 0, 1024); - if (Dacl == NULL) - { - FreeGroupSids(TokenGroups); - RtlFreeSid(UserSid); - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - - Status = RtlCreateAcl(Dacl, 1024, ACL_REVISION); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - FreeGroupSids(TokenGroups); - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - RtlFreeSid(UserSid); - return FALSE; - } - - RtlAddAccessAllowedAce(Dacl, - ACL_REVISION, - GENERIC_ALL, - OwnerSid); + TokenOwner.Owner = OwnerSid; + TokenPrimaryGroup.PrimaryGroup = PrimaryGroupSid; + + Dacl = RtlAllocateHeap(GetProcessHeap(), 0, 1024); + if (Dacl == NULL) + { + FreeGroupSids(TokenGroups); + RtlFreeSid(UserSid); + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + + Status = RtlCreateAcl(Dacl, 1024, ACL_REVISION); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(GetProcessHeap(), 0, Dacl); + FreeGroupSids(TokenGroups); + RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); + RtlFreeSid(UserSid); + return FALSE; + } + + RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + GENERIC_ALL, + OwnerSid); RtlAllocateAndInitializeSid(&SystemAuthority, - 1, - SECURITY_LOCAL_SYSTEM_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &LocalSystemSid); - - /* SID: S-1-5-18 */ - RtlAddAccessAllowedAce(Dacl, - ACL_REVISION, - GENERIC_ALL, - LocalSystemSid); - - RtlFreeSid(LocalSystemSid); - - TokenDefaultDacl.DefaultDacl = Dacl; - - memcpy(TokenSource.SourceName, - "User32 ", - 8); - Status = NtAllocateLocallyUniqueId(&TokenSource.SourceIdentifier); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - FreeGroupSids(TokenGroups); - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - RtlFreeSid(UserSid); - return FALSE; - } - - Status = NtCreateToken(phToken, - TOKEN_ALL_ACCESS, - &ObjectAttributes, - TokenPrimary, - &AuthenticationId, - &ExpirationTime, - &TokenUser, - TokenGroups, - TokenPrivileges, - &TokenOwner, - &TokenPrimaryGroup, - &TokenDefaultDacl, - &TokenSource); - - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - FreeGroupSids(TokenGroups); - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - RtlFreeSid(UserSid); - - return NT_SUCCESS(Status); + 1, + SECURITY_LOCAL_SYSTEM_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &LocalSystemSid); + + /* SID: S-1-5-18 */ + RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + GENERIC_ALL, + LocalSystemSid); + + RtlFreeSid(LocalSystemSid); + + TokenDefaultDacl.DefaultDacl = Dacl; + + memcpy(TokenSource.SourceName, + "User32 ", + 8); + + Status = NtAllocateLocallyUniqueId(&TokenSource.SourceIdentifier); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(GetProcessHeap(), 0, Dacl); + FreeGroupSids(TokenGroups); + RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); + RtlFreeSid(UserSid); + return FALSE; + } + + Status = NtCreateToken(phToken, + TOKEN_ALL_ACCESS, + &ObjectAttributes, + TokenPrimary, + &AuthenticationId, + &ExpirationTime, + &TokenUser, + TokenGroups, + TokenPrivileges, + &TokenOwner, + &TokenPrimaryGroup, + &TokenDefaultDacl, + &TokenSource); + + RtlFreeHeap(GetProcessHeap(), 0, Dacl); + FreeGroupSids(TokenGroups); + RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); + RtlFreeSid(UserSid); + + return NT_SUCCESS(Status); } /* EOF */ Modified: trunk/reactos/dll/win32/advapi32/misc/shutdown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/sh…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/shutdown.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/shutdown.c [iso-8859-1] Sat Sep 20 15:28:23 2008 @@ -43,10 +43,12 @@ RtlInitAnsiString(&MachineNameA, (LPSTR)lpMachineName); Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE); - if (STATUS_SUCCESS != Status) { + if (STATUS_SUCCESS != Status) + { SetLastError(RtlNtStatusToDosError(Status)); return FALSE; } + rv = AbortSystemShutdownW(MachineNameW.Buffer); RtlFreeUnicodeString(&MachineNameW); SetLastError(ERROR_SUCCESS); @@ -60,23 +62,26 @@ * @unimplemented */ BOOL STDCALL -InitiateSystemShutdownW( - LPWSTR lpMachineName, - LPWSTR lpMessage, - DWORD dwTimeout, - BOOL bForceAppsClosed, - BOOL bRebootAfterShutdown) +InitiateSystemShutdownW(LPWSTR lpMachineName, + LPWSTR lpMessage, + DWORD dwTimeout, + BOOL bForceAppsClosed, + BOOL bRebootAfterShutdown) { SHUTDOWN_ACTION Action = ShutdownNoReboot; - NTSTATUS Status; + NTSTATUS Status; - if (lpMachineName) { - /* FIXME: remote machine shutdown not supported yet */ + if (lpMachineName) + { + /* FIXME: remote machine shutdown not supported yet */ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } - if (dwTimeout) { + + if (dwTimeout) + { } + Status = NtShutdownSystem(Action); SetLastError(RtlNtStatusToDosError(Status)); return FALSE; @@ -90,12 +95,11 @@ */ BOOL STDCALL -InitiateSystemShutdownA( - LPSTR lpMachineName, - LPSTR lpMessage, - DWORD dwTimeout, - BOOL bForceAppsClosed, - BOOL bRebootAfterShutdown) +InitiateSystemShutdownA(LPSTR lpMachineName, + LPSTR lpMessage, + DWORD dwTimeout, + BOOL bForceAppsClosed, + BOOL bRebootAfterShutdown) { ANSI_STRING MachineNameA; ANSI_STRING MessageA; @@ -105,38 +109,49 @@ INT LastError; BOOL rv; - if (lpMachineName) { + if (lpMachineName) + { RtlInitAnsiString(&MachineNameA, lpMachineName); Status = RtlAnsiStringToUnicodeString(&MachineNameW, &MachineNameA, TRUE); - if (STATUS_SUCCESS != Status) { + if (STATUS_SUCCESS != Status) + { SetLastError(RtlNtStatusToDosError(Status)); return FALSE; } } - if (lpMessage) { + + if (lpMessage) + { RtlInitAnsiString(&MessageA, lpMessage); Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA, TRUE); - if (STATUS_SUCCESS != Status) { - if (MachineNameW.Length) { + if (STATUS_SUCCESS != Status) + { + if (MachineNameW.Length) + { RtlFreeUnicodeString(&MachineNameW); } + SetLastError(RtlNtStatusToDosError(Status)); return FALSE; } } - rv = InitiateSystemShutdownW( - MachineNameW.Buffer, - MessageW.Buffer, - dwTimeout, - bForceAppsClosed, - bRebootAfterShutdown); + + rv = InitiateSystemShutdownW(MachineNameW.Buffer, + MessageW.Buffer, + dwTimeout, + bForceAppsClosed, + bRebootAfterShutdown); LastError = GetLastError(); - if (lpMachineName) { + if (lpMachineName) + { RtlFreeUnicodeString(&MachineNameW); } - if (lpMessage) { + + if (lpMessage) + { RtlFreeUnicodeString(&MessageW); } + SetLastError(LastError); return rv; } @@ -146,9 +161,13 @@ * * see InitiateSystemShutdownExA */ -BOOL WINAPI InitiateSystemShutdownExW( LPWSTR lpMachineName, LPWSTR lpMessage, - DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown, - DWORD dwReason) +BOOL WINAPI +InitiateSystemShutdownExW(LPWSTR lpMachineName, + LPWSTR lpMessage, + DWORD dwTimeout, + BOOL bForceAppsClosed, + BOOL bRebootAfterShutdown, + DWORD dwReason) { UNIMPLEMENTED; return TRUE;
16 years, 3 months
1
0
0
0
[cgutman] 36356: - The handle passed to MiniRequestComplete, NdisMQueryInformationComplete, and NdisMSetInformationComplete is the Adapter not the MiniportBlock - Set MiniportBusy to FALSE in all the completion routines - Set MiniportBusy to TRUE in MiniQueueWorkItem - Only requeue the packet if it's a serialized miniport that returned NDIS_STATUS_RESOURCES - Hold the spin lock when requeuing the packet
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Sep 20 12:10:30 2008 New Revision: 36356 URL:
http://svn.reactos.org/svn/reactos?rev=36356&view=rev
Log: - The handle passed to MiniRequestComplete, NdisMQueryInformationComplete, and NdisMSetInformationComplete is the Adapter not the MiniportBlock - Set MiniportBusy to FALSE in all the completion routines - Set MiniportBusy to TRUE in MiniQueueWorkItem - Only requeue the packet if it's a serialized miniport that returned NDIS_STATUS_RESOURCES - Hold the spin lock when requeuing the packet Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sat Sep 20 12:10:30 2008 @@ -309,10 +309,11 @@ VOID NTAPI MiniRequestComplete( - IN PNDIS_MINIPORT_BLOCK Adapter, + IN PNDIS_HANDLE MiniportAdapterHandle, IN PNDIS_REQUEST Request, IN NDIS_STATUS Status) { + PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportAdapterHandle; PNDIS_REQUEST_MAC_BLOCK MacBlock = (PNDIS_REQUEST_MAC_BLOCK)Request->MacReserved; KIRQL OldIrql; @@ -326,6 +327,7 @@ Status); } KeLowerIrql(OldIrql); + Adapter->MiniportBusy = FALSE; } VOID NTAPI @@ -342,6 +344,7 @@ * Status = Status of send operation */ { + PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle; PADAPTER_BINDING AdapterBinding; KIRQL OldIrql; @@ -355,6 +358,7 @@ Packet, Status); KeLowerIrql(OldIrql); + Adapter->MiniportBusy = FALSE; } @@ -375,6 +379,7 @@ IN NDIS_STATUS Status, IN UINT BytesTransferred) { + PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle; PADAPTER_BINDING AdapterBinding; KIRQL OldIrql; @@ -388,6 +393,7 @@ Packet, Status); KeLowerIrql(OldIrql); + Adapter->MiniportBusy = FALSE; } @@ -628,6 +634,8 @@ KeInsertQueueDpc(&Adapter->NdisMiniportBlock.DeferredDpc, NULL, NULL); + Adapter->MiniportBusy = TRUE; + return NDIS_STATUS_SUCCESS; } @@ -738,14 +746,15 @@ IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status) { - PNDIS_MINIPORT_BLOCK MiniportBlock = - (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle; + PLOGICAL_ADAPTER Adapter = + (PLOGICAL_ADAPTER)MiniportAdapterHandle; KIRQL OldIrql; - ASSERT(MiniportBlock); + ASSERT(Adapter); KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - if( MiniportBlock->QueryCompleteHandler ) - (MiniportBlock->QueryCompleteHandler)(MiniportAdapterHandle, Status); + if( Adapter->NdisMiniportBlock.QueryCompleteHandler ) + (Adapter->NdisMiniportBlock.QueryCompleteHandler)(MiniportAdapterHandle, Status); KeLowerIrql(OldIrql); + Adapter->MiniportBusy = FALSE; } VOID NTAPI MiniportWorker(IN PVOID WorkItem) @@ -783,6 +792,7 @@ NDIS_DbgPrint(MAX_TRACE, ("Calling miniport's SendPackets handler\n")); (*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.SendPacketsHandler)( Adapter->NdisMiniportBlock.MiniportAdapterContext, (PPNDIS_PACKET)&WorkItemContext, 1); + NdisStatus = NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext); } else { @@ -794,9 +804,15 @@ Adapter->NdisMiniportBlock.MiniportAdapterContext, (PPNDIS_PACKET)&WorkItemContext, 1); } KeLowerIrql(RaiseOldIrql); + + NdisStatus = NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext); + if( NdisStatus == NDIS_STATUS_RESOURCES ) { + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); + MiniQueueWorkItem(Adapter, WorkItemType, WorkItemContext); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); + break; + } } - - NdisStatus = NDIS_GET_PACKET_STATUS((PNDIS_PACKET)WorkItemContext); } else { @@ -816,15 +832,18 @@ Adapter->NdisMiniportBlock.MiniportAdapterContext, (PNDIS_PACKET)WorkItemContext, 0); NDIS_DbgPrint(MAX_TRACE, ("back from miniport's send handler\n")); KeLowerIrql(RaiseOldIrql); + if( NdisStatus == NDIS_STATUS_RESOURCES ) { + KeAcquireSpinLock(&Adapter->NdisMiniportBlock.Lock, &OldIrql); + MiniQueueWorkItem(Adapter, WorkItemType, WorkItemContext); + KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql); + break; + } } } - if( NdisStatus == NDIS_STATUS_RESOURCES ) - MiniQueueWorkItem(Adapter, WorkItemType, WorkItemContext); - else if( NdisStatus != NDIS_STATUS_PENDING ) { + if( NdisStatus != NDIS_STATUS_PENDING ) { NdisMSendComplete ( Adapter, (PNDIS_PACKET)WorkItemContext, NdisStatus ); - Adapter->MiniportBusy = FALSE; } break; @@ -859,12 +878,12 @@ { case NdisRequestQueryInformation: NdisMQueryInformationComplete((NDIS_HANDLE)Adapter, NdisStatus); - MiniRequestComplete( &Adapter->NdisMiniportBlock, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); + MiniRequestComplete( (NDIS_HANDLE)Adapter, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); break; case NdisRequestSetInformation: NdisMSetInformationComplete((NDIS_HANDLE)Adapter, NdisStatus); - MiniRequestComplete( &Adapter->NdisMiniportBlock, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); + MiniRequestComplete( (NDIS_HANDLE)Adapter, (PNDIS_REQUEST)WorkItemContext, NdisStatus ); break; default: @@ -1988,10 +2007,14 @@ IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_STATUS Status) { + PLOGICAL_ADAPTER Adapter = + (PLOGICAL_ADAPTER)MiniportAdapterHandle; KIRQL OldIrql; + ASSERT(Adapter); KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SetCompleteHandler)(MiniportAdapterHandle, Status); + (Adapter->NdisMiniportBlock.SetCompleteHandler)(MiniportAdapterHandle, Status); KeLowerIrql(OldIrql); + Adapter->MiniportBusy = FALSE; }
16 years, 3 months
1
0
0
0
[tkreuzer] 36355: - fix a typo - silence debug output
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 20 10:34:59 2008 New Revision: 36355 URL:
http://svn.reactos.org/svn/reactos?rev=36355&view=rev
Log: - fix a typo - silence debug output Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c [iso-8859-1] Sat Sep 20 10:34:59 2008 @@ -253,7 +253,7 @@ /* Map APIC page */ if (!FrLdrMapSinglePage(APIC_BASE, APIC_PHYS_BASE)) { - DbgPrint("Could not map APIC page.\n", KernelPages); + DbgPrint("Could not map APIC page.\n"); } } Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] Sat Sep 20 10:34:59 2008 @@ -26,8 +26,8 @@ //#define DEBUG_ALL //#define DEBUG_INIFILE //#define DEBUG_REACTOS -#define DEBUG_CUSTOM -//#define DEBUG_NONE +//#define DEBUG_CUSTOM +#define DEBUG_NONE #if defined (DEBUG_ALL) ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM |
16 years, 3 months
1
0
0
0
[pschweitzer] 36354: Started porting wineimport to Linux That's a WIP
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Sep 20 10:02:43 2008 New Revision: 36354 URL:
http://svn.reactos.org/svn/reactos?rev=36354&view=rev
Log: Started porting wineimport to Linux That's a WIP Added: trunk/tools/wineimport.sh (with props) Added: trunk/tools/wineimport.sh URL:
http://svn.reactos.org/svn/reactos/trunk/tools/wineimport.sh?rev=36354&view…
============================================================================== --- trunk/tools/wineimport.sh (added) +++ trunk/tools/wineimport.sh [iso-8859-1] Sat Sep 20 10:02:43 2008 @@ -1,0 +1,94 @@ +#!/bin/bash +# +# Copyright (C) 2006-2008 Hervé Poussineau (hpoussin(a)reactos.org) +# Copyright (C) 2008 Pierre Schweitzer (pschweitzer(a)reactos.org) + +# **************************************************************************** +# Internal functions +int_help() +{ + echo "Syntax:" + echo "$0 download {wine_lib} [{wine_lib} ...]" + echo "$0 createrbuild {wine_lib} [{wine_lib} ...]" + echo "$0 link {path_to_reactos} {wine_lib}" + echo "$0 merge {path_to_reactos} {wine_lib} [{wine_lib} ...]" + echo "$0 make {path_to_reactos} {wine_lib} [{wine_lib} ...]" + echo "$0 fullprocessing {path_to_reactos} {wine_lib} [{wine_lib} ...]" + exit 0 +} + +int_download() +{ + if [ "$2" == "" ]; then + int_help + fi + export CVSROOT=":pserver:cvs:cvs@cvs.winehq.org:/home/wine" + cvs login &>/dev/null + if [ $? = 127 ]; then + echo "Error when executing cvs. Try to download the lastest version using" + echo "sudo apt-get install cvs" + fi + while [ "$2" != "" ]; do + echo "Downloading $2 ..." + if [ ! -e "wine/dlls/$2/Makefile.in" ]; then + cvs -z 3 checkout wine/dlls/$2 #&>/dev/null + fi + if [ ! -e "wine/dlls/$2/Makefile.in" ]; then + echo "Error when downloading $2. Are you sure it does exist?" + exit 0 + fi + cvs -z 3 update -dPA wine/dlls/$2 #&>/dev/null + shift + done + cvs logout &>/dev/null + exit 0 +} + +# **************************************************************************** +# Stubs for unimplemented functions +int_createbuild() +{ + echo "createbuild isn't implemented!" + int_help +} +int_link() +{ + echo "link isn't implemented!" + int_help +} +int_merge() +{ + echo "merge isn't implemented!" + int_help +} +int_make() +{ + echo "make isn't implemented!" + int_help +} +int_fullprocessing() +{ + echo "fullprocessing isn't implemented!" + int_help +} + +# **************************************************************************** +# Script + +WINE_TMPFILE1="tmpfile1.wine" + +if [ "$1" == "download" ]; then + int_download "$@" +elif [ "$1" == "createrbuild" ]; then + int_createrbuild +elif [ "$1" == "link" ]; then + int_link +elif [ "$1" == "merge" ]; then + int_merge +elif [ "$1" == "make" ]; then + int_make +elif [ "$1" == "fullprocessing" ]; then + int_fullprocessing +else + int_help +fi Propchange: trunk/tools/wineimport.sh ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 3 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
75
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Results per page:
10
25
50
100
200