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
May 2007
----- 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
17 participants
322 discussions
Start a n
N
ew thread
[ekohl] 26655: Save user cursor schemes using the environment variables SystemRoot, USERPROFILE or ProgramFiles in the cursor paths instead of absolute paths.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed May 9 02:13:18 2007 New Revision: 26655 URL:
http://svn.reactos.org/svn/reactos?rev=26655&view=rev
Log: Save user cursor schemes using the environment variables SystemRoot, USERPROFILE or ProgramFiles in the cursor paths instead of absolute paths. Modified: trunk/reactos/dll/cpl/main/mouse.c Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=2…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c (original) +++ trunk/reactos/dll/cpl/main/mouse.c Wed May 9 02:13:18 2007 @@ -424,6 +424,42 @@ } +static VOID +CompressPath(LPTSTR lpShortPath, LPTSTR lpPath) +{ + TCHAR szUserProfile[MAX_PATH]; + TCHAR szSystemRoot[MAX_PATH]; + TCHAR szProgramFiles[MAX_PATH]; + DWORD dwUserProfile; + DWORD dwSystemRoot; + DWORD dwProgramFiles; + + dwUserProfile = GetEnvironmentVariable(_T("USERPROFILE"), szUserProfile, MAX_PATH); + dwSystemRoot = GetEnvironmentVariable(_T("SystemRoot"), szSystemRoot, MAX_PATH); + dwProgramFiles = GetEnvironmentVariable(_T("ProgramFiles"), szProgramFiles, MAX_PATH); + + if (dwUserProfile > 0 && _tcsncmp(lpPath, szUserProfile, dwUserProfile) == 0) + { + _tcscpy(lpShortPath, _T("%USERPROFILE%")); + _tcscat(lpShortPath, &lpPath[dwUserProfile]); + } + else if (dwSystemRoot > 0 && _tcsncmp(lpPath, szSystemRoot, dwSystemRoot) == 0) + { + _tcscpy(lpShortPath, _T("%SystemRoot%")); + _tcscat(lpShortPath, &lpPath[dwSystemRoot]); + } + else if (dwProgramFiles > 0 && _tcsncmp(lpPath, szProgramFiles, dwProgramFiles) == 0) + { + _tcscpy(lpShortPath, _T("%ProgramFiles%")); + _tcscat(lpShortPath, &lpPath[dwProgramFiles]); + } + else + { + _tcscpy(lpShortPath, lpPath); + } +} + + static BOOL EnumerateCursorSchemes(HWND hwndDlg) { @@ -433,6 +469,7 @@ DWORD dwValueName; TCHAR szSystemScheme[MAX_PATH]; TCHAR szValueData[2000]; + TCHAR szTempData[2000]; DWORD dwValueData; LONG lError; HWND hDlgCtrl; @@ -446,6 +483,50 @@ 0, KEY_READ | KEY_QUERY_VALUE , &hCursorKey); if (lError == ERROR_SUCCESS) { + for (dwIndex = 0;; dwIndex++) + { + dwValueName = sizeof(szValueName) / sizeof(TCHAR); + dwValueData = sizeof(szValueData) / sizeof(TCHAR); + lError = RegEnumValue(hCursorKey, dwIndex, szValueName, &dwValueName, + NULL, NULL, (LPBYTE)szValueData, &dwValueData); + if (lError == ERROR_NO_MORE_ITEMS) + break; + + ExpandEnvironmentStrings(szValueData, szTempData, 2000); + + if (_tcslen(szTempData) > 0) + { + LPTSTR lpCopy, lpStart; + + /* Remove quotation marks */ + if (szTempData[0] == _T('"')) + { + lpStart = szValueData + 1; + szTempData[_tcslen(szTempData) - 1] = 0; + } + else + { + lpStart = szTempData; + } + + lpCopy = _tcsdup(lpStart); + + lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValueName); + SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)lpCopy); + } + } + + RegCloseKey(hCursorKey); + } + + /* Read the system cursor schemes */ + lError = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cursors\\Schemes"), + 0, KEY_READ | KEY_QUERY_VALUE , &hCursorKey); + if (lError == ERROR_SUCCESS) + { + LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); + for (dwIndex = 0;; dwIndex++) { dwValueName = sizeof(szValueName) / sizeof(TCHAR); @@ -472,48 +553,6 @@ lpCopy = _tcsdup(lpStart); - lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValueName); - SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)lpCopy); - } - } - - RegCloseKey(hCursorKey); - } - - /* Read the system cursor schemes */ - lError = RegOpenKeyEx(HKEY_LOCAL_MACHINE, - _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cursors\\Schemes"), - 0, KEY_READ | KEY_QUERY_VALUE , &hCursorKey); - if (lError == ERROR_SUCCESS) - { - LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); - - for (dwIndex = 0;; dwIndex++) - { - dwValueName = sizeof(szValueName) / sizeof(TCHAR); - dwValueData = sizeof(szValueData) / sizeof(TCHAR); - lError = RegEnumValue(hCursorKey, dwIndex, szValueName, &dwValueName, - NULL, NULL, (LPBYTE)szValueData, &dwValueData); - if (lError == ERROR_NO_MORE_ITEMS) - break; - - if (_tcslen(szValueData) > 0) - { - LPTSTR lpCopy, lpStart; - - /* Remove quotation marks */ - if (szValueData[0] == _T('"')) - { - lpStart = szValueData + 1; - szValueData[_tcslen(szValueData) - 1] = 0; - } - else - { - lpStart = szValueData; - } - - lpCopy = _tcsdup(lpStart); - _tcscat(szValueName, TEXT(" ")); _tcscat(szValueName, szSystemScheme); @@ -661,6 +700,7 @@ TCHAR szSystemScheme[MAX_PATH]; TCHAR szSchemeName[MAX_PATH]; TCHAR szNewSchemeName[MAX_PATH]; + TCHAR szTempPath[MAX_PATH]; TCHAR szTitle[128]; TCHAR szText[256]; INT nSel; @@ -739,9 +779,10 @@ for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++) { + CompressPath(szTempPath, g_CursorData[i].szCursorPath); if (i > 0) _tcscat(lpSchemeData, _T(",")); - _tcscat(lpSchemeData, g_CursorData[i].szCursorPath); + _tcscat(lpSchemeData, szTempPath); } if (RegOpenCurrentUser(KEY_READ | KEY_SET_VALUE, &hCuKey) != ERROR_SUCCESS) @@ -753,8 +794,9 @@ return FALSE; } - lError = RegSetValueEx(hCuCursorKey, szNewSchemeName, 0, REG_EXPAND_SZ, - (LPBYTE)lpSchemeData, nLength * sizeof(TCHAR)); + lError = RegSetValueEx(hCuCursorKey, szNewSchemeName, 0, + REG_EXPAND_SZ, (LPBYTE)lpSchemeData, + (_tcslen(lpSchemeData) + 1) * sizeof(TCHAR)); RegCloseKey(hCuCursorKey); RegCloseKey(hCuKey); @@ -1080,6 +1122,7 @@ { TCHAR szSchemeName[MAX_PATH]; TCHAR szSystemScheme[MAX_PATH]; + TCHAR szTempPath[MAX_PATH]; LPTSTR lpSchemeData; DWORD dwNameLength; DWORD dwSchemeSource; @@ -1131,9 +1174,10 @@ for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++) { + CompressPath(szTempPath, g_CursorData[i].szCursorPath); RegSetValueEx(hCursorKey, g_CursorData[i].lpValueName, 0, - REG_EXPAND_SZ, (LPBYTE)g_CursorData[i].szCursorPath, - (_tcslen(g_CursorData[i].szCursorPath) + 1) * sizeof(TCHAR)); + REG_EXPAND_SZ, (LPBYTE)szTempPath, + (_tcslen(szTempPath) + 1) * sizeof(TCHAR)); } RegCloseKey(hCursorKey);
17 years, 7 months
1
0
0
0
[ion] 26654: - Fix broken definition of IsBoostAllowed which would cause ERESOURCE boosts to be applied backwards. - Use cleaner, inlined definitions for ExAcquire/ReleaseResourceLock. - Convert ERESOURCE code to use a Queued In-Stack Spinlock instead of a regular spinlock. - Force usage of the spinlock instead of cli/sti for DBG builds, and enable strict sanity checks. - Fix incorrect check in ExpCheckForApcsDisabled. - Properly handle memory starvation in the contended path. - Make sure to all
by ion@svn.reactos.org
Author: ion Date: Wed May 9 01:35:10 2007 New Revision: 26654 URL:
http://svn.reactos.org/svn/reactos?rev=26654&view=rev
Log: - Fix broken definition of IsBoostAllowed which would cause ERESOURCE boosts to be applied backwards. - Use cleaner, inlined definitions for ExAcquire/ReleaseResourceLock. - Convert ERESOURCE code to use a Queued In-Stack Spinlock instead of a regular spinlock. - Force usage of the spinlock instead of cli/sti for DBG builds, and enable strict sanity checks. - Fix incorrect check in ExpCheckForApcsDisabled. - Properly handle memory starvation in the contended path. - Make sure to allocate a semaphore if needed during ExAcquireSharedStarveExclusive. - Fix multiple bugs in ExIsResourceAcquiredSharedLite. - ExReleaseResourceForThreadLite didn't always properly set the ResourceOwnedExclusive flag, and didn't validate ownership. - ExSetResourceOwnerPointer wouldn't set the owner if there wasn't one already. Modified: trunk/reactos/ntoskrnl/ex/resource.c trunk/reactos/ntoskrnl/include/internal/ex.h Modified: trunk/reactos/ntoskrnl/ex/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/resource.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/resource.c (original) +++ trunk/reactos/ntoskrnl/ex/resource.c Wed May 9 01:35:10 2007 @@ -1,19 +1,17 @@ /* - * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Kernel + * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/ex/resource.c - * PURPOSE: ERESOURCE Implementation - * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) + * PURPOSE: Executive Resource Implementation + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) */ -/* WARNING: +/* + * WARNING: * This implementation is the Windows NT 5.x one. - * NT 6.0 beta has optimized the OwnerThread entry array - * and the internals of ExpFindEntryForThread and ExpFindFreeEntry - * need to be modified accordingly in order to support the WDK. - * These changes will not be made here until NT 6.0 reaches RTM status since - * there is a possibility that they will be removed; as such, do NOT - * update ERESOURCE/relevant code to the WDK definition. + * Vista has optimized the OwnerThread entry array and the internals of + * ExpFindEntryForThread and ExpFindFreeEntry probably need to be modified + * accordingly in order to support the WDK. */ /* INCLUDES *****************************************************************/ @@ -26,15 +24,65 @@ #define IsExclusiveWaiting(r) (r->NumberOfExclusiveWaiters) #define IsSharedWaiting(r) (r->NumberOfSharedWaiters) #define IsOwnedExclusive(r) (r->Flag & ResourceOwnedExclusive) -#define IsBoostAllowed(r) (r->Flag & ResourceHasDisabledPriorityBoost) +#define IsBoostAllowed(r) (!(r->Flag & ResourceHasDisabledPriorityBoost)) + +#if (!(defined(CONFIG_SMP)) && !(defined(DBG))) + +VOID +FORCEINLINE +ExAcquireResourceLock(IN PERESOURCE_XP Resource, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + UNREFERENCED_PARAMETER(Resource); + UNREFERENCED_PARAMETER(LockHandle); + + /* Simply disable interrupts */ + _disable(); +} + +VOID +FORCEINLINE +ExReleaseResourceLock(IN PERESOURCE_XP Resource, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + UNREFERENCED_PARAMETER(Resource); + UNREFERENCED_PARAMETER(LockHandle); + + /* Simply enable interrupts */ + _disable(); +} + +#else + +VOID +FORCEINLINE +ExAcquireResourceLock(IN PERESOURCE_XP Resource, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + /* Acquire the lock */ + KeAcquireInStackQueuedSpinLock(&Resource->SpinLock, LockHandle); +} + +VOID +FORCEINLINE +ExReleaseResourceLock(IN PERESOURCE_XP Resource, + IN PKLOCK_QUEUE_HANDLE LockHandle) +{ + UNREFERENCED_PARAMETER(Resource); + + /* Release the lock */ + KeReleaseInStackQueuedSpinLock(LockHandle); +} +#endif /* DATA***********************************************************************/ +LARGE_INTEGER ExShortTime = {{-100000, -1}}; LARGE_INTEGER ExpTimeout; ULONG ExpResourceTimeoutCount = 90 * 3600 / 2; KSPIN_LOCK ExpResourceSpinLock; LIST_ENTRY ExpSystemResourcesList; -BOOLEAN ExResourceStrict = FALSE; /* FIXME */ +BOOLEAN ExResourceStrict = TRUE; /* PRIVATE FUNCTIONS *********************************************************/ @@ -74,8 +122,8 @@ * The ExpCheckForApcsDisabled routine checks if Kernel APCs are still * enabled when they should be disabled, and optionally breakpoints. * - * @param BreakIfTrue - * Specifies if we should break if an invalid APC State is detected. + * @param Irql + * Specifies the IRQL during the acquire attempt. * * @param Resource * Pointer to the resource being checked. @@ -90,15 +138,15 @@ *--*/ VOID NTAPI -ExpCheckForApcsDisabled(IN BOOLEAN BreakIfTrue, +ExpCheckForApcsDisabled(IN KIRQL Irql, IN PERESOURCE_XP Resource, - IN PETHREAD Thread) + IN PKTHREAD Thread) { /* Check if we should care and check if we should break */ if ((ExResourceStrict) && - (BreakIfTrue) && - !(Thread->SystemThread) && - !(Thread->Tcb.CombinedApcDisable)) + (Irql >= APC_LEVEL) && + !(((PETHREAD)Thread)->SystemThread) && + !(Thread->CombinedApcDisable)) { /* Bad! */ DPRINT1("EX: resource: APCs still enabled before resource %p acquire " @@ -143,8 +191,8 @@ * @param Resource * Pointer to the resource. * - * @param OldIrql - * Pointer to current IRQL. TBC: Pointer to in-stack queued spinlock. + * @param LockHandle + * Pointer to in-stack queued spinlock. * * @return None. * @@ -154,33 +202,44 @@ VOID NTAPI ExpAllocateExclusiveWaiterEvent(IN PERESOURCE_XP Resource, - IN PKIRQL OldIrql) + IN PKLOCK_QUEUE_HANDLE LockHandle) { PKEVENT Event; /* Release the lock */ - ExReleaseResourceLock(&Resource->SpinLock, *OldIrql); - - /* Allocate the event */ - Event = ExAllocatePoolWithTag(NonPagedPool, - sizeof(KEVENT), - TAG_RESOURCE_EVENT); - - /* Initialize it */ - KeInitializeEvent(Event, SynchronizationEvent, FALSE); - - /* Set it */ - if (InterlockedCompareExchangePointer(&Resource->ExclusiveWaiters, - Event, - NULL)) - { - /* Someone already set it, free our event */ - DPRINT1("WARNING: Handling race condition\n"); - ExFreePool(Event); - } + ExReleaseResourceLock(Resource, LockHandle); + + /* Loop as long as we keep running out of memory */ + do + { + /* Allocate the event */ + Event = ExAllocatePoolWithTag(NonPagedPool, + sizeof(KEVENT), + TAG_RESOURCE_EVENT); + if (Event) + { + /* Initialize it */ + KeInitializeEvent(Event, SynchronizationEvent, FALSE); + + /* Set it */ + if (InterlockedCompareExchangePointer(&Resource->ExclusiveWaiters, + Event, + NULL)) + { + /* Someone already set it, free our event */ + DPRINT1("WARNING: Handling race condition\n"); + ExFreePool(Event); + } + + break; + } + + /* Wait a bit before trying again */ + KeDelayExecutionThread(KernelMode, FALSE, &ExShortTime); + } while (TRUE); /* Re-acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, OldIrql); + ExAcquireResourceLock(Resource, LockHandle); } /*++ @@ -192,8 +251,8 @@ * @param Resource * Pointer to the resource. * - * @param OldIrql - * Pointer to current IRQL. TBC: Pointer to in-stack queued spinlock. + * @param LockHandle + * Pointer to in-stack queued spinlock. * * @return None. * @@ -203,33 +262,44 @@ VOID NTAPI ExpAllocateSharedWaiterSemaphore(IN PERESOURCE_XP Resource, - IN PKIRQL OldIrql) + IN PKLOCK_QUEUE_HANDLE LockHandle) { PKSEMAPHORE Semaphore; /* Release the lock */ - ExReleaseResourceLock(&Resource->SpinLock, *OldIrql); - - /* Allocate the semaphore */ - Semaphore = ExAllocatePoolWithTag(NonPagedPool, - sizeof(KSEMAPHORE), - TAG_RESOURCE_SEMAPHORE); - - /* Initialize it */ - KeInitializeSemaphore(Semaphore, 0, MAXLONG); - - /* Set it */ - if (InterlockedCompareExchangePointer(&Resource->SharedWaiters, - Semaphore, - NULL)) - { - /* Someone already set it, free our semaphore */ - DPRINT1("WARNING: Handling race condition\n"); - ExFreePool(Semaphore); - } + ExReleaseResourceLock(Resource, LockHandle); + + /* Loop as long as we keep running out of memory */ + do + { + /* Allocate the semaphore */ + Semaphore = ExAllocatePoolWithTag(NonPagedPool, + sizeof(KSEMAPHORE), + TAG_RESOURCE_SEMAPHORE); + if (Semaphore) + { + /* Initialize it */ + KeInitializeSemaphore(Semaphore, 0, MAXLONG); + + /* Set it */ + if (InterlockedCompareExchangePointer(&Resource->SharedWaiters, + Semaphore, + NULL)) + { + /* Someone already set it, free our semaphore */ + DPRINT1("WARNING: Handling race condition\n"); + ExFreePool(Semaphore); + } + + break; + } + + /* Wait a bit before trying again */ + KeDelayExecutionThread(KernelMode, FALSE, &ExShortTime); + } while (TRUE); /* Re-acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, OldIrql); + ExAcquireResourceLock(Resource, LockHandle); } /*++ @@ -241,8 +311,8 @@ * @param Resource * Pointer to the resource. * - * @param OldIrql - * Pointer to current IRQL. TBC: Pointer to in-stack queued spinlock. + * @param LockHandle + * Pointer to in-stack queued spinlock. * * @return None. * @@ -252,12 +322,11 @@ VOID NTAPI ExpExpandResourceOwnerTable(IN PERESOURCE_XP Resource, - IN PKIRQL OldIrql) + IN PKLOCK_QUEUE_HANDLE LockHandle) { POWNER_ENTRY Owner, Table; - KIRQL OldIrql2; + KIRQL OldIrql; ULONG NewSize, OldSize; - DPRINT("ExpExpandResourceOwnerTable: %p\n", Resource); /* Get the owner table */ Owner = Resource->OwnerTable; @@ -275,7 +344,7 @@ } /* Release the lock */ - ExReleaseResourceLock(&Resource->SpinLock, *OldIrql); + ExReleaseResourceLock(Resource, LockHandle); /* Allocate memory for the table */ Table = ExAllocatePoolWithTag(NonPagedPool, @@ -287,38 +356,36 @@ (NewSize - OldSize) * sizeof(OWNER_ENTRY)); /* Lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, OldIrql); + ExAcquireResourceLock(Resource, LockHandle); /* Make sure nothing has changed */ if ((Owner != Resource->OwnerTable) || - ((Owner) && (OldSize != Resource->OwnerTable->TableSize))) + ((Owner) && (OldSize != Owner->TableSize))) { /* Resource changed while we weren't holding the lock; bail out */ - ExReleaseResourceLock(&Resource->SpinLock, *OldIrql); + ExReleaseResourceLock(Resource, LockHandle); ExFreePool(Table); } else { /* Copy the table */ - RtlCopyMemory(Table, - Owner, - OldSize * sizeof(OWNER_ENTRY)); + RtlCopyMemory(Table, Owner, OldSize * sizeof(OWNER_ENTRY)); /* Acquire dispatcher lock to prevent thread boosting */ - OldIrql2 = KiAcquireDispatcherLock(); + OldIrql = KiAcquireDispatcherLock(); /* Set the new table data */ Table->TableSize = NewSize; Resource->OwnerTable = Table; /* Release dispatcher lock */ - KiReleaseDispatcherLock(OldIrql2); + KiReleaseDispatcherLock(OldIrql); /* Sanity check */ ExpVerifyResource(Resource); /* Release lock */ - ExReleaseResourceLock(&Resource->SpinLock, *OldIrql); + ExReleaseResourceLock(Resource, LockHandle); /* Free the old table */ if (Owner) ExFreePool(Owner); @@ -331,7 +398,7 @@ KeGetCurrentThread()->ResourceIndex = (UCHAR)OldSize; /* Lock the resource again */ - ExAcquireResourceLock(&Resource->SpinLock, OldIrql); + ExAcquireResourceLock(Resource, LockHandle); } /*++ @@ -344,8 +411,8 @@ * @param Resource * Pointer to the resource. * - * @param OldIrql - * Pointer to current IRQL. TBC: Pointer to in-stack queued spinlock. + * @param LockHandle + * Pointer to in-stack queued spinlock. * * @return Pointer to an empty OWNER_ENTRY structure. * @@ -355,13 +422,13 @@ POWNER_ENTRY FASTCALL ExpFindFreeEntry(IN PERESOURCE_XP Resource, - IN PKIRQL OldIrql) + IN PKLOCK_QUEUE_HANDLE LockHandle) { POWNER_ENTRY Owner, Limit; POWNER_ENTRY FreeEntry = NULL; /* Sanity check */ - ASSERT(OldIrql != 0); + ASSERT(LockHandle != 0); ASSERT(Resource->OwnerThreads[0].OwnerThread != 0); /* Check if the next built-in entry is free */ @@ -385,9 +452,8 @@ if (!Owner->OwnerThread) { /* Update the resource entry and return it */ - KeGetCurrentThread()->ResourceIndex = (UCHAR)(Owner - - Resource-> - OwnerTable); + KeGetCurrentThread()->ResourceIndex = + (UCHAR)(Owner - Resource->OwnerTable); return Owner; } @@ -397,8 +463,7 @@ } /* No free entry, expand the table */ - ExpExpandResourceOwnerTable(Resource, OldIrql); - FreeEntry = NULL; + ExpExpandResourceOwnerTable(Resource, LockHandle); } /* Return the entry found */ @@ -418,8 +483,8 @@ * @param Thread * Pointer to the thread to find. * - * @param OldIrql - * Pointer to current IRQL. TBC: Pointer to in-stack queued spinlock. + * @param LockHandle + * Pointer to in-stack queued spinlock. * * @return Pointer to an empty OWNER_ENTRY structure. * @@ -430,7 +495,7 @@ FASTCALL ExpFindEntryForThread(IN PERESOURCE_XP Resource, IN ERESOURCE_THREAD Thread, - IN PKIRQL OldIrql) + IN PKLOCK_QUEUE_HANDLE LockHandle) { POWNER_ENTRY FreeEntry, Owner, Limit; @@ -456,9 +521,8 @@ if (Owner->OwnerThread == Thread) { /* We did, update the index and return it */ - KeGetCurrentThread()->ResourceIndex = (UCHAR)(Owner - - Resource-> - OwnerTable); + KeGetCurrentThread()->ResourceIndex = + (UCHAR)(Owner - Resource->OwnerTable); return Owner; } @@ -469,19 +533,19 @@ } /* Check if it's OK to do an expansion */ - if (!OldIrql) return NULL; + if (!LockHandle) return NULL; /* If we found a free entry by now, return it */ if (FreeEntry) { /* Set the resource index */ - KeGetCurrentThread()->ResourceIndex = (UCHAR)(FreeEntry - - Resource->OwnerTable); + KeGetCurrentThread()->ResourceIndex = + (UCHAR)(FreeEntry - Resource->OwnerTable); return FreeEntry; } /* No free entry, expand the table */ - ExpExpandResourceOwnerTable(Resource, OldIrql); + ExpExpandResourceOwnerTable(Resource, LockHandle); return NULL; } @@ -561,7 +625,7 @@ LARGE_INTEGER Timeout; PKTHREAD Thread, OwnerThread; #if DBG - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; #endif /* Increase contention count and use a 5 second timeout */ @@ -588,7 +652,7 @@ WaitCount = 0; #if DBG /* Lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* Dump debug information */ DPRINT1("Resource @ %lx\n", Resource); @@ -625,7 +689,7 @@ /* Break */ DbgBreakPoint(); DPRINT1("EX - Rewaiting\n"); - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); #endif } @@ -709,10 +773,10 @@ *--*/ BOOLEAN NTAPI -ExAcquireResourceExclusiveLite(PERESOURCE resource, - BOOLEAN Wait) -{ - KIRQL OldIrql = PASSIVE_LEVEL; +ExAcquireResourceExclusiveLite(IN PERESOURCE resource, + IN BOOLEAN Wait) +{ + KLOCK_QUEUE_HANDLE LockHandle; ERESOURCE_THREAD Thread; BOOLEAN Success; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -728,8 +792,8 @@ ExpVerifyResource(Resource); /* Acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); - ExpCheckForApcsDisabled(TRUE, Resource, (PETHREAD)Thread); + ExAcquireResourceLock(Resource, &LockHandle); + ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, (PKTHREAD)Thread); /* Check if there is a shared owner or exclusive owner */ TryAcquire: @@ -760,20 +824,19 @@ if (!Resource->ExclusiveWaiters) { /* It doesn't, allocate the event and try acquiring again */ - ExpAllocateExclusiveWaiterEvent(Resource, &OldIrql); + ExpAllocateExclusiveWaiterEvent(Resource, &LockHandle); goto TryAcquire; } - else - { - /* Has exclusive waiters, wait on it */ - Resource->NumberOfExclusiveWaiters++; - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); - ExpWaitForResource(Resource, Resource->ExclusiveWaiters); - - /* Set owner and return success */ - Resource->OwnerThreads[0].OwnerThread = ExGetCurrentResourceThread(); - return TRUE; - } + + /* Has exclusive waiters, wait on it */ + Resource->NumberOfExclusiveWaiters++; + ExReleaseResourceLock(Resource, &LockHandle); + ExpWaitForResource(Resource, Resource->ExclusiveWaiters); + + /* Set owner and return success */ + Resource->OwnerThreads[0].OwnerThread = + ExGetCurrentResourceThread(); + return TRUE; } } } @@ -788,7 +851,7 @@ } /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return Success; } @@ -824,10 +887,10 @@ *--*/ BOOLEAN NTAPI -ExAcquireResourceSharedLite(PERESOURCE resource, - BOOLEAN Wait) -{ - KIRQL OldIrql; +ExAcquireResourceSharedLite(IN PERESOURCE resource, + IN BOOLEAN Wait) +{ + KLOCK_QUEUE_HANDLE LockHandle; ERESOURCE_THREAD Thread; POWNER_ENTRY Owner; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -840,8 +903,8 @@ ExpVerifyResource(Resource); /* Acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); - ExpCheckForApcsDisabled(TRUE, Resource, (PETHREAD)Thread); + ExAcquireResourceLock(Resource, &LockHandle); + ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, (PKTHREAD)Thread); /* See if nobody owns us */ TryAcquire: @@ -854,7 +917,7 @@ Resource->ActiveCount = 1; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -868,18 +931,18 @@ Resource->OwnerThreads[0].OwnerCount++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } /* Find a free entry */ - Owner = ExpFindFreeEntry(Resource, &OldIrql); + Owner = ExpFindFreeEntry(Resource, &LockHandle); if (!Owner) goto TryAcquire; } else { /* Resource is shared, find who owns it */ - Owner = ExpFindEntryForThread(Resource, Thread, &OldIrql); + Owner = ExpFindEntryForThread(Resource, Thread, &LockHandle); if (!Owner) goto TryAcquire; /* Is it us? */ @@ -890,7 +953,7 @@ ASSERT(Owner->OwnerCount != 0); /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -903,7 +966,7 @@ Resource->ActiveCount++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } } @@ -912,7 +975,7 @@ if (!Wait) { /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return FALSE; } @@ -920,7 +983,7 @@ if (!Resource->SharedWaiters) { /* Allocate it and try another acquire */ - ExpAllocateSharedWaiterSemaphore(Resource, &OldIrql); + ExpAllocateSharedWaiterSemaphore(Resource, &LockHandle); goto TryAcquire; } @@ -930,7 +993,7 @@ Resource->NumberOfSharedWaiters++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); ExpWaitForResource(Resource, Resource->SharedWaiters); return TRUE; } @@ -975,10 +1038,10 @@ *--*/ BOOLEAN NTAPI -ExAcquireSharedStarveExclusive(PERESOURCE resource, - BOOLEAN Wait) -{ - KIRQL OldIrql; +ExAcquireSharedStarveExclusive(IN PERESOURCE resource, + IN BOOLEAN Wait) +{ + KLOCK_QUEUE_HANDLE LockHandle; ERESOURCE_THREAD Thread; POWNER_ENTRY Owner; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -991,7 +1054,7 @@ ExpVerifyResource(Resource); /* Acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* See if nobody owns us */ TryAcquire: @@ -1003,7 +1066,7 @@ Resource->OwnerThreads[1].OwnerCount = 1; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1017,18 +1080,18 @@ Resource->OwnerThreads[0].OwnerCount++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } /* Find a free entry */ - Owner = ExpFindFreeEntry(Resource, &OldIrql); + Owner = ExpFindFreeEntry(Resource, &LockHandle); if (!Owner) goto TryAcquire; } else { /* Resource is shared, find who owns it */ - Owner = ExpFindEntryForThread(Resource, Thread, &OldIrql); + Owner = ExpFindEntryForThread(Resource, Thread, &LockHandle); if (!Owner) goto TryAcquire; /* Is it us? */ @@ -1039,7 +1102,7 @@ ASSERT(Owner->OwnerCount != 0); /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1049,7 +1112,7 @@ Resource->ActiveCount++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1057,8 +1120,16 @@ if (!Wait) { /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; + } + + /* Check if we have a shared waiters semaphore */ + if (!Resource->SharedWaiters) + { + /* Allocate it and try another acquire */ + ExpAllocateSharedWaiterSemaphore(Resource, &LockHandle); + goto TryAcquire; } /* Now wait for the resource */ @@ -1067,7 +1138,7 @@ Resource->NumberOfSharedWaiters++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); ExpWaitForResource(Resource, Resource->SharedWaiters); return TRUE; } @@ -1108,7 +1179,7 @@ ExAcquireSharedWaitForExclusive(IN PERESOURCE resource, IN BOOLEAN Wait) { - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; ERESOURCE_THREAD Thread; POWNER_ENTRY Owner; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -1121,7 +1192,7 @@ ExpVerifyResource(Resource); /* Acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* See if nobody owns us */ TryAcquire: @@ -1133,7 +1204,7 @@ Resource->OwnerThreads[1].OwnerCount = 1; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1147,12 +1218,12 @@ Resource->OwnerThreads[0].OwnerCount++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } /* Find a free entry */ - Owner = ExpFindFreeEntry(Resource, &OldIrql); + Owner = ExpFindFreeEntry(Resource, &LockHandle); if (!Owner) goto TryAcquire; } else @@ -1164,7 +1235,7 @@ if (!Wait) { /* So bail out if we're not allowed */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1172,20 +1243,20 @@ if (!Resource->SharedWaiters) { /* Allocate one and try again */ - ExpAllocateSharedWaiterSemaphore(Resource, &OldIrql); + ExpAllocateSharedWaiterSemaphore(Resource, &LockHandle); goto TryAcquire; } /* Now wait for the resource */ Resource->NumberOfSharedWaiters++; - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); ExpWaitForResource(Resource, Resource->SharedWaiters); /* Get the lock back */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* Find who owns it now */ - while (!(Owner = ExpFindEntryForThread(Resource, Thread, &OldIrql))); + while (!(Owner = ExpFindEntryForThread(Resource, Thread, &LockHandle))); /* Sanity checks */ ASSERT(IsOwnedExclusive(Resource) == FALSE); @@ -1197,13 +1268,13 @@ Owner->OwnerCount = 1; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } else { /* Resource is shared, find who owns it */ - Owner = ExpFindEntryForThread(Resource, Thread, &OldIrql); + Owner = ExpFindEntryForThread(Resource, Thread, &LockHandle); if (!Owner) goto TryAcquire; /* Is it us? */ @@ -1214,7 +1285,7 @@ ASSERT(Owner->OwnerCount != 0); /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1224,7 +1295,7 @@ Resource->ActiveCount++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } } @@ -1233,7 +1304,7 @@ if (!Wait) { /* So bail out if we're not allowed */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return TRUE; } @@ -1241,7 +1312,7 @@ if (!Resource->SharedWaiters) { /* Allocate one and try again */ - ExpAllocateSharedWaiterSemaphore(Resource, &OldIrql); + ExpAllocateSharedWaiterSemaphore(Resource,&LockHandle); goto TryAcquire; } @@ -1251,7 +1322,7 @@ Resource->NumberOfSharedWaiters++; /* Release the lock and return */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); ExpWaitForResource(Resource, Resource->SharedWaiters); return TRUE; } @@ -1274,10 +1345,10 @@ *--*/ VOID NTAPI -ExConvertExclusiveToSharedLite(PERESOURCE resource) +ExConvertExclusiveToSharedLite(IN PERESOURCE resource) { ULONG OldWaiters; - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; /* Sanity checks */ @@ -1287,7 +1358,7 @@ ASSERT(Resource->OwnerThreads[0].OwnerThread == (ERESOURCE_THREAD)PsGetCurrentThread()); /* Lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* Erase the exclusive flag */ Resource->Flag &= ~ResourceOwnedExclusive; @@ -1301,13 +1372,13 @@ Resource->NumberOfSharedWaiters = 0; /* Release lock and wake the waiters */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeReleaseSemaphore(Resource->SharedWaiters, 0, OldWaiters, FALSE); } else { /* Release lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); } } @@ -1329,9 +1400,9 @@ *--*/ NTSTATUS NTAPI -ExDeleteResourceLite(PERESOURCE resource) -{ - KIRQL OldIrql; +ExDeleteResourceLite(IN PERESOURCE resource) +{ + KLOCK_QUEUE_HANDLE LockHandle; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; /* Sanity checks */ @@ -1341,13 +1412,13 @@ ExpVerifyResource(Resource); /* Lock the resource */ - KeAcquireSpinLock(&ExpResourceSpinLock, &OldIrql); + KeAcquireInStackQueuedSpinLock(&ExpResourceSpinLock, &LockHandle); /* Remove the resource */ RemoveEntryList(&Resource->SystemResourcesList); /* Release the lock */ - KeReleaseSpinLock(&ExpResourceSpinLock, OldIrql); + KeReleaseInStackQueuedSpinLock(&LockHandle); /* Free every structure */ if (Resource->OwnerTable) ExFreePool(Resource->OwnerTable); @@ -1375,22 +1446,22 @@ *--*/ VOID NTAPI -ExDisableResourceBoostLite(PERESOURCE resource) -{ - KIRQL OldIrql; +ExDisableResourceBoostLite(IN PERESOURCE resource) +{ + KLOCK_QUEUE_HANDLE LockHandle; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; /* Sanity check */ ExpVerifyResource(Resource); /* Lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* Remove the flag */ Resource->Flag |= ResourceHasDisabledPriorityBoost; /* Release the lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); } /*++ @@ -1410,7 +1481,7 @@ *--*/ ULONG NTAPI -ExGetExclusiveWaiterCount(PERESOURCE resource) +ExGetExclusiveWaiterCount(IN PERESOURCE resource) { PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -1435,7 +1506,7 @@ *--*/ ULONG NTAPI -ExGetSharedWaiterCount(PERESOURCE resource) +ExGetSharedWaiterCount(IN PERESOURCE resource) { PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -1461,9 +1532,10 @@ *--*/ NTSTATUS NTAPI -ExInitializeResourceLite(PERESOURCE resource) +ExInitializeResourceLite(IN PERESOURCE resource) { PERESOURCE_XP Resource = (PERESOURCE_XP)resource; + KLOCK_QUEUE_HANDLE LockHandle; /* Clear the structure */ RtlZeroMemory(Resource, sizeof(ERESOURCE_XP)); @@ -1472,9 +1544,9 @@ KeInitializeSpinLock(&Resource->SpinLock); /* Add it into the system list */ - ExInterlockedInsertTailList(&ExpSystemResourcesList, - &Resource->SystemResourcesList, - &ExpResourceSpinLock); + KeAcquireInStackQueuedSpinLock(&ExpResourceSpinLock, &LockHandle); + InsertTailList(&ExpSystemResourcesList, &Resource->SystemResourcesList); + KeReleaseInStackQueuedSpinLock(&LockHandle); /* Return success */ return STATUS_SUCCESS; @@ -1498,7 +1570,7 @@ *--*/ BOOLEAN NTAPI -ExIsResourceAcquiredExclusiveLite(PERESOURCE resource) +ExIsResourceAcquiredExclusiveLite(IN PERESOURCE resource) { ERESOURCE_THREAD Thread = ExGetCurrentResourceThread(); BOOLEAN IsAcquired = FALSE; @@ -1544,13 +1616,16 @@ ERESOURCE_THREAD Thread; ULONG i, Size; ULONG Count = 0; - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; POWNER_ENTRY Owner; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; /* Sanity check */ ExpVerifyResource(Resource); + /* Check if nobody owns us */ + if (!Resource->ActiveCount) return 0; + /* Get the thread */ Thread = ExGetCurrentResourceThread(); @@ -1560,50 +1635,57 @@ /* Found it, return count */ Count = Resource->OwnerThreads[0].OwnerCount; } - else if (Resource->OwnerThreads[1].OwnerThread == Thread) - { - /* Found it on the second list, return count */ - Count = Resource->OwnerThreads[1].OwnerCount; - } else { - /* Not in the list, do a full table look up */ - Owner = Resource->OwnerTable; - if (Owner) + /* We can't own an exclusive resource at this point */ + if (IsOwnedExclusive(Resource)) return 0; + + /* Check if we are in the other thread list */ + if (Resource->OwnerThreads[1].OwnerThread == Thread) + { + /* Found it on the second list, return count */ + Count = Resource->OwnerThreads[1].OwnerCount; + } + else { /* Lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); - - /* Get the resource index */ - i = ((PKTHREAD)Thread)->ResourceIndex; - Size = Owner->TableSize; - - /* Check if the index is valid and check if we don't match */ - if ((i >= Size) || (Owner[i].OwnerThread != Thread)) + ExAcquireResourceLock(Resource, &LockHandle); + + /* Not in the list, do a full table look up */ + Owner = Resource->OwnerTable; + if (Owner) { - /* Sh*t! We need to do a full search */ - for (i = 1; i < Size; i++) + /* Get the resource index */ + i = ((PKTHREAD)Thread)->ResourceIndex; + Size = Owner->TableSize; + + /* Check if the index is valid and check if we don't match */ + if ((i >= Size) || (Owner[i].OwnerThread != Thread)) { - /* Move to next owner */ - Owner++; - - /* Try to find a match */ - if (Owner->OwnerThread == Thread) + /* Sh*t! We need to do a full search */ + for (i = 1; i < Size; i++) { - /* Finally! */ - Count = Owner->OwnerCount; - break; + /* Move to next owner */ + Owner++; + + /* Try to find a match */ + if (Owner->OwnerThread == Thread) + { + /* Finally! */ + Count = Owner->OwnerCount; + break; + } } } + else + { + /* We found the match directlry */ + Count = Owner[i].OwnerCount; + } } - else - { - /* We found the match directlry */ - Count = Owner[i].OwnerCount; - } /* Release the lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); } } @@ -1637,7 +1719,7 @@ *--*/ NTSTATUS NTAPI -ExReinitializeResourceLite(PERESOURCE resource) +ExReinitializeResourceLite(IN PERESOURCE resource) { PKEVENT Event; PKSEMAPHORE Semaphore; @@ -1679,9 +1761,6 @@ Resource->ContentionCount = 0; Resource->NumberOfSharedWaiters = 0; Resource->NumberOfExclusiveWaiters = 0; - - /* Reset the spinlock */ - KeInitializeSpinLock(&Resource->SpinLock); return STATUS_SUCCESS; } @@ -1703,11 +1782,11 @@ *--*/ VOID FASTCALL -ExReleaseResourceLite(PERESOURCE resource) +ExReleaseResourceLite(IN PERESOURCE resource) { ERESOURCE_THREAD Thread; ULONG Count, i; - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; POWNER_ENTRY Owner, Limit; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -1716,19 +1795,18 @@ /* Get the thread and lock the resource */ Thread = ExGetCurrentResourceThread(); - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); - ExpCheckForApcsDisabled(TRUE, Resource, (PETHREAD)Thread); + ExAcquireResourceLock(Resource, &LockHandle); + ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, (PKTHREAD)Thread); /* Check if it's exclusively owned */ if (IsOwnedExclusive(Resource)) { /* Decrement owner count and check if we're done */ ASSERT(Resource->OwnerThreads[0].OwnerCount > 0); - ASSERT(Resource->ActiveCount == 1); if (--Resource->OwnerThreads[0].OwnerCount) { /* Done, release lock! */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return; } @@ -1745,13 +1823,13 @@ /* Remove the exclusive flag */ Resource->Flag &= ~ResourceOwnedExclusive; - /* Give ownage to another thread */ + /* Give ownership to another thread */ Count = Resource->NumberOfSharedWaiters; Resource->ActiveCount = (SHORT)Count; Resource->NumberOfSharedWaiters = 0; /* Release lock and let someone else have it */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeReleaseSemaphore(Resource->SharedWaiters, 0, Count, FALSE); return; } @@ -1764,7 +1842,7 @@ Resource->NumberOfExclusiveWaiters--; /* Release the lock and give it away */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeSetEventBoostPriority(Resource->ExclusiveWaiters, (PKTHREAD*) &Resource->OwnerThreads[0].OwnerThread); @@ -1843,7 +1921,7 @@ if (--Owner->OwnerCount) { /* Release lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return; } @@ -1865,7 +1943,7 @@ Resource->NumberOfExclusiveWaiters--; /* Release the lock and give it away */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeSetEventBoostPriority(Resource->ExclusiveWaiters, (PKTHREAD*) &Resource->OwnerThreads[0].OwnerThread); @@ -1875,7 +1953,7 @@ } /* Release lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); } /*++ @@ -1899,32 +1977,32 @@ *--*/ VOID NTAPI -ExReleaseResourceForThreadLite(PERESOURCE resource, - ERESOURCE_THREAD Thread) +ExReleaseResourceForThreadLite(IN PERESOURCE resource, + IN ERESOURCE_THREAD Thread) { ULONG i; ULONG Count; - KIRQL OldIrql; - POWNER_ENTRY Owner; + KLOCK_QUEUE_HANDLE LockHandle; + POWNER_ENTRY Owner, Limit; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; ASSERT(Thread != 0); /* Get the thread and lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); - - /* Sanity check */ + ExAcquireResourceLock(Resource, &LockHandle); + + /* Sanity checks */ ExpVerifyResource(Resource); + ExpCheckForApcsDisabled(LockHandle.OldIrql, Resource, (PKTHREAD)Thread); /* Check if it's exclusively owned */ if (IsOwnedExclusive(Resource)) { /* Decrement owner count and check if we're done */ ASSERT(Resource->OwnerThreads[0].OwnerThread == Thread); - ASSERT(Resource->OwnerThreads[0].OwnerCount > 0); if (--Resource->OwnerThreads[0].OwnerCount) { /* Done, release lock! */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return; } @@ -1947,7 +2025,7 @@ Resource->NumberOfSharedWaiters = 0; /* Release lock and let someone else have it */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeReleaseSemaphore(Resource->SharedWaiters, 0, Count, FALSE); return; } @@ -1960,7 +2038,7 @@ Resource->NumberOfExclusiveWaiters--; /* Release the lock and give it away */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeSetEventBoostPriority(Resource->ExclusiveWaiters, (PKTHREAD*) &Resource->OwnerThreads[0].OwnerThread); @@ -2000,10 +2078,22 @@ if ((i >= Owner->TableSize) || (Owner[i].OwnerThread != Thread)) { /* Get the last entry */ + Limit = &Owner[Owner->TableSize]; for (;;) { /* Move to the next entry */ Owner++; + + /* Make sure we're not out of bounds */ + if (Owner >= Limit) + { + /* Bugcheck, nobody owns us */ + KeBugCheckEx(RESOURCE_NOT_OWNED, + (ULONG_PTR)Resource, + (ULONG_PTR)Thread, + (ULONG_PTR)Resource->OwnerTable, + (ULONG_PTR)3); + } /* Check for a match */ if (Owner->OwnerThread == Thread) break; @@ -2024,7 +2114,7 @@ if (!(--Owner->OwnerCount)) { /* Release lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return; } @@ -2039,13 +2129,14 @@ if (IsExclusiveWaiting(Resource)) { /* Give exclusive access */ + Resource->Flag |= ResourceOwnedExclusive; Resource->OwnerThreads[0].OwnerThread = 1; Resource->OwnerThreads[0].OwnerCount = 1; Resource->ActiveCount = 1; Resource->NumberOfExclusiveWaiters--; /* Release the lock and give it away */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); KeSetEventBoostPriority(Resource->ExclusiveWaiters, (PKTHREAD*) &Resource->OwnerThreads[0].OwnerThread); @@ -2055,7 +2146,7 @@ } /* Release lock */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); } /*++ @@ -2093,7 +2184,7 @@ IN PVOID OwnerPointer) { ERESOURCE_THREAD Thread; - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; POWNER_ENTRY Owner, ThisOwner; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -2107,7 +2198,7 @@ ExpVerifyResource(Resource); /* Lock the resource */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* Check if it's exclusive */ if (IsOwnedExclusive(Resource)) @@ -2121,8 +2212,8 @@ { /* Set the thread in both entries */ ThisOwner = ExpFindEntryForThread(Resource, - (ERESOURCE_THREAD)OwnerPointer, - 0); + (ERESOURCE_THREAD)OwnerPointer, + 0); Owner = ExpFindEntryForThread(Resource, Thread, 0); if (!Owner) { @@ -2144,10 +2235,15 @@ ASSERT(Resource->ActiveCount >= 2); Resource->ActiveCount--; } + else + { + /* Update the owner entry instead */ + Owner->OwnerThread = (ERESOURCE_THREAD)OwnerPointer; + } } /* Release the resource */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); } /*++ @@ -2168,10 +2264,10 @@ *--*/ BOOLEAN NTAPI -ExTryToAcquireResourceExclusiveLite(PERESOURCE resource) +ExTryToAcquireResourceExclusiveLite(IN PERESOURCE resource) { ERESOURCE_THREAD Thread; - KIRQL OldIrql; + KLOCK_QUEUE_HANDLE LockHandle; BOOLEAN Acquired = FALSE; PERESOURCE_XP Resource = (PERESOURCE_XP)resource; @@ -2186,7 +2282,7 @@ ExpVerifyResource(Resource); /* Acquire the lock */ - ExAcquireResourceLock(&Resource->SpinLock, &OldIrql); + ExAcquireResourceLock(Resource, &LockHandle); /* Check if there is an owner */ if (!Resource->ActiveCount) @@ -2207,7 +2303,7 @@ } /* Release the resource */ - ExReleaseResourceLock(&Resource->SpinLock, OldIrql); + ExReleaseResourceLock(Resource, &LockHandle); return Acquired; } @@ -2228,7 +2324,7 @@ *--*/ PVOID NTAPI -ExEnterCriticalRegionAndAcquireResourceExclusive(PERESOURCE Resource) +ExEnterCriticalRegionAndAcquireResourceExclusive(IN PERESOURCE Resource) { /* Enter critical region */ KeEnterCriticalRegion(); @@ -2257,7 +2353,7 @@ *--*/ VOID FASTCALL -ExReleaseResourceAndLeaveCriticalRegion(PERESOURCE Resource) +ExReleaseResourceAndLeaveCriticalRegion(IN PERESOURCE Resource) { /* Release the resource */ ExReleaseResourceLite(Resource); Modified: trunk/reactos/ntoskrnl/include/internal/ex.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ex.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ex.h Wed May 9 01:35:10 2007 @@ -25,6 +25,7 @@ extern ULONG CmNtCSDVersion; extern ULONG NtGlobalFlag; extern ULONG ExpInitializationPhase; +extern ULONG ExpAltTimeZoneBias; typedef struct _EXHANDLE { @@ -61,18 +62,6 @@ #define MAX_FAST_REFS 7 -/* Note: we only use a spinlock on SMP. On UP, we cli/sti intead */ -#ifndef CONFIG_SMP -#define ExAcquireResourceLock(l, i) { \ - (void)i; \ - _disable(); \ -} -#define ExReleaseResourceLock(l, i) _enable(); -#else -#define ExAcquireResourceLock(l, i) KeAcquireSpinLock(l, i); -#define ExReleaseResourceLock(l, i) KeReleaseSpinLock(l, i); -#endif - #define ExAcquireRundownProtection _ExAcquireRundownProtection #define ExReleaseRundownProtection _ExReleaseRundownProtection #define ExInitializeRundownProtection _ExInitializeRundownProtection @@ -1012,6 +1001,18 @@ NTAPI ExTimerRundown(VOID); +VOID +NTAPI +HeadlessInit( + IN PLOADER_PARAMETER_BLOCK LoaderBlock +); + +VOID +NTAPI +XIPInit( + IN PLOADER_PARAMETER_BLOCK LoaderBlock +); + #define InterlockedDecrementUL(Addend) \ (ULONG)InterlockedDecrement((PLONG)(Addend))
17 years, 7 months
1
0
0
0
[fireball] 26653: - Fix unshielded "return"s inside PSEH blocks, in the kernel. - Fix formatting of a couple of lines.
by fireball@svn.reactos.org
Author: fireball Date: Tue May 8 14:32:16 2007 New Revision: 26653 URL:
http://svn.reactos.org/svn/reactos?rev=26653&view=rev
Log: - Fix unshielded "return"s inside PSEH blocks, in the kernel. - Fix formatting of a couple of lines. Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/io/iomgr/iofunc.c trunk/reactos/ntoskrnl/ob/oblife.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c Tue May 8 14:32:16 2007 @@ -720,7 +720,7 @@ if (Size < sizeof(SYSTEM_PROCESS_INFORMATION)) { - return (STATUS_INFO_LENGTH_MISMATCH); // in case buffer size is too small + _SEH_YIELD(return STATUS_INFO_LENGTH_MISMATCH); // in case buffer size is too small } syspr = PsGetNextProcess(NULL); @@ -735,7 +735,7 @@ int inLen=32; // image name len in bytes PLIST_ENTRY current_entry; PETHREAD current; - PSYSTEM_THREAD_INFORMATION ThreadInfo; + PSYSTEM_THREAD_INFORMATION ThreadInfo; SpiCur = (PSYSTEM_PROCESS_INFORMATION)pCur; @@ -756,7 +756,7 @@ *ReqSize = ovlSize; ObDereferenceObject(pr); - return (STATUS_INFO_LENGTH_MISMATCH); // in case buffer size is too small + _SEH_YIELD(return STATUS_INFO_LENGTH_MISMATCH); // in case buffer size is too small } // fill system information @@ -777,7 +777,7 @@ } else { - RtlInitUnicodeString(&SpiCur->ImageName, NULL); + RtlInitUnicodeString(&SpiCur->ImageName, NULL); } SpiCur->BasePriority = pr->Pcb.BasePriority; @@ -796,15 +796,14 @@ SpiCur->PagefileUsage = pr->QuotaUsage[2]; SpiCur->PeakPagefileUsage = pr->QuotaPeak[2]; SpiCur->PrivatePageCount = pr->CommitCharge; - ThreadInfo = (PSYSTEM_THREAD_INFORMATION)(SpiCur + 1); - - current_entry = pr->ThreadListHead.Flink; - while (current_entry != &pr->ThreadListHead) + ThreadInfo = (PSYSTEM_THREAD_INFORMATION)(SpiCur + 1); + + current_entry = pr->ThreadListHead.Flink; + while (current_entry != &pr->ThreadListHead) { current = CONTAINING_RECORD(current_entry, ETHREAD, ThreadListEntry); - ThreadInfo->KernelTime.QuadPart = current->Tcb.KernelTime * 100000LL; ThreadInfo->UserTime.QuadPart = current->Tcb.UserTime * 100000LL; // SpiCur->TH[i].CreateTime = current->CreateTime; @@ -1828,7 +1827,7 @@ */ if (SystemInformationClass >= MaxSystemInfoClass) { - return (STATUS_INVALID_INFO_CLASS); + _SEH_YIELD(return STATUS_INVALID_INFO_CLASS); } if (NULL != CallQS [SystemInformationClass].Query) Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c Tue May 8 14:32:16 2007 @@ -2800,7 +2800,7 @@ { /* We failed */ ObDereferenceObject(FileObject); - return STATUS_ACCESS_DENIED; + _SEH_YIELD(return STATUS_ACCESS_DENIED); } /* Probe the status block */ Modified: trunk/reactos/ntoskrnl/ob/oblife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=2…
============================================================================== --- trunk/reactos/ntoskrnl/ob/oblife.c (original) +++ trunk/reactos/ntoskrnl/ob/oblife.c Tue May 8 14:32:16 2007 @@ -839,7 +839,10 @@ ALIGN_UP(ObjectType->Name.MaximumLength, ULONG); /* Check if thats too much though. */ - if (Length < *ReturnLength) return STATUS_INFO_LENGTH_MISMATCH; + if (Length < *ReturnLength) + { + _SEH_YIELD(return STATUS_INFO_LENGTH_MISMATCH); + } /* Build the data */ ObjectTypeInfo->TotalNumberOfHandles =
17 years, 7 months
1
0
0
0
[fireball] 26652: - Fix an unshielded "return" inside a PSEH block.
by fireball@svn.reactos.org
Author: fireball Date: Tue May 8 13:01:39 2007 New Revision: 26652 URL:
http://svn.reactos.org/svn/reactos?rev=26652&view=rev
Log: - Fix an unshielded "return" inside a PSEH block. Modified: trunk/reactos/drivers/network/afd/afd/info.c Modified: trunk/reactos/drivers/network/afd/afd/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/info.c (original) +++ trunk/reactos/drivers/network/afd/afd/info.c Tue May 8 13:01:39 2007 @@ -25,7 +25,10 @@ InfoReq ? InfoReq->InformationClass : 0)); _SEH_TRY { - if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp, TRUE ); + if( !SocketAcquireStateLock( FCB ) ) { + Status = LostSocket( Irp, TRUE ); + _SEH_YIELD(return Status); + } switch( InfoReq->InformationClass ) { case AFD_INFO_RECEIVE_WINDOW_SIZE:
17 years, 7 months
1
0
0
0
[tkreuzer] 26651: - fix resources
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon May 7 13:27:43 2007 New Revision: 26651 URL:
http://svn.reactos.org/svn/reactos?rev=26651&view=rev
Log: - fix resources Modified: trunk/reactos/dll/cpl/desk/lang/de-DE.rc trunk/reactos/dll/cpl/desk/lang/sv-SE.rc Modified: trunk/reactos/dll/cpl/desk/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/de-DE.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/de-DE.rc (original) +++ trunk/reactos/dll/cpl/desk/lang/de-DE.rc Mon May 7 13:27:43 2007 @@ -79,7 +79,7 @@ CHECKBOX "-", IDC_ADVAPPEARANCE_COLOR2_B, 216, 170, 28, 13, BS_PUSHLIKE | BS_BITMAP LTEXT "Schriftart:", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 50, 8 - COMBOBOX IDC_ADVAPPEARANCE_FONT_C, 5, 200, 130, 90, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_ADVAPPEARANCE_FONT_C, 5, 200, 130, 90, CBS_DROPDOWN | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Schriftgra&d:", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 39, 8 COMBOBOX IDC_ADVAPPEARANCE_FONTSIZE_E, 142, 200, 38, 200, CBS_DROPDOWN | WS_VSCROLL Modified: trunk/reactos/dll/cpl/desk/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/sv-SE.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/sv-SE.rc (original) +++ trunk/reactos/dll/cpl/desk/lang/sv-SE.rc Mon May 7 13:27:43 2007 @@ -85,7 +85,7 @@ COMBOBOX IDC_ADVAPPEARANCE_FONT_C, 5, 200, 130, 90, CBS_DROPDOWN | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Fontsize:", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 39, 8 - COMBOBOX IDC_ADVAPPEARANCE_FONTSIZE_E, 142, 200, 38, 200, NOT CBS_SIMPLE | CBS_DROPDOWN | WS_VSCROLL + COMBOBOX IDC_ADVAPPEARANCE_FONTSIZE_E, 142, 200, 38, 200, CBS_DROPDOWN | WS_VSCROLL LTEXT "Color:", IDC_ADVAPPEARANCE_FONTCOLOR_T, 184, 190, 20, 9 CHECKBOX "", IDC_ADVAPPEARANCE_FONTCOLOR_B, 184, 200, 28, 13, BS_PUSHLIKE | BS_BITMAP
17 years, 7 months
1
0
0
0
[hpoussin] 26650: Fix memory corruption in freeldr
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun May 6 11:35:57 2007 New Revision: 26650 URL:
http://svn.reactos.org/svn/reactos?rev=26650&view=rev
Log: Fix memory corruption in freeldr Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Sun May 6 11:35:57 2007 @@ -521,7 +521,7 @@ LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; LoaderBlock.DrivesAddr = reactos_arc_disk_info; - LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) * sizeof(memory_map_t); + LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { ULONG i; Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c Sun May 6 11:35:57 2007 @@ -235,7 +235,7 @@ LoaderBlock.CommandLine = reactos_kernel_cmdline; LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; - LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)(PVOID)&reactos_memory_map, 32) * sizeof(memory_map_t); + LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { ULONG i;
17 years, 7 months
1
0
0
0
[ekohl] 26649: The current cursor scheme will now be loaded correctly and the scheme list will display the correct name of the cursor scheme.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 6 06:06:30 2007 New Revision: 26649 URL:
http://svn.reactos.org/svn/reactos?rev=26649&view=rev
Log: The current cursor scheme will now be loaded correctly and the scheme list will display the correct name of the cursor scheme. Modified: trunk/reactos/dll/cpl/main/mouse.c Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=2…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c (original) +++ trunk/reactos/dll/cpl/main/mouse.c Sun May 6 06:06:30 2007 @@ -437,11 +437,6 @@ LONG lError; HWND hDlgCtrl; LRESULT lResult; - TCHAR szCurrentScheme[MAX_PATH]; - DWORD dwCurrentScheme; - INT nSchemeIndex; - INT i, nCount; - LPTSTR p; hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMBO_CURSOR_SCHEME); SendMessage(hDlgCtrl, CB_RESETCONTENT, 0, 0); @@ -534,49 +529,6 @@ LoadString(hApplet, IDS_NONE, szSystemScheme, MAX_PATH); lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szSystemScheme); SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)NULL); - - /* Get the name of the current cursor scheme */ - szCurrentScheme[0] = 0; - if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Cursors"), 0, KEY_READ | KEY_QUERY_VALUE, &hCursorKey) == ERROR_SUCCESS) - { - dwCurrentScheme = sizeof(szCurrentScheme) / sizeof(TCHAR); - if (RegQueryValueEx(hCursorKey, NULL, NULL, NULL, (LPBYTE)szCurrentScheme, &dwCurrentScheme)) - szCurrentScheme[0] = 0; - - RegCloseKey(hCursorKey); - } - - /* Search for the matching entry in the cursor scheme list */ - LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); - nSchemeIndex = -1; - nCount = (INT)SendMessage(hDlgCtrl, CB_GETCOUNT, 0, 0); - for (i = 0; i < nCount; i++) - { - SendMessage(hDlgCtrl, CB_GETLBTEXT, i, (LPARAM)szValueName); - - p = _tcsstr(szValueName, szSystemScheme); - if (p) - { - p -= 1; - *p = 0; - } - - if (_tcscmp(szValueName, szCurrentScheme) == 0) - { - nSchemeIndex = (INT)i; - break; - } - } - - /* Select the matching entry */ - if (nSchemeIndex != -1) - SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)nSchemeIndex, (LPARAM)0); - else - { - SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_DELETE_SCHEME); - EnableWindow(hDlgCtrl, FALSE); - } return TRUE; } @@ -996,7 +948,7 @@ static VOID -LoadNewCursorScheme(HWND hwndDlg, BOOL bInit) +LoadNewCursorScheme(HWND hwndDlg) { TCHAR buffer[MAX_PATH]; TCHAR szSystemScheme[MAX_PATH]; @@ -1023,7 +975,103 @@ lpName = (LPTSTR)SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETITEMDATA, nSel, 0); LoadCursorScheme(lpName, !bEnable); - RefreshCursorList(hwndDlg, bInit); + RefreshCursorList(hwndDlg, FALSE); +} + + +static VOID +LoadInitialCursorScheme(HWND hwndDlg) +{ + TCHAR szSchemeName[256]; + TCHAR szSystemScheme[256]; + TCHAR szCursorPath[256]; + HKEY hCursorKey; + LONG lError; + DWORD dwDataSize; + DWORD dwSchemeSource = 0; + UINT index, i; + DWORD dwType; + INT nSel; + + for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++) + { + g_CursorData[i].hCursor = 0; + g_CursorData[i].szCursorPath[0] = 0; + } + + lError = RegOpenKeyEx(HKEY_CURRENT_USER, + _T("Control Panel\\Cursors"), + 0, + KEY_READ | KEY_QUERY_VALUE, + &hCursorKey); + if (lError != ERROR_SUCCESS) + return; + + dwDataSize = sizeof(DWORD); + lError = RegQueryValueEx(hCursorKey, + _T("Scheme Source"), + NULL, + NULL, + (LPBYTE)&dwSchemeSource, + &dwDataSize); + + if (dwSchemeSource != 0) + { + dwDataSize = 256 * sizeof(TCHAR); + lError = RegQueryValueEx(hCursorKey, + NULL, + NULL, + NULL, + (LPBYTE)szSchemeName, + &dwDataSize); + + for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++) + { + dwDataSize = MAX_PATH * sizeof(TCHAR); + lError = RegQueryValueEx(hCursorKey, + g_CursorData[i].lpValueName, + NULL, + &dwType, + (LPBYTE)szCursorPath, + &dwDataSize); + if (lError == ERROR_SUCCESS) + { + if (dwType == REG_EXPAND_SZ) + { + ExpandEnvironmentStrings(szCursorPath, g_CursorData[i].szCursorPath, MAX_PATH); + } + else + { + _tcscpy(g_CursorData[i].szCursorPath, szCursorPath); + } + } + } + } + + RegCloseKey(hCursorKey); + + ReloadCurrentCursorScheme(); + RefreshCursorList(hwndDlg, TRUE); + + /* Build the full scheme name */ + if (dwSchemeSource == 0) + { + LoadString(hApplet, IDS_NONE, szSchemeName, MAX_PATH); + } + else if (dwSchemeSource == 2) + { + LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); + _tcscat(szSchemeName, _T(" ")); + _tcscat(szSchemeName, szSystemScheme); + } + + /* Search and select the curent scheme name from the scheme list */ + nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_FINDSTRINGEXACT, -1, (LPARAM)szSchemeName); + if (nSel != CB_ERR) + SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_SETCURSEL, (WPARAM)nSel, (LPARAM)0); + + /* Enable /disable delete button */ + EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_DELETE_SCHEME), (dwSchemeSource == 1)); } @@ -1119,7 +1167,7 @@ pPointerData->cyCursor = GetSystemMetrics(SM_CYCURSOR); EnumerateCursorSchemes(hwndDlg); - LoadNewCursorScheme(hwndDlg, TRUE); + LoadInitialCursorScheme(hwndDlg); /* Get drop shadow setting */ if (!SystemParametersInfo(SPI_GETDROPSHADOW, 0, &pPointerData->bDropShadow, 0)) @@ -1178,8 +1226,7 @@ case IDC_COMBO_CURSOR_SCHEME: if (HIWORD(wParam) == CBN_SELENDOK) { - LoadNewCursorScheme(hwndDlg, FALSE); - + LoadNewCursorScheme(hwndDlg); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); } break;
17 years, 7 months
1
0
0
0
[ekohl] 26648: Remove outdated email addresses.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat May 5 15:32:25 2007 New Revision: 26648 URL:
http://svn.reactos.org/svn/reactos?rev=26648&view=rev
Log: Remove outdated email addresses. Modified: trunk/reactos/base/setup/welcome/welcome.c trunk/reactos/base/shell/cmd/alias.c trunk/reactos/base/shell/cmd/attrib.c trunk/reactos/base/shell/cmd/batch.c trunk/reactos/base/shell/cmd/beep.c trunk/reactos/base/shell/cmd/call.c trunk/reactos/base/shell/cmd/chcp.c trunk/reactos/base/shell/cmd/cls.c trunk/reactos/base/shell/cmd/cmd.c trunk/reactos/base/shell/cmd/cmd.h trunk/reactos/base/shell/cmd/cmdinput.c trunk/reactos/base/shell/cmd/cmdtable.c trunk/reactos/base/shell/cmd/color.c trunk/reactos/base/shell/cmd/console.c trunk/reactos/base/shell/cmd/copy.c trunk/reactos/base/shell/cmd/date.c trunk/reactos/base/shell/cmd/del.c trunk/reactos/base/shell/cmd/dir.c trunk/reactos/base/shell/cmd/dirstack.c trunk/reactos/base/shell/cmd/echo.c trunk/reactos/base/shell/cmd/error.c trunk/reactos/base/shell/cmd/filecomp.c trunk/reactos/base/shell/cmd/goto.c trunk/reactos/base/shell/cmd/history.c trunk/reactos/base/shell/cmd/if.c trunk/reactos/base/shell/cmd/internal.c trunk/reactos/base/shell/cmd/label.c trunk/reactos/base/shell/cmd/locale.c trunk/reactos/base/shell/cmd/misc.c trunk/reactos/base/shell/cmd/move.c trunk/reactos/base/shell/cmd/path.c trunk/reactos/base/shell/cmd/pause.c trunk/reactos/base/shell/cmd/prompt.c trunk/reactos/base/shell/cmd/redir.c trunk/reactos/base/shell/cmd/ren.c trunk/reactos/base/shell/cmd/set.c trunk/reactos/base/shell/cmd/shift.c trunk/reactos/base/shell/cmd/start.c trunk/reactos/base/shell/cmd/time.c trunk/reactos/base/shell/cmd/type.c trunk/reactos/base/shell/cmd/ver.c trunk/reactos/base/shell/cmd/verify.c trunk/reactos/base/shell/cmd/vol.c trunk/reactos/base/shell/cmd/where.c trunk/reactos/boot/freeldr/freeldr/arch/i386/i386cpu.S trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S trunk/reactos/boot/freeldr/freeldr/arch/i386/portio.c Modified: trunk/reactos/base/setup/welcome/welcome.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/welcome/welcome…
============================================================================== --- trunk/reactos/base/setup/welcome/welcome.c (original) +++ trunk/reactos/base/setup/welcome/welcome.c Sat May 5 15:32:25 2007 @@ -21,7 +21,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS welcome/autorun application * FILE: subsys/system/welcome/welcome.c - * PROGRAMMERS: Eric Kohl (ekohl(a)rz-online.de) + * PROGRAMMERS: Eric Kohl * Casper S. Hornstrup (chorns(a)users.sourceforge.net) * * NOTE: Modified: trunk/reactos/base/shell/cmd/alias.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/alias.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/alias.c (original) +++ trunk/reactos/base/shell/cmd/alias.c Sat May 5 15:32:25 2007 @@ -15,14 +15,14 @@ * added config.h include * added ifdef's to disable aliases * - * 09-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Dec-1998 Eric Kohl * Fixed crash when removing an alias in DeleteAlias(). * Added help text ("/?"). * - * 14-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Jan-1998 Eric Kohl * Clean up and Unicode safe! * - * 24-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jan-1998 Eric Kohl * Redirection safe! * * 02-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/attrib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/attrib.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/attrib.c (original) +++ trunk/reactos/base/shell/cmd/attrib.c Sat May 5 15:32:25 2007 @@ -4,28 +4,28 @@ * * History: * - * 04-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 04-Dec-1998 Eric Kohl * started * - * 09-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Dec-1998 Eric Kohl * implementation works, except recursion ("attrib /s"). * - * 05-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 05-Jan-1999 Eric Kohl * major rewrite. * fixed recursion ("attrib /s"). * started directory support ("attrib /s /d"). * updated help text. * - * 14-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Jan-1999 Eric Kohl * Unicode ready! * - * 19-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 19-Jan-1999 Eric Kohl * Redirection ready! * - * 21-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 21-Jan-1999 Eric Kohl * Added check for invalid filenames. * - * 23-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 23-Jan-1999 Eric Kohl * Added handling of multiple filenames. * * 02-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/batch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/batch.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/batch.c (original) +++ trunk/reactos/base/shell/cmd/batch.c Sat May 5 15:32:25 2007 @@ -47,7 +47,7 @@ * 02-Aug-1998 (Hans B Pufal) [HBP_003] * Fixed bug in ECHO flag restoration at exit from batch file * - * 26-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Jan-1999 Eric Kohl * Replaced CRT io functions by Win32 io functions. * Unicode safe! * Modified: trunk/reactos/base/shell/cmd/beep.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/beep.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/beep.c (original) +++ trunk/reactos/base/shell/cmd/beep.c Sat May 5 15:32:25 2007 @@ -13,11 +13,11 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 14-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Jan-1999 (Eric Kohl) * Added help text ("beep /?"). * Unicode ready! * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Redirection ready! * * 02-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/call.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/call.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/call.c (original) +++ trunk/reactos/base/shell/cmd/call.c Sat May 5 15:32:25 2007 @@ -18,10 +18,10 @@ * lock-up that happened sometimes when calling a batch file from * another batch file. * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Added help text ("call /?") and cleaned up. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * * 02-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/chcp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/chcp.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/chcp.c (original) +++ trunk/reactos/base/shell/cmd/chcp.c Sat May 5 15:32:25 2007 @@ -4,7 +4,7 @@ * * History: * - * 23-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 23-Dec-1998 (Eric Kohl) * Started. * * 02-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/cls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cls.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/cls.c (original) +++ trunk/reactos/base/shell/cmd/cls.c Sat May 5 15:32:25 2007 @@ -10,16 +10,16 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 04-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 04-Dec-1998 (Eric Kohl) * Changed to Win32 console app. * - * 08-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 08-Dec-1998 (Eric Kohl) * Added help text ("/?"). * - * 14-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Jan-1998 (Eric Kohl) * Unicode ready! * - * 20-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1998 (Eric Kohl) * Redirection ready! * * 02-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/cmd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.c (original) +++ trunk/reactos/base/shell/cmd/cmd.c Sat May 5 15:32:25 2007 @@ -84,36 +84,36 @@ * Fixed carrage return output to better match MSDOS with echo * on or off. (marked with "JPP 19980708") * - * 07-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Dec-1998 (Eric Kohl) * First ReactOS release. * Extended length of commandline buffers to 512. * - * 13-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 13-Dec-1998 (Eric Kohl) * Added COMSPEC environment variable. * Added "/t" support (color) on cmd command line. * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Added help text ("cmd /?"). * - * 25-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 25-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * Fixed redirections and piping. * Piping is based on temporary files, but basic support * for anonymous pipes already exists. * - * 27-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 27-Jan-1999 (Eric Kohl) * Replaced spawnl() by CreateProcess(). * - * 22-Oct-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 22-Oct-1999 (Eric Kohl) * Added break handler. * - * 15-Dec-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 15-Dec-1999 (Eric Kohl) * Fixed current directory * - * 28-Dec-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 28-Dec-1999 (Eric Kohl) * Restore window title after program/batch execution * - * 03-Feb-2001 (Eric Kohl <ekohl(a)rz-online.de>) + * 03-Feb-2001 (Eric Kohl) * Workaround because argc[0] is NULL under ReactOS * * 23-Feb-2001 (Carl Nettelblad <cnettel(a)hem.passagen.se>) Modified: trunk/reactos/base/shell/cmd/cmd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.h (original) +++ trunk/reactos/base/shell/cmd/cmd.h Sat May 5 15:32:25 2007 @@ -16,7 +16,7 @@ * 30-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * Added compile date to version. * - * 26-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Feb-1999 (Eric Kohl) * Introduced a new version string. * Thanks to Emanuele Aliberti! */ Modified: trunk/reactos/base/shell/cmd/cmdinput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdinput.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/cmdinput.c (original) +++ trunk/reactos/base/shell/cmd/cmdinput.c Sat May 5 15:32:25 2007 @@ -79,15 +79,15 @@ * Fixed carrage return output to better match MSDOS with echo * on or off.(marked with "JPP 19980708") * - * 13-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 13-Dec-1998 (Eric Kohl) * Added insert/overwrite cursor. * - * 25-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 25-Jan-1998 (Eric Kohl) * Replaced CRT io functions by Win32 console io functions. * This can handle <Shift>-<Tab> for 4NT filename completion. * Unicode and redirection safe! * - * 04-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 04-Feb-1999 (Eric Kohl) * Fixed input bug. A "line feed" character remained in the keyboard * input queue when you pressed <RETURN>. This sometimes caused * some very strange effects. Modified: trunk/reactos/base/shell/cmd/cmdtable.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdtable.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/cmdtable.c (original) +++ trunk/reactos/base/shell/cmd/cmdtable.c Sat May 5 15:32:25 2007 @@ -13,7 +13,7 @@ * 27 Jul 1998 John P. Price * added config.h include * - * 21-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 21-Jan-1999 (Eric Kohl) * Unicode ready! */ Modified: trunk/reactos/base/shell/cmd/color.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/color.c (original) +++ trunk/reactos/base/shell/cmd/color.c Sat May 5 15:32:25 2007 @@ -4,13 +4,13 @@ * * History: * - * 13-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 13-Dec-1998 (Eric Kohl) * Started. * - * 19-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 19-Jan-1999 (Eric Kohl) * Unicode ready! * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Redirection ready! * * 14-Oct-1999 (Paolo Pantaleo <paolopan(a)freemail.it>) Modified: trunk/reactos/base/shell/cmd/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/console.c (original) +++ trunk/reactos/base/shell/cmd/console.c Sat May 5 15:32:25 2007 @@ -4,7 +4,7 @@ * * History: * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * started * * 03-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/copy.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/copy.c (original) +++ trunk/reactos/base/shell/cmd/copy.c Sat May 5 15:32:25 2007 @@ -11,13 +11,13 @@ * fixed memory leak problem in copy function. * fixed copy function so it would work with wildcards in the source * - * 13-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 13-Dec-1998 (Eric Kohl) * Added COPY command to CMD. * - * 26-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Jan-1998 (Eric Kohl) * Replaced CRT io functions by Win32 io functions. * - * 27-Oct-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 27-Oct-1998 (Eric Kohl) * Disabled prompting when used in batch mode. * * 03-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/date.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/date.c (original) +++ trunk/reactos/base/shell/cmd/date.c Sat May 5 15:32:25 2007 @@ -18,13 +18,13 @@ * fixed stand-alone mode. * Added Pacific C compatible dos_getdate functions * - * 09-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Jan-1999 (Eric Kohl) * Added locale support * - * 23-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 23-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * - * 04-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 04-Feb-1999 (Eric Kohl) * Fixed date input bug. * * 03-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/del.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/del.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/del.c (original) +++ trunk/reactos/base/shell/cmd/del.c Sat May 5 15:32:25 2007 @@ -15,19 +15,19 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * -* 09-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeiung.de>) +* 09-Dec-1998 (Eric Kohl) * Fixed command line parsing bugs. * -* 21-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeiung.de>) +* 21-Jan-1999 (Eric Kohl) * Started major rewrite using a new structure. * -* 03-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeiung.de>) +* 03-Feb-1999 (Eric Kohl) * First working version. * -* 30-Mar-1999 (Eric Kohl <ekohl(a)abo.rhein-zeiung.de>) +* 30-Mar-1999 (Eric Kohl) * Added quiet ("/Q"), wipe ("/W") and zap ("/Z") option. * -* 06-Nov-1999 (Eric Kohl <ekohl(a)abo.rhein-zeiung.de>) +* 06-Nov-1999 (Eric Kohl) * Little fix to keep DEL quiet inside batch files. * * 28-Jan-2004 (Michael Fritscher <michael(a)fritscher.net>) Modified: trunk/reactos/base/shell/cmd/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/dir.c (original) +++ trunk/reactos/base/shell/cmd/dir.c Sat May 5 15:32:25 2007 @@ -90,24 +90,24 @@ * added config.h include * * - * 04-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 04-Dec-1998 (Eric Kohl) * Converted source code to Win32, except recursive dir ("dir /s"). * - * 10-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 10-Dec-1998 (Eric Kohl) * Fixed recursive dir ("dir /s"). * - * 14-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Dec-1998 (Eric Kohl) * Converted to Win32 directory functions and * fixed some output bugs. There are still some more ;) * - * 10-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 10-Jan-1999 (Eric Kohl) * Added "/N" and "/4" options, "/O" is a dummy. * Added locale support. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Redirection safe! * - * 01-Mar-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 01-Mar-1999 (Eric Kohl) * Replaced all runtime io functions by their Win32 counterparts. * * 23-Feb-2001 (Carl Nettelblad <cnettel(a)hem.passagen.se>) Modified: trunk/reactos/base/shell/cmd/dirstack.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dirstack.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/dirstack.c (original) +++ trunk/reactos/base/shell/cmd/dirstack.c Sat May 5 15:32:25 2007 @@ -4,13 +4,13 @@ * * History: * - * 14-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Dec-1998 (Eric Kohl) * Implemented PUSHD and POPD command. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Added DIRS command. */ Modified: trunk/reactos/base/shell/cmd/echo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/echo.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/echo.c (original) +++ trunk/reactos/base/shell/cmd/echo.c Sat May 5 15:32:25 2007 @@ -13,13 +13,13 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * Added config.h include * - * 08-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 08-Dec-1998 (Eric Kohl) * Added help text ("/?"). * - * 19-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 19-Jan-1999 (Eric Kohl) * Unicode and redirection ready! * - * 13-Jul-2000 (Eric Kohl <ekohl(a)rz-online.de>) + * 13-Jul-2000 (Eric Kohl) * Implemented 'echo.' and 'echoerr.'. * * 28-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/error.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/error.c (original) +++ trunk/reactos/base/shell/cmd/error.c Sat May 5 15:32:25 2007 @@ -10,10 +10,10 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jan-1999 (Eric Kohl) * Redirection safe! * - * 02-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 02-Feb-1999 (Eric Kohl) * Use FormatMessage() for error reports. * * 28-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/filecomp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/filecomp.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/filecomp.c (original) +++ trunk/reactos/base/shell/cmd/filecomp.c Sat May 5 15:32:25 2007 @@ -9,7 +9,7 @@ * made second TAB display list of filename matches * made filename be lower case if last character typed is lower case * - * 25-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 25-Jan-1999 (Eric Kohl) * Cleanup. Unicode safe! * * 30-Apr-2004 (Filip Navara <xnavara(a)volny.cz>) Modified: trunk/reactos/base/shell/cmd/goto.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/goto.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/goto.c (original) +++ trunk/reactos/base/shell/cmd/goto.c Sat May 5 15:32:25 2007 @@ -16,10 +16,10 @@ * Terminate label on first space character, use only first 8 chars of * label string * - * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * - * 27-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 27-Jan-1999 (Eric Kohl) * Added help text ("/?"). * * 28-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/history.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/history.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/history.c (original) +++ trunk/reactos/base/shell/cmd/history.c Sat May 5 15:32:25 2007 @@ -14,7 +14,7 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 25-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 25-Jan-1999 (Eric Kohl) * Cleanup! * Unicode and redirection safe! * Modified: trunk/reactos/base/shell/cmd/if.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/if.c?rev=26…
============================================================================== --- trunk/reactos/base/shell/cmd/if.c (original) +++ trunk/reactos/base/shell/cmd/if.c Sat May 5 15:32:25 2007 @@ -13,13 +13,13 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Added help text ("if /?") and cleaned up. * - * 21-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 21-Jan-1999 (Eric Kohl) * Unicode and redirection ready! * - * 01-Sep-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 01-Sep-1999 (Eric Kohl) * Fixed help text. * * 17-Feb-2001 (ea) Modified: trunk/reactos/base/shell/cmd/internal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/internal.c?…
============================================================================== --- trunk/reactos/base/shell/cmd/internal.c (original) +++ trunk/reactos/base/shell/cmd/internal.c Sat May 5 15:32:25 2007 @@ -97,26 +97,26 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 03-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 03-Dec-1998 (Eric Kohl) * Replaced DOS calls by Win32 calls. * - * 08-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 08-Dec-1998 (Eric Kohl) * Added help texts ("/?"). * - * 18-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Dec-1998 (Eric Kohl) * Added support for quoted arguments (cd "program files"). * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Clean up. * - * 26-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Jan-1999 (Eric Kohl) * Replaced remaining CRT io functions by Win32 io functions. * Unicode safe! * - * 30-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 30-Jan-1999 (Eric Kohl) * Added "cd -" feature. Changes to the previous directory. * - * 15-Mar-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 15-Mar-1999 (Eric Kohl) * Fixed bug in "cd -" feature. If the previous directory was a root * directory, it was ignored. * Modified: trunk/reactos/base/shell/cmd/label.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/label.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/label.c (original) +++ trunk/reactos/base/shell/cmd/label.c Sat May 5 15:32:25 2007 @@ -4,13 +4,13 @@ * * History: * - * 10-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 10-Dec-1998 (Eric Kohl) * Started. * - * 11-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 11-Dec-1998 (Eric Kohl) * Finished. * - * 19-Jan-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 19-Jan-1998 (Eric Kohl) * Unicode ready! * * 28-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/locale.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/locale.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/locale.c (original) +++ trunk/reactos/base/shell/cmd/locale.c Sat May 5 15:32:25 2007 @@ -4,10 +4,10 @@ * * History: * - * 09-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Jan-1999 (Eric Kohl) * Started. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode safe! */ Modified: trunk/reactos/base/shell/cmd/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/misc.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/misc.c (original) +++ trunk/reactos/base/shell/cmd/misc.c Sat May 5 15:32:25 2007 @@ -13,19 +13,19 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 18-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Dec-1998 (Eric Kohl) * Changed split() to accept quoted arguments. * Removed parse_firstarg(). * - * 23-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 23-Jan-1999 (Eric Kohl) * Fixed an ugly bug in split(). In rare cases (last character * of the string is a space) it ignored the NULL character and * tried to add the following to the argument list. * - * 28-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 28-Jan-1999 (Eric Kohl) * FileGetString() seems to be working now. * - * 06-Nov-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 06-Nov-1999 (Eric Kohl) * Added PagePrompt() and FilePrompt(). * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/move.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/move.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/move.c (original) +++ trunk/reactos/base/shell/cmd/move.c Sat May 5 15:32:25 2007 @@ -4,21 +4,21 @@ * * History: * -* 14-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) +* 14-Dec-1998 (Eric Kohl) * Started. * -* 18-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) +* 18-Jan-1999 (Eric Kohl) * Unicode safe! * Preliminary version!!! * -* 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) +* 20-Jan-1999 (Eric Kohl) * Redirection safe! * -* 27-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) +* 27-Jan-1999 (Eric Kohl) * Added help text ("/?"). * Added more error checks. * -* 03-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) +* 03-Feb-1999 (Eric Kohl) * Added "/N" option. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/path.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/path.c (original) +++ trunk/reactos/base/shell/cmd/path.c Sat May 5 15:32:25 2007 @@ -10,16 +10,16 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 09-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Dec-1998 (Eric Kohl) * Added help text ("/?"). * - * 18-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Jan-1999 (Eric Kohl) * Unicode ready! * - * 18-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Jan-1999 (Eric Kohl) * Redirection safe! * - * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jan-1999 (Eric Kohl) * Fixed Win32 environment handling. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/pause.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/pause.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/pause.c (original) +++ trunk/reactos/base/shell/cmd/pause.c Sat May 5 15:32:25 2007 @@ -13,7 +13,7 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 18-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Jan-1999 (Eric Kohl) * Unicode ready! */ Modified: trunk/reactos/base/shell/cmd/prompt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/prompt.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/prompt.c (original) +++ trunk/reactos/base/shell/cmd/prompt.c Sat May 5 15:32:25 2007 @@ -26,21 +26,21 @@ * 28-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * moved cmd_prompt from internal.c to here * - * 09-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Dec-1998 (Eric Kohl) * Added help text ("/?"). * - * 14-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 14-Dec-1998 (Eric Kohl) * Added "$+" option. * - * 09-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Jan-1999 (Eric Kohl) * Added "$A", "$C" and "$F" option. * Added locale support. * Fixed "$V" option. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * - * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jan-1999 (Eric Kohl) * Fixed Win32 environment handling. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/redir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/redir.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/redir.c (original) +++ trunk/reactos/base/shell/cmd/redir.c Sat May 5 15:32:25 2007 @@ -14,11 +14,11 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * Added config.h include * - * 22-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 22-Jan-1999 (Eric Kohl) * Unicode safe! * Added new error redirection "2>" and "2>>". * - * 26-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Jan-1999 (Eric Kohl) * Added new error AND output redirection "&>" and "&>>". * * 24-Jun-2005 (Brandon Turner <turnerb7(a)msu.edu>) Modified: trunk/reactos/base/shell/cmd/ren.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ren.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/ren.c (original) +++ trunk/reactos/base/shell/cmd/ren.c Sat May 5 15:32:25 2007 @@ -7,13 +7,13 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 18-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de> + * 18-Dec-1998 (Eric Kohl) * Added support for quoted long file names with spaces. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de> + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * - * 17-Oct-2001 (Eric Kohl <ekohl(a)rz.online.de> + * 17-Oct-2001 (Eric Kohl) * Implemented basic rename code. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/set.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/set.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/set.c (original) +++ trunk/reactos/base/shell/cmd/set.c Sat May 5 15:32:25 2007 @@ -20,14 +20,14 @@ * 28-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added set_env function to set env. variable without needing set command * - * 09-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Dec-1998 (Eric Kohl) * Added help text ("/?"). * - * 24-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jan-1999 (Eric Kohl) * Fixed Win32 environment handling. * Unicode and redirection safe! * - * 25-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 25-Feb-1999 (Eric Kohl) * Fixed little bug. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/shift.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/shift.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/shift.c (original) +++ trunk/reactos/base/shell/cmd/shift.c Sat May 5 15:32:25 2007 @@ -13,10 +13,10 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Added help text ("shift /?") and cleaned up. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/start.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/start.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/start.c (original) +++ trunk/reactos/base/shell/cmd/start.c Sat May 5 15:32:25 2007 @@ -4,7 +4,7 @@ * * History: * - * 24-Jul-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 24-Jul-1999 (Eric Kohl) * Started. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/time.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/time.c (original) +++ trunk/reactos/base/shell/cmd/time.c Sat May 5 15:32:25 2007 @@ -10,14 +10,14 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 09-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 09-Jan-1999 (Eric Kohl) * Added locale support. * - * 19-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 19-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * Added "/t" option. * - * 04-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 04-Feb-1999 (Eric Kohl) * Fixed time input bug. * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/type.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/type.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/type.c (original) +++ trunk/reactos/base/shell/cmd/type.c Sat May 5 15:32:25 2007 @@ -12,11 +12,11 @@ * 27-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added config.h include * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Added support for quoted arguments (type "test file.dat"). * Cleaned up. * - * 19-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 19-Jan-1999 (Eric Kohl) * Unicode and redirection ready! * * 19-Jan-1999 (Paolo Pantaleo <paolopan(a)freemail.it>) Modified: trunk/reactos/base/shell/cmd/ver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ver.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/ver.c (original) +++ trunk/reactos/base/shell/cmd/ver.c Sat May 5 15:32:25 2007 @@ -14,10 +14,10 @@ * 30-Jul-1998 (John P Price <linux-guru(a)gcfl.net>) * added text about where to send bug reports and get updates. * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection safe! * - * 26-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Feb-1999 (Eric Kohl) * New version info and some output changes. */ Modified: trunk/reactos/base/shell/cmd/verify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/verify.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/verify.c (original) +++ trunk/reactos/base/shell/cmd/verify.c Sat May 5 15:32:25 2007 @@ -7,11 +7,11 @@ * 31 Jul 1998 (John P Price) * started. * - * 18-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Jan-1999 (Eric Kohl) * VERIFY is just a dummy under Win32; it only exists * for compatibility!!! * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Unicode and redirection ready! * * 30-Apr-2005 (Magnus Olsen) <magnus(a)greatlord.com>) Modified: trunk/reactos/base/shell/cmd/vol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/vol.c?rev=2…
============================================================================== --- trunk/reactos/base/shell/cmd/vol.c (original) +++ trunk/reactos/base/shell/cmd/vol.c Sat May 5 15:32:25 2007 @@ -4,19 +4,19 @@ * * History: * - * 03-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 03-Dec-1998 (Eric Kohl) * Replaced DOS calls by Win32 calls. * - * 08-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 08-Dec-1998 (Eric Kohl) * Added help text ("/?"). * - * 07-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Jan-1999 (Eric Kohl) * Cleanup. * - * 18-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 18-Jan-1999 (Eric Kohl) * Unicode ready! * - * 20-Jan-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Jan-1999 (Eric Kohl) * Redirection ready! */ Modified: trunk/reactos/base/shell/cmd/where.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/where.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/where.c (original) +++ trunk/reactos/base/shell/cmd/where.c Sat May 5 15:32:25 2007 @@ -54,21 +54,20 @@ * executable (does not have .bat, .com, or .exe extention). * Before command would to execute any file with any extension (opps!) * - * 03-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 03-Dec-1998 (Eric Kohl) * Changed find_which(). * - * 07-Dec-1998 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 07-Dec-1998 (Eric Kohl) * Added ".CMD" extension. * Replaced numeric constant by _NR_OF_EXTENSIONS. * - * 26-Feb-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 26-Feb-1999 (Eric Kohl) * Replaced find_which() by SearchForExecutable(). * Now files are searched using the right extension order. * - * 20-Apr-1999 (Eric Kohl <ekohl(a)abo.rhein-zeitung.de>) + * 20-Apr-1999 (Eric Kohl) * Some minor changes and improvements. * - * 10-Jul-2004 (Jens Collin <jens.collin(a)lakhei.com>) * Fixed searxhing for files with specific extensions in PATHEXT order.. * Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386cpu.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386cpu.S (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386cpu.S Sat May 5 15:32:25 2007 @@ -1,6 +1,6 @@ /* * FreeLoader - * Copyright (C) 2003 Eric Kohl <ekohl(a)rz-online.de> + * Copyright (C) 2003 Eric Kohl * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S Sat May 5 15:32:25 2007 @@ -1,6 +1,6 @@ /* * FreeLoader - * Copyright (C) 2003 Eric Kohl <ekohl(a)rz-online.de> + * Copyright (C) 2003 Eric Kohl * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/portio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/portio.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/portio.c Sat May 5 15:32:25 2007 @@ -4,7 +4,7 @@ * PROJECT: ReactOS kernel * FILE: ntoskrnl/hal/x86/portio.c * PURPOSE: Port I/O functions - * PROGRAMMER: Eric Kohl (ekohl(a)abo.rhein-zeitung.de) + * PROGRAMMER: Eric Kohl * UPDATE HISTORY: * Created 18/10/99 */
17 years, 7 months
1
0
0
0
[dgorbachev] 26647: Update Polish translation (bug #2233).
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sat May 5 12:16:59 2007 New Revision: 26647 URL:
http://svn.reactos.org/svn/reactos?rev=26647&view=rev
Log: Update Polish translation (bug #2233). Modified: trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc Modified: trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/pl…
============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc (original) +++ trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc Sat May 5 12:16:59 2007 @@ -171,8 +171,8 @@ BEGIN IDS_ACKTITLE "Podziêkowania" IDS_ACKSUBTITLE "Wszyscy, bez których nie by³oby ReactOS, a tak¿e informacje o Licencji " - IDS_OWNERTITLE "Personifikacja systemu" - IDS_OWNERSUBTITLE "Program konfiguracyjny wykorzysta te informacje do lepszego ustawienia systemu." + IDS_OWNERTITLE "Personalizacja systemu" + IDS_OWNERSUBTITLE "Program konfiguracyjny wykorzysta te informacje, aby spersonalizowaæ system." IDS_COMPUTERTITLE "Nazwa komputera i Has³o Administratora" IDS_COMPUTERSUBTITLE "Musisz podaæ nazwê swojego komputera a tak¿e Has³o Administratora." IDS_LOCALETITLE "Ustawienia Regionalne" @@ -196,7 +196,7 @@ IDS_ACCESSORIES "Akcesoria" IDS_CMT_CALC "Uruchom Kalkulator" IDS_CMT_CMD "Uruchom konsolê" - IDS_CMT_EXPLORER "Uruchom Explorera" + IDS_CMT_EXPLORER "Uruchom Eksplorator" IDS_CMT_NOTEPAD "Uruchom Edytor Tekstu" IDS_CMT_REGEDIT "Uruchom Edytor Rejestru" IDS_CMT_WORDPAD "Uruchom Wordpada" @@ -225,18 +225,18 @@ STRINGTABLE BEGIN - IDS_SHORT_CMD "Command Prompt.lnk" - IDS_SHORT_EXPLORER "ReactOS Explorer.lnk" - IDS_SHORT_DOWNLOADER "Download !.lnk" - IDS_SHORT_FIREFOX "Get Firefox.lnk" - IDS_SHORT_SERVICE "Service Manager.lnk" - IDS_SHORT_DEVICE "Device Manager.lnk" - IDS_SHORT_CALC "Calculator.lnk" - IDS_SHORT_REGEDIT "Regedit.lnk" - IDS_SHORT_NOTEPAD "Notepad.lnk" + IDS_SHORT_CMD "Wiersz poleceñ.lnk" + IDS_SHORT_EXPLORER "Eksplorator ReactOS.lnk" + IDS_SHORT_DOWNLOADER "ci¹gaj! .lnk" + IDS_SHORT_FIREFOX "ci¹gnij Firefoxa.lnk" + IDS_SHORT_SERVICE "Mened¿er Us³ug.lnk" + IDS_SHORT_DEVICE "Mened¿er Urz¹dzeñ.lnk" + IDS_SHORT_CALC "Kalculator.lnk" + IDS_SHORT_REGEDIT "Edytor rejestru.lnk" + IDS_SHORT_NOTEPAD "Notatnik.lnk" IDS_SHORT_WORDPAD "WordPad.lnk" - IDS_SHORT_SNAP "SnapShot.lnk" - IDS_SHORT_SOLITAIRE "Solitaire.lnk" - IDS_SHORT_WINEMINE "WineMine.lnk" + IDS_SHORT_SNAP "Zrzut ekranu.lnk" + IDS_SHORT_SOLITAIRE "RosPasjans.lnk" + IDS_SHORT_WINEMINE "ROSaper.lnk" END /* EOF */
17 years, 7 months
1
0
0
0
[martinf] 26646: update to XMLStorage version 1.2
by martinf@svn.reactos.org
Author: martinf Date: Sat May 5 11:30:20 2007 New Revision: 26646 URL:
http://svn.reactos.org/svn/reactos?rev=26646&view=rev
Log: update to XMLStorage version 1.2 Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp trunk/reactos/base/shell/explorer/utility/xmlstorage.h trunk/reactos/base/shell/explorer/utility/xs-native.cpp Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp (original) +++ trunk/reactos/base/shell/explorer/utility/xmlstorage.cpp Sat May 5 11:30:20 2007 @@ -1,8 +1,8 @@ // - // XML storage classes Version 1.1 + // XML storage classes version 1.2 // - // Copyright (c) 2004, 2005, 2006 Martin Fuchs <martin-fuchs(a)gmx.net> + // Copyright (c) 2004, 2005, 2006, 2007 Martin Fuchs <martin-fuchs(a)gmx.net> // /// \file xmlstorage.cpp @@ -284,30 +284,43 @@ LPCXSSTR s = str.c_str(); size_t l = XS_len(s); - if (!cdata && l<=BUFFER_LEN) { + if (cdata) { + // encode the whole string in a CDATA section + std::string ret = "<![CDATA["; + +#ifdef XS_STRING_UTF8 + ret += str; +#else + ret += get_utf8(str); +#endif + + ret += "]]>"; + + return ret; + } else if (l <= BUFFER_LEN) { LPXSSTR buffer = (LPXSSTR)alloca(6*sizeof(XS_CHAR)*XS_len(s)); // worst case """ / "'" LPXSSTR o = buffer; for(LPCXSSTR p=s; *p; ++p) switch(*p) { case '&': - *o++ = '&'; *o++ = 'a'; *o++ = 'm'; *o++ = 'p'; *o++ = ';'; + *o++ = '&'; *o++ = 'a'; *o++ = 'm'; *o++ = 'p'; *o++ = ';'; // "&" break; case '<': - *o++ = '&'; *o++ = 'l'; *o++ = 't'; *o++ = ';'; + *o++ = '&'; *o++ = 'l'; *o++ = 't'; *o++ = ';'; // "<" break; case '>': - *o++ = '&'; *o++ = 'g'; *o++ = 't'; *o++ = ';'; + *o++ = '&'; *o++ = 'g'; *o++ = 't'; *o++ = ';'; // ">" break; case '"': - *o++ = '&'; *o++ = 'q'; *o++ = 'u'; *o++ = 'o'; *o++ = 't'; *o++ = ';'; + *o++ = '&'; *o++ = 'q'; *o++ = 'u'; *o++ = 'o'; *o++ = 't'; *o++ = ';'; // """ break; case '\'': - *o++ = '&'; *o++ = 'a'; *o++ = 'p'; *o++ = 'o'; *o++ = 's'; *o++ = ';'; + *o++ = '&'; *o++ = 'a'; *o++ = 'p'; *o++ = 'o'; *o++ = 's'; *o++ = ';'; // "'" break; default: @@ -326,23 +339,9 @@ return get_utf8(buffer, o-buffer); #endif } else { // l > BUFFER_LEN - // encode the whole string in a CDATA section - std::string ret = "<![CDATA["; - -#ifdef XS_STRING_UTF8 - ret += str; -#else - ret += get_utf8(str); -#endif - - ret += "]]>"; - - return ret; - -/* alternative code using ostringstream (beware: quite slow) -#include <sstream> - - std::ostringstream out; + // alternative code for larger strings using ostringstream + // and avoiding to use alloca() for preallocated memory + fast_ostringstream out; LPCXSSTR s = str.c_str(); @@ -369,7 +368,7 @@ break; default: - if ((unsigned)*p<20 && *p!='\t' *p!='\r' && *p!='\n') + if ((unsigned)*p<20 && *p!='\t' && *p!='\r' && *p!='\n') out << "&" << (unsigned)*p << ";"; else out << *p; @@ -380,7 +379,6 @@ #else return get_utf8(out.str()); #endif - */ } } @@ -417,7 +415,7 @@ size_t l = e - p; memcpy(o, p, l); o += l; - p += 3; + p = e + 2; } else *o++ = *p; } else @@ -761,11 +759,15 @@ const char* p = s; const char* e = p + _content.length(); - for(; p<e; ++p) - if (*p == '\n') { - ++p; - break; - } + if (!strncmp(s,"<![CDATA[",9) && !strncmp(e-3,"]]>",3)) { + s += 9; + p = (e-=3); + } else + for(; p<e; ++p) + if (*p == '\n') { + ++p; + break; + } if (p != s) if (_pos->_children.empty()) // no children in current node? Modified: trunk/reactos/base/shell/explorer/utility/xmlstorage.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xmlstorage.h (original) +++ trunk/reactos/base/shell/explorer/utility/xmlstorage.h Sat May 5 11:30:20 2007 @@ -1,8 +1,8 @@ // - // XML storage classes Version 1.1 + // XML storage classes version 1.2 // - // Copyright (c) 2004, 2005, 2006 Martin Fuchs <martin-fuchs(a)gmx.net> + // Copyright (c) 2004, 2005, 2006, 2007 Martin Fuchs <martin-fuchs(a)gmx.net> // /// \file xmlstorage.h @@ -40,6 +40,26 @@ #ifndef _XMLSTORAGE_H +#ifdef UNICODE +#ifndef _UNICODE +#define _UNICODE +#endif +#else +#ifdef _UNICODE +#define UNICODE +#endif +#endif + +#ifndef _WIN32 +#ifdef UNICODE +#error no UNICODE build in Unix version available +#endif +#ifndef XS_STRING_UTF8 +#define XS_STRING_UTF8 +#endif +#endif + + #if _MSC_VER>=1400 #ifndef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1 @@ -129,20 +149,54 @@ #endif // _MSC_VER -#ifdef UNICODE -#ifndef _UNICODE -#define _UNICODE -#endif -#else -#ifdef _UNICODE -#define UNICODE -#endif -#endif +#ifdef _WIN32 #include <windows.h> // for LPCTSTR - #include <tchar.h> #include <malloc.h> + +#else + +#include <wchar.h> +#include <stdarg.h> + +typedef char CHAR; +#ifdef _WCHAR_T_DEFINED +#define __wchar_t wchar_t +#endif + +typedef __wchar_t WCHAR; +typedef unsigned char UCHAR; +typedef char* LPSTR; +typedef const char* LPCSTR; +typedef WCHAR* LPWSTR; +typedef const WCHAR* LPCWSTR; + +#ifndef UNICODE +#define TEXT(x) x +typedef char TCHAR; +typedef unsigned char _TUCHAR; +typedef CHAR* PTSTR; +typedef CHAR* LPTSTR; +typedef const CHAR* LPCTSTR; + +#define _ttoi atoi +#define _tfopen fopen +#define _tcstod strtod +#define _tcslen strlen +#define _tcsstr strstr +#define _snprintf snprintf +#define _sntprintf snprintf +#define _vsnprintf vsnprintf +#define _vsntprintf vsnprintf +#define _stricmp strcasecmp +#define _tcsicmp strcasecmp +#define strnicmp strncasecmp +#define _tcsnicmp strncasecmp +#endif + +#endif + #include <fstream> #include <sstream> @@ -168,7 +222,7 @@ #define LPXSSTR LPSTR #define LPCXSSTR LPCSTR #define XS_cmp strcmp -#define XS_icmp stricmp +#define XS_icmp _stricmp #define XS_ncmp strncmp #define XS_nicmp strnicmp #define XS_toi atoi @@ -238,6 +292,7 @@ XS_String(const super& other) : super(other) {} XS_String(const XS_String& other) : super(other) {} +#ifdef _WIN32 #if defined(UNICODE) && !defined(XS_STRING_UTF8) XS_String(LPCSTR s) {assign(s);} XS_String(LPCSTR s, size_t l) {assign(s, l);} @@ -251,7 +306,6 @@ XS_String(const std::wstring& other) {assign(other.c_str());} XS_String& operator=(LPCWSTR s) {assign(s); return *this;} #ifdef XS_STRING_UTF8 - void assign(const XS_String& s) {assign(s.c_str());} void assign(LPCWSTR s) {if (s) {size_t bl=wcslen(s); LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_UTF8, 0, s, (int)bl, b, (int)bl, 0, 0));} else erase();} void assign(LPCWSTR s, size_t l) {size_t bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_UTF8, 0, s, (int)l, b, (int)bl, 0, 0));} else erase();} #else // if !UNICODE && !XS_STRING_UTF8 @@ -259,6 +313,11 @@ void assign(LPCWSTR s, size_t l) {size_t bl=l; if (s) {LPSTR b=(LPSTR)alloca(bl); super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, (int)l, b, (int)bl, 0, 0));} else erase();} #endif #endif +#endif // _WIN32 + +#ifdef XS_STRING_UTF8 + void assign(const XS_String& s) {assign(s.c_str());} +#endif XS_String& operator=(LPCXSSTR s) {if (s) super::assign(s); else erase(); return *this;} XS_String& operator=(const super& s) {super::assign(s); return *this;} @@ -267,12 +326,14 @@ operator LPCXSSTR() const {return c_str();} +#ifdef _WIN32 #ifdef XS_STRING_UTF8 operator std::wstring() const {size_t bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_UTF8, 0, c_str(), bl, b, bl));} #elif defined(UNICODE) operator std::string() const {size_t bl=length(); LPSTR b=(LPSTR)alloca(bl); return std::string(b, WideCharToMultiByte(CP_ACP, 0, c_str(), bl, b, bl, 0, 0));} #else operator std::wstring() const {size_t bl=length(); LPWSTR b=(LPWSTR)alloca(sizeof(WCHAR)*bl); return std::wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), (int)bl, b, (int)bl));} +#endif #endif XS_String& printf(LPCXSSTR fmt, ...) @@ -950,7 +1011,7 @@ #endif /// write node with children tree to output stream - std::ostream& write(std::ostream& out, const XMLFormat& format, WRITE_MODE mode=FORMAT_SMART, int indent=0) const + bool write(std::ostream& out, const XMLFormat& format, WRITE_MODE mode=FORMAT_SMART, int indent=0) const { switch(mode) { case FORMAT_PLAIN: @@ -969,7 +1030,7 @@ smart_write_worker(out, format, indent); } - return out; + return out.good(); } protected: @@ -2136,6 +2197,102 @@ #endif // XS_USE_XERCES +#if defined(_MSC_VER) && _MSC_VER<1400 + +struct fast_ostringbuffer : public std::streambuf +{ + typedef char _E; + typedef std::char_traits<_E> _Tr; + + explicit fast_ostringbuffer() + {_Init(0, 0, std::_Noread);} // optimized for ios::out mode + + virtual ~fast_ostringbuffer() + {_Tidy();} + + std::string str() const + {if (pptr() != 0) + {std::string _Str(pbase(), + (_Seekhigh<pptr()? pptr(): _Seekhigh) - pbase()); + return _Str;} + else + return std::string();} + +protected: + virtual int_type overflow(int_type _C = _Tr::eof()) + {if (_Tr::eq_int_type(_Tr::eof(), _C)) + return _Tr::not_eof(_C); + else if (pptr() != 0 && pptr() < epptr()) + {*_Pninc() = _Tr::to_char_type(_C); + return _C;} + else + {size_t _Os = gptr() == 0 ? 0 : epptr() - eback(); + size_t _Ns = _Os + _Alsize; + _E *_P = _Al.allocate(_Ns, (void *)0); + if (0 < _Os) + _Tr::copy(_P, eback(), _Os); + else if (_ALSIZE < _Alsize) + _Alsize = _ALSIZE; + + if (_Strmode & std::_Allocated) + _Al.deallocate(eback(), _Os); + + _Strmode |= std::_Allocated; + + if (_Os == 0) + {_Seekhigh = _P; + setp(_P, _P + _Ns); + setg(_P, _P, _P); } + else + {_Seekhigh = _Seekhigh - eback() + _P; + setp(pbase() - eback() + _P, pptr() - eback() + _P, _P + _Ns); + setg(_P, _P, _P);} + *_Pninc() = _Tr::to_char_type(_C); + + return _C;}} + + void _Init(const _E *_S, size_t _N, std::_Strstate _M) + {_Pendsave = 0, _Seekhigh = 0; + _Alsize = _MINSIZE, _Strmode = _M; + setg(0, 0, 0); + setp(0, 0);} + + void _Tidy() + {if (_Strmode & std::_Allocated) + _Al.deallocate(eback(), (pptr() != 0 ? epptr() : egptr()) - eback()); + _Seekhigh = 0; + _Strmode &= ~std::_Allocated;} + +private: + enum {_ALSIZE = 65536/*512*/, _MINSIZE = 32768/*32*/}; // bigger buffer sizes + + _E *_Pendsave, *_Seekhigh; + int _Alsize; + std::_Strstate _Strmode; + std::allocator<_E> _Al; +}; + +struct fast_ostringstream : public std::iostream +{ + typedef std::iostream super; + + explicit fast_ostringstream() + : super(&_Sb) {} + + std::string str() const + {return _Sb.str();} + +private: + fast_ostringbuffer _Sb; +}; + +#else + +typedef std::ostringstream fast_ostringstream; + +#endif + + /// XML document holder struct XMLDoc : public XMLNode { @@ -2221,18 +2378,22 @@ } /// write XML stream preserving previous white space and comments - std::ostream& write(std::ostream& out, WRITE_MODE mode=FORMAT_SMART) const + bool write(std::ostream& out, WRITE_MODE mode=FORMAT_SMART) const { _format.print_header(out, mode!=FORMAT_PLAIN); - if (!_children.empty()) + if (_children.size() == 1) _children.front()->write(out, _format, mode); - - return out; + else if (!_children.empty()) { + //throw Exception("more than one XML root!"); + return false; + } + + return out.good(); } /// write XML stream with formating - std::ostream& write_formating(std::ostream& out) const + bool write_formating(std::ostream& out) const { return write(out, FORMAT_PRETTY); } @@ -2241,14 +2402,14 @@ { tofstream out(path); - return write(out, mode).good(); + return write(out, mode); } bool write_formating(LPCTSTR path) const { tofstream out(path); - return write_formating(out).good(); + return write_formating(out); } XMLFormat _format; Modified: trunk/reactos/base/shell/explorer/utility/xs-native.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/xs-native.cpp (original) +++ trunk/reactos/base/shell/explorer/utility/xs-native.cpp Sat May 5 11:30:20 2007 @@ -1,8 +1,8 @@ // - // XML storage classes Version 1.1 + // XML storage classes version 1.2 // - // Copyright (c) 2006 Martin Fuchs <martin-fuchs(a)gmx.net> + // Copyright (c) 2006, 2007 Martin Fuchs <martin-fuchs(a)gmx.net> // /// \file xs-native.cpp @@ -109,10 +109,14 @@ const std::string& str(bool utf8) // returns UTF-8 encoded buffer content { +#if defined(_WIN32) && !defined(XS_STRING_UTF8) if (utf8) +#endif _buffer_str.assign(_buffer, _wptr-_buffer); +#if defined(_WIN32) && !defined(XS_STRING_UTF8) else _buffer_str = get_utf8(_buffer, _wptr-_buffer); +#endif return _buffer_str; }
17 years, 7 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
32
33
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
Results per page:
10
25
50
100
200