ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
22 participants
582 discussions
Start a n
N
ew thread
[royce] 17921: regression test for set /a - fails at the moment because 'if' is bork3d
by royce@svn.reactos.com
regression test for set /a - fails at the moment because 'if' is bork3d Added: trunk/reactos/subsys/system/cmd/seta_test.cmd _____ Added: trunk/reactos/subsys/system/cmd/seta_test.cmd --- trunk/reactos/subsys/system/cmd/seta_test.cmd 2005-09-18 18:58:11 UTC (rev 17920) +++ trunk/reactos/subsys/system/cmd/seta_test.cmd 2005-09-18 18:59:59 UTC (rev 17921) @@ -0,0 +1,67 @@ +@echo off +if ("1"=="2") goto failure +if !("1"=="1") goto failure +set /a a=1 +if !("%a%"=="1") goto failure +set /a b=a +if !("%b%"=="1") goto failure +set /a a=!5 +if !("%a%"=="0") goto failure +set /a a=~5 +if !("%a%"=="-6") goto failure +set /a a=5,a=-a +if !("%a%"=="-5") goto failure +set /a a=5*7 +if !("%a%"=="35") goto failure +set /a a=2000/10 +if !("%a%"=="200") goto failure +set /a a=42%9 +if !("%a%"=="6") goto failure +set /a a=7+9 +if !("%a%"=="16") goto failure +set /a a=9-7 +if !("%a%"=="2") goto failure +set /a a=9^<^<2 +if !("%a%"=="36") goto failure +set /a a=36^>^>2 +if !("%a%"=="9") goto failure +set /a a=42^&9 +if !("%a%"=="8") goto failure +set /a a=32^^9 +if !("%a%"=="41") goto failure +set /a a=10^|22 +if !("%a%"=="30") goto failure +set /a a=2,a*=3 +if !("%a%"=="6") goto failure +set /a a=11,a/=2 +if !("%a%"=="5") goto failure +set /a a=42,a%=9 +if !("%a%"=="6") goto failure +set /a a=7,a+=9 +if !("%a%"=="16") goto failure +set /a a=9,a-=7 +if !("%a%"=="2") goto failure +set /a a=42,a^&=9 +if !("%a%"=="8") goto failure +set /a a=32,a^^=9 +if !("%a%"=="41") goto failure +set /a a=10,a^|=22 +if !("%a%"=="30") goto failure +set /a a=9,a^<^<=2 +if !("%a%"=="36") goto failure +set /a a=36,a^>^>=2 +if !("%a%"=="9") goto failure +set /a a=(1,2) +if !("%a%"=="2") goto failure +set /a a=(a=1,a+2) +if ("%a%"=="3") goto success +goto failure + +:success +echo SUCCESS! +goto done + +:failure +echo FAILURE! (remove the echo off and see the last formula that executed before this line) + +:done Property changes on: trunk/reactos/subsys/system/cmd/seta_test.cmd ___________________________________________________________________ Name: svn:eol-style + native
19 years, 3 months
1
0
0
0
[royce] 17920: fixes for UNICODE compilation
by royce@svn.reactos.com
fixes for UNICODE compilation Modified: trunk/reactos/subsys/system/cmd/set.c _____ Modified: trunk/reactos/subsys/system/cmd/set.c --- trunk/reactos/subsys/system/cmd/set.c 2005-09-18 18:49:30 UTC (rev 17919) +++ trunk/reactos/subsys/system/cmd/set.c 2005-09-18 18:58:11 UTC (rev 17920) @@ -51,7 +51,7 @@ static LPCTSTR skip_ws ( LPCTSTR p ) { - return p + strspn ( p, " \t" ); + return p + _tcsspn ( p, _T(" \t") ); } INT cmd_set (LPTSTR cmd, LPTSTR param) @@ -191,7 +191,7 @@ return FALSE; } GetEnvironmentVariable ( ident, buf, dwBuffer ); - *result = atoi ( buf ); + *result = _ttoi ( buf ); return TRUE; } @@ -225,7 +225,7 @@ *lval |= rval; break; default: - printf ( "Invalid operand.\n" ); + ConErrPrintf ( _T("Invalid operand.\n") ); return FALSE; } return TRUE; @@ -238,15 +238,15 @@ seta_unaryTerm ( LPCTSTR* p_, INT* result ) { LPCTSTR p = *p_; - if ( *p == '(' ) + if ( *p == _T('(') ) { INT rval; p = skip_ws ( p + 1 ); if ( !seta_stmt ( &p, &rval ) ) return FALSE; - if ( *p != ')' ) + if ( *p != _T(')') ) { - _tprintf ( _T("Expected ')'\n") ); + ConErrPrintf ( _T("Expected ')'\n") ); return FALSE; } *result = rval; @@ -254,8 +254,8 @@ } else if ( isdigit(*p) ) { - *result = atoi ( p ); - p = skip_ws ( p + strspn ( p, "1234567890" ) ); + *result = _ttoi ( p ); + p = skip_ws ( p + _tcsspn ( p, _T("1234567890") ) ); } else if ( __iscsymf(*p) ) { @@ -267,7 +267,7 @@ } else { - _tprintf ( _T("Expected number or variable name\n") ); + ConErrPrintf ( _T("Expected number or variable name\n") ); return FALSE; } *p_ = p; @@ -369,7 +369,7 @@ lval >>= rval; break; default: - printf ( "Invalid operand.\n" ); + ConErrPrintf ( _T("Invalid operand.\n") ); return FALSE; } } @@ -487,12 +487,12 @@ INT rval; if ( !*p ) { - _tprintf ( _T("The syntax of the command is incorrect.\n") ); + ConErrPrintf ( _T("The syntax of the command is incorrect.\n") ); return FALSE; } if ( !seta_stmt ( &p, &rval ) ) return FALSE; - _tprintf ( _T("%i\n"), rval ); + ConOutPrintf ( _T("%i\n"), rval ); return TRUE; }
19 years, 3 months
1
0
0
0
[ion] 17919: Make LogoffWindowsDialog exit the caller (ie: explorer) so that previous shutdown functionality is restored
by ion@svn.reactos.com
Make LogoffWindowsDialog exit the caller (ie: explorer) so that previous shutdown functionality is restored Modified: trunk/reactos/lib/shell32/dialogs.c _____ Modified: trunk/reactos/lib/shell32/dialogs.c --- trunk/reactos/lib/shell32/dialogs.c 2005-09-18 18:46:15 UTC (rev 17918) +++ trunk/reactos/lib/shell32/dialogs.c 2005-09-18 18:49:30 UTC (rev 17919) @@ -413,6 +413,7 @@ int WINAPI LogoffWindowsDialog(DWORD uFlags) { ERR("LogoffWindowsDialog is UNIMPLEMENTED\n"); + ExitProcess(0); return 0; }
19 years, 3 months
1
0
0
0
[ion] 17918: Fix shell32 spec file to properly export LogoffWindowsDialog as the proper ordinal (54) so that explorer won't crash on shutdown when calling it. Implement the LogoffWindowsDialog stub.
by ion@svn.reactos.com
Fix shell32 spec file to properly export LogoffWindowsDialog as the proper ordinal (54) so that explorer won't crash on shutdown when calling it. Implement the LogoffWindowsDialog stub. Modified: trunk/reactos/lib/shell32/dialogs.c Modified: trunk/reactos/lib/shell32/shell32.spec _____ Modified: trunk/reactos/lib/shell32/dialogs.c --- trunk/reactos/lib/shell32/dialogs.c 2005-09-18 18:37:08 UTC (rev 17917) +++ trunk/reactos/lib/shell32/dialogs.c 2005-09-18 18:46:15 UTC (rev 17918) @@ -406,7 +406,16 @@ return 0; } +/********************************************************************** *** + * LogoffWindowsDialog [SHELL32.54] + */ +int WINAPI LogoffWindowsDialog(DWORD uFlags) +{ + ERR("LogoffWindowsDialog is UNIMPLEMENTED\n"); + return 0; +} + /*********************************************************************** ** * RestartDialog [SHELL32.59] */ _____ Modified: trunk/reactos/lib/shell32/shell32.spec --- trunk/reactos/lib/shell32/shell32.spec 2005-09-18 18:37:08 UTC (rev 17917) +++ trunk/reactos/lib/shell32/shell32.spec 2005-09-18 18:46:15 UTC (rev 17918) @@ -47,6 +47,7 @@ 51 stdcall -noname PathResolve(str long long) PathResolveAW 52 stdcall -noname PathGetArgs(str) PathGetArgsAW 53 stdcall DoEnvironmentSubst(long long) DoEnvironmentSubstAW + 54 stdcall -noname LogoffWindowsDialog(ptr) 55 stdcall -noname PathQuoteSpaces(ptr) PathQuoteSpacesAW 56 stdcall -noname PathUnquoteSpaces(str) PathUnquoteSpacesAW 57 stdcall -noname PathGetDriveNumber(str) PathGetDriveNumberAW
19 years, 3 months
1
0
0
0
[royce] 17917: fix escaping
by royce@svn.reactos.com
fix escaping Modified: trunk/reactos/subsys/system/cmd/set.c _____ Modified: trunk/reactos/subsys/system/cmd/set.c --- trunk/reactos/subsys/system/cmd/set.c 2005-09-18 17:52:28 UTC (rev 17916) +++ trunk/reactos/subsys/system/cmd/set.c 2005-09-18 18:37:08 UTC (rev 17917) @@ -69,9 +69,10 @@ /* remove escapes */ if ( param[0] ) for ( i = 0; param[i+1]; i++ ) { - if ( param[i] == '^' && strchr("<|>",param[i+1]) ) + if ( param[i] == '^' && strchr("<|>&^",param[i+1]) ) { memmove ( ¶m[i], ¶m[i+1], _tcslen(¶m[i]) * sizeof(TCHAR) ); + ++i; } }
19 years, 3 months
1
0
0
0
[royce] 17916: (hopefully) last bugfix to set /a - assignment works again
by royce@svn.reactos.com
(hopefully) last bugfix to set /a - assignment works again Modified: trunk/reactos/subsys/system/cmd/set.c _____ Modified: trunk/reactos/subsys/system/cmd/set.c --- trunk/reactos/subsys/system/cmd/set.c 2005-09-18 17:33:11 UTC (rev 17915) +++ trunk/reactos/subsys/system/cmd/set.c 2005-09-18 17:52:28 UTC (rev 17916) @@ -408,36 +408,22 @@ if ( identlen ) { if ( *p == _T('=') ) - op = *p, p++; + op = *p, p = skip_ws(p+1); else if ( _tcschr ( _T("*/%+-&^|"), *p ) && p[1] == _T('=') ) - op = *p, p += 2; + op = *p, p = skip_ws(p+2); else if ( _tcschr ( _T("<>"), *p ) && *p == p[1] && p[2] == _T('=') ) - op = *p, p += 3; - else - { - _tprintf ( _T("Missing operand.\n") ); - return FALSE; - } - p = skip_ws ( p ); + op = *p, p = skip_ws(p+3); } /* allow to chain multiple assignments, such as: a=b=1 */ if ( ident && op ) { - if ( !seta_assignment ( &p, &exprval ) ) - return FALSE; - } - else - { - if ( !seta_expr ( &p, &exprval ) ) - return FALSE; - } - - if ( identlen ) - { INT identval; LPTSTR buf; + if ( !seta_assignment ( &p, &exprval ) ) + return FALSE; + if ( !seta_identval ( ident, &identval ) ) identval = 0; switch ( op ) @@ -460,6 +446,13 @@ SetEnvironmentVariable ( ident, buf ); // TODO FIXME - check return value exprval = identval; } + else + { + /* restore p in case we found an ident but not an op */ + p = *p_; + if ( !seta_expr ( &p, &exprval ) ) + return FALSE; + } *result = exprval; *p_ = p;
19 years, 3 months
1
0
0
0
[ros-diffs] [royce] 17915: fixed bugs in shifting (<<, >>, <<=, >>=)
by royce@svn.reactos.com
fixed bugs in shifting (<<, >>, <<=, >>=) eliminated some code duplication while I was in there. Modified: trunk/reactos/subsys/system/cmd/set.c _____ Modified: trunk/reactos/subsys/system/cmd/set.c --- trunk/reactos/subsys/system/cmd/set.c 2005-09-18 16:56:33 UTC (rev 17914) +++ trunk/reactos/subsys/system/cmd/set.c 2005-09-18 17:33:11 UTC (rev 17915) @@ -305,20 +305,20 @@ } static BOOL -seta_addTerm ( LPCTSTR* p_, INT* result ) +seta_ltorTerm ( LPCTSTR* p_, INT* result, LPCTSTR ops, BOOL (*subTerm)(LPCTSTR*,INT*) ) { LPCTSTR p = *p_; INT lval; - if ( !seta_mulTerm ( &p, &lval ) ) + if ( !subTerm ( &p, &lval ) ) return FALSE; - while ( *p && _tcschr(_T("*/%"),*p) ) + while ( *p && _tcschr(ops,*p) ) { INT rval; TCHAR op = *p; p = skip_ws ( p+1 ); - if ( !seta_mulTerm ( &p, &rval ) ) + if ( !subTerm ( &p, &rval ) ) return FALSE; if ( !calc ( &lval, op, rval ) ) @@ -331,29 +331,15 @@ } static BOOL -seta_logShiftTerm ( LPCTSTR* p_, INT* result ) +seta_addTerm ( LPCTSTR* p_, INT* result ) { - LPCTSTR p = *p_; - INT lval; - if ( !seta_addTerm ( &p, &lval ) ) - return FALSE; - while ( *p && _tcschr(_T("+-"),*p) ) - { - INT rval; - TCHAR op = *p; + return seta_ltorTerm ( p_, result, _T("*/%"), seta_mulTerm ); +} - p = skip_ws ( p+1 ); - - if ( !seta_addTerm ( &p, &rval ) ) - return FALSE; - - if ( !calc ( &lval, op, rval ) ) - return FALSE; - } - - *result = lval; - *p_ = p; - return TRUE; +static BOOL +seta_logShiftTerm ( LPCTSTR* p_, INT* result ) +{ + return seta_ltorTerm ( p_, result, _T("+-"), seta_addTerm ); } static BOOL @@ -373,8 +359,18 @@ if ( !seta_logShiftTerm ( &p, &rval ) ) return FALSE; - if ( !calc ( &lval, op, rval ) ) + switch ( op ) + { + case '<': + lval <<= rval; + break; + case '>': + lval >>= rval; + break; + default: + printf ( "Invalid operand.\n" ); return FALSE; + } } *result = lval; @@ -385,73 +381,19 @@ static BOOL seta_bitExclOrTerm ( LPCTSTR* p_, INT* result ) { - LPCTSTR p = *p_; - INT lval; - if ( !seta_bitAndTerm ( &p, &lval ) ) - return FALSE; - while ( *p == _T('&') ) - { - INT rval; - - p = skip_ws ( p+1 ); - - if ( !seta_bitAndTerm ( &p, &rval ) ) - return FALSE; - - lval &= rval; - } - - *result = lval; - *p_ = p; - return TRUE; + return seta_ltorTerm ( p_, result, _T("&"), seta_bitAndTerm ); } static BOOL seta_bitOrTerm ( LPCTSTR* p_, INT* result ) { - LPCTSTR p = *p_; - INT lval; - if ( !seta_bitExclOrTerm ( &p, &lval ) ) - return FALSE; - while ( *p == _T('^') ) - { - INT rval; - - p = skip_ws ( p+1 ); - - if ( !seta_bitExclOrTerm ( &p, &rval ) ) - return FALSE; - - lval ^= rval; - } - - *result = lval; - *p_ = p; - return TRUE; + return seta_ltorTerm ( p_, result, _T("^"), seta_bitExclOrTerm ); } static BOOL seta_expr ( LPCTSTR* p_, INT* result ) { - LPCTSTR p = *p_; - INT lval; - if ( !seta_bitOrTerm ( &p, &lval ) ) - return FALSE; - while ( *p == _T('|') ) - { - INT rval; - - p = skip_ws ( p+1 ); - - if ( !seta_bitOrTerm ( &p, &rval ) ) - return FALSE; - - lval |= rval; - } - - *result = lval; - *p_ = p; - return TRUE; + return seta_ltorTerm ( p_, result, _T("|"), seta_bitOrTerm ); } static BOOL @@ -498,10 +440,21 @@ if ( !seta_identval ( ident, &identval ) ) identval = 0; - if ( op == '=' ) + switch ( op ) + { + case '=': identval = exprval; - else if ( !calc ( &identval, op, exprval ) ) - return FALSE; + break; + case '<': + identval <<= exprval; + break; + case '>': + identval >>= exprval; + break; + default: + if ( !calc ( &identval, op, exprval ) ) + return FALSE; + } buf = (LPTSTR)alloca ( 32 * sizeof(TCHAR) ); _sntprintf ( buf, 32, _T("%i"), identval ); SetEnvironmentVariable ( ident, buf ); // TODO FIXME - check return value
19 years, 3 months
1
0
0
0
[gdalsnes] 17914: -remove meaningless use of winstas
by gdalsnes@svn.reactos.com
-remove meaningless use of winstas -move syscalls to end of file Modified: trunk/reactos/subsys/win32k/ntuser/accelerator.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/accelerator.c --- trunk/reactos/subsys/win32k/ntuser/accelerator.c 2005-09-18 15:25:34 UTC (rev 17913) +++ trunk/reactos/subsys/win32k/ntuser/accelerator.c 2005-09-18 16:56:33 UTC (rev 17914) @@ -91,194 +91,6 @@ } - - -int -STDCALL -NtUserCopyAcceleratorTable( - HACCEL hAccel, - LPACCEL Entries, - int EntriesCount) -{ - PWINSTATION_OBJECT WindowStation; - PACCELERATOR_TABLE Accel; - NTSTATUS Status; - int Ret; - DECLARE_RETURN(int); - - DPRINT("Enter NtUserCopyAcceleratorTable\n"); - UserEnterShared(); - - Status = IntValidateWindowStationHandle(UserGetProcessWindowStation(), - UserMode, - 0, - &WindowStation); - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(STATUS_ACCESS_DENIED); - RETURN(0); - } - - if (!(Accel = UserGetAccelObject(hAccel))) - { - ObDereferenceObject(WindowStation); - RETURN(0); - } - - if(Entries) - { - Ret = min(EntriesCount, Accel->Count); - Status = MmCopyToCaller(Entries, Accel->Table, Ret * sizeof(ACCEL)); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(WindowStation); - SetLastNtError(Status); - RETURN(0); - } - } - else - { - Ret = Accel->Count; - } - - ObDereferenceObject(WindowStation); - - RETURN(Ret); - -CLEANUP: - DPRINT("Leave NtUserCopyAcceleratorTable, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - -HACCEL -STDCALL -NtUserCreateAcceleratorTable( - LPACCEL Entries, - SIZE_T EntriesCount) -{ - PWINSTATION_OBJECT WindowStation; - PACCELERATOR_TABLE Accel; - NTSTATUS Status; - HACCEL hAccel; - DECLARE_RETURN(HACCEL); - - DPRINT("Enter NtUserCreateAcceleratorTable(Entries %p, EntriesCount %d)\n", - Entries, EntriesCount); - UserEnterExclusive(); - - Status = IntValidateWindowStationHandle(UserGetProcessWindowStation(), - UserMode, - 0, - &WindowStation); - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(STATUS_ACCESS_DENIED); - RETURN( FALSE ); - } - - Accel = ObmCreateObject(&gHandleTable, (PHANDLE)&hAccel, otAccel, sizeof(ACCELERATOR_TABLE)); - - if (Accel == NULL) - { - ObDereferenceObject(WindowStation); - SetLastNtError(STATUS_NO_MEMORY); - RETURN( (HACCEL) 0 ); - } - - Accel->Count = EntriesCount; - if (Accel->Count > 0) - { - Accel->Table = ExAllocatePoolWithTag(PagedPool, EntriesCount * sizeof(ACCEL), TAG_ACCEL); - if (Accel->Table == NULL) - { - ObmDeleteObject(hAccel, otAccel); - ObDereferenceObject(WindowStation); - SetLastNtError(Status); - RETURN( (HACCEL) 0); - } - - Status = MmCopyFromCaller(Accel->Table, Entries, EntriesCount * sizeof(ACCEL)); - if (!NT_SUCCESS(Status)) - { - ExFreePool(Accel->Table); - ObmDeleteObject(hAccel, otAccel); - ObDereferenceObject(WindowStation); - SetLastNtError(Status); - RETURN((HACCEL) 0); - } - } - - ObDereferenceObject(WindowStation); - - /* FIXME: Save HandleTable in a list somewhere so we can clean it up again */ - - RETURN(hAccel); - -CLEANUP: - DPRINT("Leave NtUserCreateAcceleratorTable(Entries %p, EntriesCount %d) = %x\n", - Entries, EntriesCount,_ret_); - UserLeave(); - END_CLEANUP; -} - - - -BOOLEAN -STDCALL -NtUserDestroyAcceleratorTable( - HACCEL hAccel) -{ - PWINSTATION_OBJECT WindowStation; - PACCELERATOR_TABLE Accel; - NTSTATUS Status; - DECLARE_RETURN(BOOLEAN); - - /* FIXME: If the handle table is from a call to LoadAcceleratorTable, decrement it's - usage count (and return TRUE). - FIXME: Destroy only tables created using CreateAcceleratorTable. - */ - - DPRINT("NtUserDestroyAcceleratorTable(Table %x)\n", hAccel); - UserEnterExclusive(); - - Status = IntValidateWindowStationHandle(UserGetProcessWindowStation(), - UserMode, - 0, - &WindowStation); - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(STATUS_ACCESS_DENIED); - DPRINT1("E1\n"); - RETURN( FALSE); - } - - if (!(Accel = UserGetAccelObject(hAccel))) - { - ObDereferenceObject(WindowStation); - RETURN( FALSE); - } - - ObmDeleteObject(hAccel, otAccel); - - if (Accel->Table != NULL) - { - ExFreePool(Accel->Table); - } - - ObDereferenceObject(WindowStation); - - RETURN( TRUE); - -CLEANUP: - DPRINT("Leave NtUserDestroyAcceleratorTable(Table %x) = %i\n", hAccel,_ret_); - UserLeave(); - END_CLEANUP; -} - static BOOLEAN FASTCALL co_IntTranslateAccelerator( @@ -299,7 +111,6 @@ if (wParam != key) { - DPRINT("T0\n"); return FALSE; } @@ -469,17 +280,156 @@ return TRUE; } + +/* SYSCALLS *****************************************************************/ + + int STDCALL +NtUserCopyAcceleratorTable( + HACCEL hAccel, + LPACCEL Entries, + int EntriesCount) +{ + PACCELERATOR_TABLE Accel; + NTSTATUS Status; + int Ret; + DECLARE_RETURN(int); + + DPRINT("Enter NtUserCopyAcceleratorTable\n"); + UserEnterShared(); + + if (!(Accel = UserGetAccelObject(hAccel))) + { + RETURN(0); + } + + if(Entries) + { + Ret = min(EntriesCount, Accel->Count); + Status = MmCopyToCaller(Entries, Accel->Table, Ret * sizeof(ACCEL)); + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + RETURN(0); + } + } + else + { + Ret = Accel->Count; + } + + RETURN(Ret); + +CLEANUP: + DPRINT("Leave NtUserCopyAcceleratorTable, ret=%i\n",_ret_); + UserLeave(); + END_CLEANUP; +} + +HACCEL +STDCALL +NtUserCreateAcceleratorTable( + LPACCEL Entries, + SIZE_T EntriesCount) +{ + PACCELERATOR_TABLE Accel; + NTSTATUS Status; + HACCEL hAccel; + DECLARE_RETURN(HACCEL); + + DPRINT("Enter NtUserCreateAcceleratorTable(Entries %p, EntriesCount %d)\n", + Entries, EntriesCount); + UserEnterExclusive(); + + Accel = ObmCreateObject(&gHandleTable, (PHANDLE)&hAccel, otAccel, sizeof(ACCELERATOR_TABLE)); + + if (Accel == NULL) + { + SetLastNtError(STATUS_NO_MEMORY); + RETURN( (HACCEL) 0 ); + } + + Accel->Count = EntriesCount; + if (Accel->Count > 0) + { + Accel->Table = ExAllocatePoolWithTag(PagedPool, EntriesCount * sizeof(ACCEL), TAG_ACCEL); + if (Accel->Table == NULL) + { + ObmDeleteObject(hAccel, otAccel); + SetLastNtError(Status); + RETURN( (HACCEL) 0); + } + + Status = MmCopyFromCaller(Accel->Table, Entries, EntriesCount * sizeof(ACCEL)); + if (!NT_SUCCESS(Status)) + { + ExFreePool(Accel->Table); + ObmDeleteObject(hAccel, otAccel); + SetLastNtError(Status); + RETURN((HACCEL) 0); + } + } + + /* FIXME: Save HandleTable in a list somewhere so we can clean it up again */ + + RETURN(hAccel); + +CLEANUP: + DPRINT("Leave NtUserCreateAcceleratorTable(Entries %p, EntriesCount %d) = %x\n", + Entries, EntriesCount,_ret_); + UserLeave(); + END_CLEANUP; +} + + + +BOOLEAN +STDCALL +NtUserDestroyAcceleratorTable( + HACCEL hAccel) +{ + PACCELERATOR_TABLE Accel; + DECLARE_RETURN(BOOLEAN); + + /* FIXME: If the handle table is from a call to LoadAcceleratorTable, decrement it's + usage count (and return TRUE). + FIXME: Destroy only tables created using CreateAcceleratorTable. + */ + + DPRINT("NtUserDestroyAcceleratorTable(Table %x)\n", hAccel); + UserEnterExclusive(); + + if (!(Accel = UserGetAccelObject(hAccel))) + { + RETURN( FALSE); + } + + ObmDeleteObject(hAccel, otAccel); + + if (Accel->Table != NULL) + { + ExFreePool(Accel->Table); + } + + RETURN( TRUE); + +CLEANUP: + DPRINT("Leave NtUserDestroyAcceleratorTable(Table %x) = %i\n", hAccel,_ret_); + UserLeave(); + END_CLEANUP; +} + + +int +STDCALL NtUserTranslateAccelerator( HWND hWnd, HACCEL hAccel, LPMSG Message) { - PWINSTATION_OBJECT WindowStation = NULL; PWINDOW_OBJECT Window = NULL; PACCELERATOR_TABLE Accel = NULL; - NTSTATUS Status; ULONG i; DECLARE_RETURN(int); @@ -501,17 +451,6 @@ RETURN( 0); } - Status = IntValidateWindowStationHandle(UserGetProcessWindowStation(), - UserMode, - 0, - &WindowStation); - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(STATUS_ACCESS_DENIED); - RETURN( 0); - } - if (!(Accel = UserGetAccelObject(hAccel))) { RETURN( 0); @@ -548,15 +487,9 @@ RETURN( 0); CLEANUP: + if (Window) UserDerefObjectCo(Window); + if (Accel) UserDerefObjectCo(Accel); - if (Window) - UserDerefObjectCo(Window); - if (Accel) - UserDerefObjectCo(Accel); - - if (WindowStation) - ObDereferenceObject(WindowStation); - DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p) = %i end\n", hWnd, hAccel, Message, 0); UserLeave();
19 years, 3 months
1
0
0
0
[hbirr] 17913: Revert my last changes.
by hbirr@svn.reactos.com
Revert my last changes. Modified: trunk/reactos/drivers/fs/vfat/cleanup.c Modified: trunk/reactos/drivers/fs/vfat/create.c _____ Modified: trunk/reactos/drivers/fs/vfat/cleanup.c --- trunk/reactos/drivers/fs/vfat/cleanup.c 2005-09-18 13:46:37 UTC (rev 17912) +++ trunk/reactos/drivers/fs/vfat/cleanup.c 2005-09-18 15:25:34 UTC (rev 17913) @@ -75,10 +75,7 @@ CcUninitializeCacheMap (FileObject, NULL, NULL); #endif pFcb->OpenHandleCount--; - if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY)) - { - IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess); - } + IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess); } return STATUS_SUCCESS; } _____ Modified: trunk/reactos/drivers/fs/vfat/create.c --- trunk/reactos/drivers/fs/vfat/create.c 2005-09-18 13:46:37 UTC (rev 17912) +++ trunk/reactos/drivers/fs/vfat/create.c 2005-09-18 15:25:34 UTC (rev 17913) @@ -612,8 +612,7 @@ pFcb = FileObject->FsContext; - if (pFcb->OpenHandleCount != 0 && - !(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY)) + if (pFcb->OpenHandleCount != 0) { Status = IoCheckShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAcce ss, Stack->Parameters.Create.ShareAccess, @@ -709,8 +708,7 @@ } } - if (pFcb->OpenHandleCount == 0 && - !(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY)) + if (pFcb->OpenHandleCount == 0) { IoSetShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAccess , Stack->Parameters.Create.ShareAccess,
19 years, 3 months
1
0
0
0
[hbirr] 17912: The share disposition isn't necessary for FILE_READ_ATTRIBUTES.
by hbirr@svn.reactos.com
The share disposition isn't necessary for FILE_READ_ATTRIBUTES. Modified: trunk/reactos/lib/kernel32/file/file.c _____ Modified: trunk/reactos/lib/kernel32/file/file.c --- trunk/reactos/lib/kernel32/file/file.c 2005-09-18 13:36:29 UTC (rev 17911) +++ trunk/reactos/lib/kernel32/file/file.c 2005-09-18 13:46:37 UTC (rev 17912) @@ -873,7 +873,7 @@ SYNCHRONIZE | FILE_READ_ATTRIBUTES, &ObjectAttributes, &IoStatusBlock, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + 0, FILE_SYNCHRONOUS_IO_NONALERT); RtlFreeUnicodeString (&FileName); if (!NT_SUCCESS (Status))
19 years, 3 months
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200