ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2020
----- 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
25 participants
382 discussions
Start a n
N
ew thread
[reactos] 01/01: [CMD_ROSTEST] Add more tests for the command echoer and new tests for the parser.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7988a2ac54da88240b632…
commit 7988a2ac54da88240b632d00c7597a7f6da13db9 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Jul 27 19:29:59 2020 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Sep 26 17:51:07 2020 +0200 [CMD_ROSTEST] Add more tests for the command echoer and new tests for the parser. --- modules/rostests/win32/cmd/test_echoer_parser.cmd | 451 +++++++++++++++++++++ .../rostests/win32/cmd/test_echoer_parser.cmd.exp | 295 ++++++++++++++ 2 files changed, 746 insertions(+) diff --git a/modules/rostests/win32/cmd/test_echoer_parser.cmd b/modules/rostests/win32/cmd/test_echoer_parser.cmd index e94313871f7..ecb20a63afd 100644 --- a/modules/rostests/win32/cmd/test_echoer_parser.cmd +++ b/modules/rostests/win32/cmd/test_echoer_parser.cmd @@ -251,6 +251,457 @@ if 1==1 ( ) + +:: Parsing FOR, IF and REM commands. +:: +:: Note: wrong syntaxes for FOR, IF, REM or parsing operators +:: are considered syntactic errors and batch running stops. +:: For all other commands, execution continues. +:: + +@echo on + +echo --------- Parsing FOR, IF and REM commands --------- + +fOr@space@@space@@space@@tab@@tab@ /d@space@@space@@tab@ %%d iN (*)@space@@space@@tab@ do eCHo %%d +:for /asdf +:: for /d %%d in (*) do echo %%d +:: for /d %%d in (*) do echo %%~fd +for /d %%d in (*) do echo %%~ed +for /d %%d in (*) do echo %~d0: +fOr@tab@@space@@space@@space@@space@@space@@space@@space@@space@@tab@/l@space@@tab@ %%c@space@@space@@tab@ iN@tab@ (1,1,5)@space@@space@@tab@ Do@space@@space@@tab@@space@@tab@ echo@tab@@space@@space@@space@@space@@tab@@tab@%%c + + +iF@space@@space@@tab@ 457@space@@tab@@space@@tab@neQ@space@@space@@tab@ 458@space@@tab@ (@space@@tab@ echo@space@@tab@ %~d0 ) eLSe (@space@@space@@tab@ echo $~d0@space@@tab@ ) + +::: if 457 nea 458 (echo %~d0) eLSe (echo $~dp) +:if 457 nea 458 (echo yo) else (echo ya) +:if 457 leq 458 (rem/? /d) +:: if 457 leq 458 ( if 457 nea 458 (echo hi) else (echo yo) ) + +iF@space@@space@@tab@ "2147483647"@space@@space@@tab@ gEq@space@@tab@@space@@tab@ "2147483648"@space@@tab@ (Echo Larger)@space@@space@@tab@ Else@space@@tab@ (:Echo Smaller) +ecHO sMaLlEr) + +iF@space@@space@@tab@eRrOrlevel 0 echo hi! + + +:: rem@tab@@space@@tab@ /df@space@@space@@tab@ /d + +rEM /v@space@@tab@/d +REm@space@@space@@space@@tab@@tab@ /d +rEm REM2 /d +reM@space@@tab@ /d@space@@tab@ >@space@@tab@ NUL +:reM /?/d + +:: These commands, even commented out via the parser comment colon, +:: cause parsing errors even when being commented out. +:: Replace the two '%' by a single one to see the effects. +:: +:echo %~f0 %%~dp %~p1 +:echo %%~d0 $~dp +:echo %%~dp: +:echo %%~b0 + + + +:: +:: Parsing random commands +:: + +echo --------- Parsing random commands --------- + +:: Parsing these commands should fail (when being un-commmented). +:@a ( b & | +: a ( b & | + +:: If goto fails, batch stops. (Done OK in ROS' cmd) +:goto /asdf whatever + +dir > NUL &(b) + + +setlocal enabledelayedexpansion + +echo %~dp0 + +set SOMEVAR=C:\ReAcToS +rem %SOMEVAR% | + +Set "_var=first" +Set "_var=second" & Rem %_var% !_var! +Set "_var=third" & Echo %_var% !_var! + +endlocal + + + +:: +:: Parsing line continuations, either from parenthesized blocks +:: or via the escape caret. +:: It may be informative to manually run this test under CMD +:: with cmd!fDumpTokens and cmd!fDumpParse flags enabled. +:: + +echo --------- Parsing line continuations --------- + +( +a & b +c +d +) +:: +:: Parsed as: +:: '('[ '&'[a, CRLF[b, CRLF[c,d] ] ] ] +:: + + +( +a && b +c +d +) +:: +:: Parsed as: +:: '('[ CRLF['&&'[a,b], CRLF[c,d]] ] +:: + + +(a & b) + +( +a & b +) + + +( +a & b +c & d +) + + +(a & ^ +b +c & d +) +:: +:: Parsed as: +:: '('[ '&'[a, CRLF[b, '&'[c,d] ] ] +:: + + +( +a & b +c +d +) +:: +:: Parsed as: +:: '('[ '&'[a, CRLF[b, CRLF[c,d] ] ] ] +:: + + +( +a && b +c +d +) +:: +:: Parsed as: +:: '('[ CRLF['&&'[a,b], CRLF[c,d]] ] +:: + + +( +a || b +c +d +) +:: +:: Parsed as: +:: '('[ CRLF['||'[a,b], CRLF[c,d]] ] +:: + + +( +a +b & c +d +) +:: +:: Parsed as: +:: '('[ CRLF[a, '&'[b, CRLF[c,d]]] ] +:: + + +( +a +b && c +d +) +:: +:: Parsed as: +:: '('[ CRLF[a, CRLF['&&'[b,c], d]] ] +:: + + +( +a +b +c && d +) +:: +:: Parsed as: +:: '('[ CRLF[a, CRLF[b, '&&'[c,d]]] ] +:: + + +( +a +b +c & d +) +:: +:: Parsed as: +:: '('[ CRLF[a, CRLF[b, '&'[c,d]]] ] +:: + + +( +a +b + +c +d +) +:: +:: Parsed as: +:: '('[ CRLF[a, CRLF[b, CRLF[c,d] ] ] ] +:: + + + +REM foo^ +bar^ +baz trol^ + + +if 1==1 (echo a) else (echo b) + +if 1==1 (echo a +) else (echo b) + +if 1==1 (echo a) else ( +echo b) + +if 1==1 ( +echo a +) else ( +echo b +) + + +REM if 1==1 (^ +REM echo a +REM ) ^ +REM else +REM (^ +REM echo b +REM ) + + +REM if 1==1 (^ +REM echo a +REM ) ^ +REM else^ +REM (^ +REM echo b +REM ) + + +REM if 1==1 (^ +REM echo a +REM ) ^ +REM else^ +REM ( +REM echo b +REM ) + + +if 1==1 (^ +echo a +) + + +if 1==1 (^ +@echo a +) + + + +(foo ^ +bar +) + +(foo ^ +&& bar +baz +) + +(foo ^ + && bar +baz +) + +REM (foo^ +REM && bar +REM baz +REM ) + +(foo^ +bar +baz +) + + +(foo &^ +& bar +baz +) + + +(^ +foo +bar +) + + + +( + + +foo ^ +bar +) + + + +( + + +foo ^ +&& bar +baz +) + + + +( + + +foo ^ + && bar +baz +) + + + + +REM ( +REM +REM +REM foo^ +REM && bar +REM baz +REM ) + + + +( + + +foo^ +bar +baz +) + + + +( + + +foo &^ +& bar +baz +) + + + +( + + +^ +foo +bar +) + + + +:: +:: Tests for Character Escape and Line Continuation +:: + +(^"!pc::^=^!^") + +(^ +"!pc::^=^!^") + +( +^"!pc::^=^!^") + + +(^"!pc::^=^ +% New line % +!^") + +REM @ 2>&1 ( ( dir) ) && lol + + +echo & ^ +&&lol + + +REM echo & ^ +REM ^ +REM &&lol + + +trol ^ +&&lol + + +trol^ +&&lol + + +REM (echo hi)^ +REM &&lol + + +rem trol(^ +line +@rem trol2""^ +line2 +:trol3^ +line3 + +echo trol^ +line + +:echo trol^ +line + + + @echo off :: diff --git a/modules/rostests/win32/cmd/test_echoer_parser.cmd.exp b/modules/rostests/win32/cmd/test_echoer_parser.cmd.exp index 796b31eef76..65c909ea3e3 100644 --- a/modules/rostests/win32/cmd/test_echoer_parser.cmd.exp +++ b/modules/rostests/win32/cmd/test_echoer_parser.cmd.exp @@ -322,4 +322,299 @@ updated TN == TN updated TN == TN updated TN == TN updated TN == TN + +@pwd@>echo --------- Parsing FOR, IF and REM commands ---------@space@ +--------- Parsing FOR, IF and REM commands --------- + +@pwd@>fOr / %d iN (*) do eCHo %d@space@ + +@pwd@>eCHo script_testsuite@space@ +script_testsuite + +@pwd@>for / %d in (*) do echo %~ed@space@ + +@pwd@>echo %~ed@space@ +%~ed + +@pwd@>for / %d in (*) do echo D::@space@ + +@pwd@>echo D::@space@ +D:: + +@pwd@>fOr /L %c iN (1 1 5) Do echo@tab@@space@@space@@space@@space@@tab@@tab@%c@space@ + +@pwd@>echo@tab@@space@@space@@space@@space@@tab@@tab@1@space@ +@space@@space@@space@@space@@tab@@tab@1 + +@pwd@>echo@tab@@space@@space@@space@@space@@tab@@tab@2@space@ +@space@@space@@space@@space@@tab@@tab@2 + +@pwd@>echo@tab@@space@@space@@space@@space@@tab@@tab@3@space@ +@space@@space@@space@@space@@tab@@tab@3 + +@pwd@>echo@tab@@space@@space@@space@@space@@tab@@tab@4@space@ +@space@@space@@space@@space@@tab@@tab@4 + +@pwd@>echo@tab@@space@@space@@space@@space@@tab@@tab@5@space@ +@space@@space@@space@@space@@tab@@tab@5 + +@pwd@>iF 457 NEQ 458 (echo@space@@tab@ D: ) eLSe (echo $~d0@space@@tab@ )@space@ +@tab@ D:@space@ + +@pwd@>iF "2147483647" GEQ "2147483648" (Echo Larger ) Else (ecHO sMaLlEr )@space@ +sMaLlEr + +@pwd@>iF eRrOrlevel 0 echo hi!@space@ +hi + +@pwd@>rEM /v@space@@tab@/d@space@ + +@pwd@>REm@space@@space@@space@@tab@@tab@ /d@space@ + +@pwd@>rEm REM2 /d@space@ + +@pwd@>reM@space@@tab@ /d@space@@tab@ >@space@@tab@ NUL@space@ + +@pwd@>echo --------- Parsing random commands ---------@space@ +--------- Parsing random commands --------- + +@pwd@>dir 1>NUL & (b)@space@ + +@pwd@>setlocal enabledelayedexpansion@space@ + +@pwd@>echo @pwd@\@space@ +@pwd@\ + +@pwd@>set SOMEVAR=C:\ReAcToS@space@ + +@pwd@>rem C:\ReAcToS |@space@ + +@pwd@>Set "_var=first"@space@ + +@pwd@>Set "_var=second" & Rem first !_var!@space@ + +@pwd@>Set "_var=third" & Echo second !_var!@space@ +second third + +@pwd@>endlocal + +@pwd@>echo --------- Parsing line continuations ---------@space@ +--------- Parsing line continuations --------- + +@pwd@>(a & b@space@ + c@space@ + d)@space@ + +@pwd@>( +a && b@space@ + c@space@ + d +)@space@ + +@pwd@>(a & b)@space@ + +@pwd@>(a & b)@space@ + +@pwd@>(a & b@space@ + c & d)@space@ + +@pwd@>(a & b@space@ + c & d)@space@ + +@pwd@>(a & b@space@ + c@space@ + d)@space@ + +@pwd@>( +a && b@space@ + c@space@ + d +)@space@ + +@pwd@>( +a || b@space@ + c@space@ + d +)@space@ + +@pwd@>( +a@space@ + b & c@space@ + d +)@space@ + +@pwd@>( +a@space@ + b && c@space@ + d +)@space@ + +@pwd@>( +a@space@ + b@space@ + c && d +)@space@ + +@pwd@>( +a@space@ + b@space@ + c & d +)@space@ + +@pwd@>( +a@space@ + b@space@ + c@space@ + d +)@space@ + +@pwd@>REMbaz trol^@space@ + +@pwd@>if 1 == 1 (echo a ) else (echo b )@space@ +a + +@pwd@>if 1 == 1 (echo a ) else (echo b )@space@ +a + +@pwd@>if 1 == 1 (echo a ) else (echo b )@space@ +a + +@pwd@>if 1 == 1 (echo a ) else (echo b )@space@ +a + +@pwd@>REM if 1==1 (^@space@ + +@pwd@>REM echo a@space@ + +@pwd@>REM ) ^@space@ + +@pwd@>REM else@space@ + +@pwd@>REMREM echo b@space@ + +@pwd@>REM )@space@ + +@pwd@>REM if 1==1 (^@space@ + +@pwd@>REM echo a@space@ + +@pwd@>REM ) ^@space@ + +@pwd@>REMREM (^@space@ + +@pwd@>REM echo b@space@ + +@pwd@>REM )@space@ + +@pwd@>REM if 1==1 (^@space@ + +@pwd@>REM echo a@space@ + +@pwd@>REM ) ^@space@ + +@pwd@>REMREM (@space@ + +@pwd@>REM echo b@space@ + +@pwd@>REM )@space@ + +@pwd@>if 1 == 1 (echo a )@space@ +a + +@pwd@>if 1 == 1 ()@space@ +a + +@pwd@>(foo bar )@space@ + +@pwd@>(foo & & bar@space@ + baz)@space@ + +@pwd@>( +foo && bar@space@ + baz +)@space@ + +@pwd@>REMREM && bar@space@ + +@pwd@>REM baz@space@ + +@pwd@>REM )@space@ + +@pwd@>( +bar@space@ + baz +)@space@ + +@pwd@>(foo & & bar@space@@space@ + baz)@space@ + +@pwd@>( +foo@space@ + bar +)@space@ + +@pwd@>(foo bar )@space@ + +@pwd@>(foo & & bar@space@ + baz)@space@ + +@pwd@>( +foo && bar@space@ + baz +)@space@ + +@pwd@>REM (@space@ + +@pwd@>REM + +@pwd@>REM + +@pwd@>REMREM && bar@space@ + +@pwd@>REM baz@space@ + +@pwd@>REM )@space@ + +@pwd@>( +bar@space@ + baz +)@space@ + +@pwd@>(foo & & bar@space@@space@ + baz)@space@ + +@pwd@>( +foo@space@ + bar +)@space@ + +@pwd@>("!pc::=!")@space@ + +@pwd@>("!pc::^=^!^")@space@ + +@pwd@>("!pc::=!")@space@ + +@pwd@>(!")@space@ + +@pwd@>REM @ 2>&1 ( ( dir) ) && lol@space@ + +@pwd@>echo & & & lol +ECHO is on. + +@pwd@>REM echo & ^@space@ + +@pwd@>REMREM &&lol@space@ + +@pwd@>trol & & lol + +@pwd@>trol& & lol + +@pwd@>REM (echo hi)^@space@ + +@pwd@>REM &&lol@space@ + +@pwd@>remline@space@ + +@pwd@>echo trolline@space@ +trolline --------- Finished --------------
4 years, 3 months
1
0
0
0
[reactos] 01/01: [ROSTEST] Fix copy paste bug in RtlBitmap.c
by Kyle Katarn
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b217d8bd149b821b2d2d1…
commit b217d8bd149b821b2d2d13662606c983e150d76e Author: Kyle Katarn <contact(a)kcsoftwares.com> AuthorDate: Mon Sep 21 23:36:29 2020 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Sep 26 17:12:36 2020 +0200 [ROSTEST] Fix copy paste bug in RtlBitmap.c --- modules/rostests/apitests/ntdll/RtlBitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rostests/apitests/ntdll/RtlBitmap.c b/modules/rostests/apitests/ntdll/RtlBitmap.c index 355ccee0aff..3b224be1e66 100644 --- a/modules/rostests/apitests/ntdll/RtlBitmap.c +++ b/modules/rostests/apitests/ntdll/RtlBitmap.c @@ -307,7 +307,7 @@ Test_RtlNumberOfSetBits(void) RtlInitializeBitMap(&BitMapHeader, Buffer, 0); ok_int(RtlNumberOfSetBits(&BitMapHeader), 0); - ok_hex(Buffer[0], IsBroken ? 0x7f00ff0f : 0x7f00ff0f); + ok_hex(Buffer[0], IsBroken ? 0x7f00ff0f : 0xff00ff0f); ok_hex(Buffer[1], 0x3F303F30); FreeGuarded(Buffer);
4 years, 3 months
1
0
0
0
[reactos] 01/01: [COMDLG32] Support shortcut keys on Open/Save Dialog (#3238)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c8e1460ac57e7862ccef0…
commit c8e1460ac57e7862ccef0b5602764b6d72167a70 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Sep 26 21:26:06 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Sep 26 21:26:06 2020 +0900 [COMDLG32] Support shortcut keys on Open/Save Dialog (#3238) Enable key accelerators on File Open/Save Dialog. CORE-14332 --- dll/win32/comdlg32/cdlg.h | 3 ++ dll/win32/comdlg32/cdlg32.c | 9 +++++ dll/win32/comdlg32/filedlg.c | 94 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) diff --git a/dll/win32/comdlg32/cdlg.h b/dll/win32/comdlg32/cdlg.h index 28bb7e75268..7570acebb9e 100644 --- a/dll/win32/comdlg32/cdlg.h +++ b/dll/win32/comdlg32/cdlg.h @@ -27,6 +27,9 @@ #define COMDLG32_Atom MAKEINTATOM(0xa000) /* MS uses this one to identify props */ extern HINSTANCE COMDLG32_hInstance DECLSPEC_HIDDEN; +#ifdef __REACTOS__ +extern CRITICAL_SECTION COMDLG32_OpenFileLock DECLSPEC_HIDDEN; +#endif void COMDLG32_SetCommDlgExtendedError(DWORD err) DECLSPEC_HIDDEN; LPVOID COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN; diff --git a/dll/win32/comdlg32/cdlg32.c b/dll/win32/comdlg32/cdlg32.c index 1c21025cfd0..95692c00a37 100644 --- a/dll/win32/comdlg32/cdlg32.c +++ b/dll/win32/comdlg32/cdlg32.c @@ -40,6 +40,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance = 0; +#ifdef __REACTOS__ +CRITICAL_SECTION COMDLG32_OpenFileLock DECLSPEC_HIDDEN; +#endif static DWORD COMDLG32_TlsIndex = TLS_OUT_OF_INDEXES; @@ -76,6 +79,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved) DisableThreadLibraryCalls(hInstance); SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL"); +#ifdef __REACTOS__ + InitializeCriticalSection(&COMDLG32_OpenFileLock); +#endif /* SHELL */ GPA(COMDLG32_SHSimpleIDListFromPathAW, SHELL32_hInstance, (LPCSTR)162); @@ -84,6 +90,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved) case DLL_PROCESS_DETACH: if (Reserved) break; if (COMDLG32_TlsIndex != TLS_OUT_OF_INDEXES) TlsFree(COMDLG32_TlsIndex); +#ifdef __REACTOS__ + DeleteCriticalSection(&COMDLG32_OpenFileLock); +#endif break; } return TRUE; diff --git a/dll/win32/comdlg32/filedlg.c b/dll/win32/comdlg32/filedlg.c index 6e5134f6ce3..49bd1d006b1 100644 --- a/dll/win32/comdlg32/filedlg.c +++ b/dll/win32/comdlg32/filedlg.c @@ -106,6 +106,78 @@ typedef struct tagLookInInfo UINT uSelectedItem; } LookInInfos; +#ifdef __REACTOS__ +/* We have to call IShellView::TranslateAccelerator to handle the standard + key bindings of File Open Dialog. We use hook to realize them. */ +static HHOOK s_hFileDialogHook = NULL; +static LONG s_nFileDialogHookCount = 0; + +#define MAX_TRANSLATE 8 +static HWND s_ahwndTranslate[MAX_TRANSLATE] = { NULL }; + +static void FILEDLG95_AddRemoveTranslate(HWND hwndOld, HWND hwndNew) +{ + LONG i; + for (i = 0; i < MAX_TRANSLATE; ++i) + { + if (s_ahwndTranslate[i] == hwndOld) + { + s_ahwndTranslate[i] = hwndNew; + break; + } + } +} + +static __inline BOOL +FILEDLG95_DoTranslate(LONG i, HWND hwndFocus, LPMSG pMsg) +{ + FileOpenDlgInfos *fodInfos; + HWND hwndView; + + if (s_ahwndTranslate[i] == NULL) + return FALSE; + + fodInfos = get_filedlg_infoptr(s_ahwndTranslate[i]); + if (fodInfos == NULL) + return FALSE; + + hwndView = fodInfos->ShellInfos.hwndView; + if (hwndView == hwndFocus || IsChild(hwndView, hwndFocus)) + { + IShellView_TranslateAccelerator(fodInfos->Shell.FOIShellView, pMsg); + return TRUE; + } + return FALSE; +} + +/* WH_MSGFILTER hook procedure */ +static LRESULT CALLBACK +FILEDLG95_TranslateMsgProc(INT nCode, WPARAM wParam, LPARAM lParam) +{ + LPMSG pMsg; + + if (nCode < 0) + return CallNextHookEx(s_hFileDialogHook, nCode, wParam, lParam); + if (nCode != MSGF_DIALOGBOX) + return 0; + + pMsg = (LPMSG)lParam; + if (WM_KEYFIRST <= pMsg->message && pMsg->message <= WM_KEYLAST) + { + LONG i; + HWND hwndFocus = GetFocus(); + EnterCriticalSection(&COMDLG32_OpenFileLock); + for (i = 0; i < MAX_TRANSLATE; ++i) + { + if (FILEDLG95_DoTranslate(i, hwndFocus, pMsg)) + break; + } + LeaveCriticalSection(&COMDLG32_OpenFileLock); + } + + return 0; +} +#endif /*********************************************************************** * Defines and global variables @@ -1428,6 +1500,17 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l if(fodInfos->ofnInfos->Flags & OFN_EXPLORER) SendCustomDlgNotificationMessage(hwnd,CDN_SELCHANGE); +#ifdef __REACTOS__ + /* Enable hook and translate */ + EnterCriticalSection(&COMDLG32_OpenFileLock); + if (++s_nFileDialogHookCount == 1) + { + s_hFileDialogHook = SetWindowsHookEx(WH_MSGFILTER, FILEDLG95_TranslateMsgProc, + 0, GetCurrentThreadId()); + } + FILEDLG95_AddRemoveTranslate(NULL, hwnd); + LeaveCriticalSection(&COMDLG32_OpenFileLock); +#endif return 0; } case WM_SIZE: @@ -1465,6 +1548,17 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l SendDlgItemMessageW(hwnd, IDC_TOOLBARPLACES, TB_SETIMAGELIST, 0, 0); ImageList_Destroy(himl); } +#ifdef __REACTOS__ + /* Disable hook and translate */ + EnterCriticalSection(&COMDLG32_OpenFileLock); + FILEDLG95_AddRemoveTranslate(hwnd, NULL); + if (--s_nFileDialogHookCount == 0) + { + UnhookWindowsHookEx(s_hFileDialogHook); + s_hFileDialogHook = NULL; + } + LeaveCriticalSection(&COMDLG32_OpenFileLock); +#endif return FALSE; }
4 years, 3 months
1
0
0
0
[reactos] 01/01: [DRIVERS][SCSIPORT] Fix build fdc47e7
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1062a297bf9549b0bd9cd…
commit 1062a297bf9549b0bd9cd8b16875bf28ccd4bb1f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Sep 26 11:19:58 2020 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sat Sep 26 11:20:11 2020 +0900 [DRIVERS][SCSIPORT] Fix build fdc47e7 --- drivers/storage/port/scsiport/stubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/storage/port/scsiport/stubs.c b/drivers/storage/port/scsiport/stubs.c index e23fb369472..e2ac2107677 100644 --- a/drivers/storage/port/scsiport/stubs.c +++ b/drivers/storage/port/scsiport/stubs.c @@ -6,7 +6,7 @@ * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) */ -#include "precomp.h" +#include "scsiport.h" #include <srb.h>
4 years, 3 months
1
0
0
0
[reactos] 01/01: [USER32] Mute 'Imm Api Table Init 2' spam
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f341e60fbe5a6377c292f…
commit f341e60fbe5a6377c292f82022e1433cb0b9f66d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Sep 26 11:13:43 2020 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sat Sep 26 11:13:43 2020 +0900 [USER32] Mute 'Imm Api Table Init 2' spam CORE-11700 --- win32ss/user/user32/misc/imm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c index 03e040230a9..ef821aea8fa 100644 --- a/win32ss/user/user32/misc/imm.c +++ b/win32ss/user/user32/misc/imm.c @@ -55,9 +55,6 @@ BOOL WINAPI IntInitializeImmEntryTable(VOID) WCHAR ImmFile[MAX_PATH]; HMODULE imm32 = ghImm32; - if (IMM_FN(ImmWINNLSEnableIME) != IMMSTUB_ImmWINNLSEnableIME) - return TRUE; - GetImmFileName(ImmFile, sizeof(ImmFile)); TRACE("File %ws\n",ImmFile); @@ -104,11 +101,8 @@ BOOL WINAPI User32InitializeImmEntryTable(DWORD magic) if (magic != IMM_INIT_MAGIC) return FALSE; - if (gImmApiEntries.pImmIsIME != 0) - { - ERR("Imm Api Table Init 2\n"); - return TRUE; - } + if (IMM_FN(ImmIsIME) != IMMSTUB_ImmIsIME) + return TRUE; IntInitializeImmEntryTable();
4 years, 3 months
1
0
0
0
[reactos] 01/01: [SCSIPORT][FORMATTING] Fix formatting and PCH generation
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fdc47e7ea7fe0564f37f9…
commit fdc47e7ea7fe0564f37f975a5c2d74adfaa41acd Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Sat Sep 26 03:47:52 2020 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Sat Sep 26 03:47:52 2020 +0300 [SCSIPORT][FORMATTING] Fix formatting and PCH generation --- drivers/storage/port/scsiport/CMakeLists.txt | 5 +- drivers/storage/port/scsiport/precomp.h | 6 - drivers/storage/port/scsiport/scsiport.c | 1454 ++++++++++---------- .../port/scsiport/{scsiport_int.h => scsiport.h} | 8 + 4 files changed, 702 insertions(+), 771 deletions(-) diff --git a/drivers/storage/port/scsiport/CMakeLists.txt b/drivers/storage/port/scsiport/CMakeLists.txt index 0fa44c3f0b1..74304049d99 100644 --- a/drivers/storage/port/scsiport/CMakeLists.txt +++ b/drivers/storage/port/scsiport/CMakeLists.txt @@ -3,15 +3,14 @@ spec2def(scsiport.sys scsiport.spec ADD_IMPORTLIB) list(APPEND SOURCE scsiport.c - stubs.c - precomp.h) + stubs.c) add_library(scsiport MODULE ${SOURCE} scsiport.rc ${CMAKE_CURRENT_BINARY_DIR}/scsiport.def) -add_pch(scsiport precomp.h SOURCE) +add_pch(scsiport scsiport.h "") set_module_type(scsiport kernelmodedriver) add_importlibs(scsiport ntoskrnl hal) add_cd_file(TARGET scsiport DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/port/scsiport/precomp.h b/drivers/storage/port/scsiport/precomp.h deleted file mode 100644 index 69afc4093c3..00000000000 --- a/drivers/storage/port/scsiport/precomp.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _SCSIPORT_PCH_ -#define _SCSIPORT_PCH_ - -#include <wdm.h> - -#endif /* _SCSIPORT_PCH_ */ diff --git a/drivers/storage/port/scsiport/scsiport.c b/drivers/storage/port/scsiport/scsiport.c index f0adf12384e..2155a2c069d 100644 --- a/drivers/storage/port/scsiport/scsiport.c +++ b/drivers/storage/port/scsiport/scsiport.c @@ -1,46 +1,18 @@ /* - * ReactOS kernel - * Copyright (C) 2001, 2002 ReactOS Team - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Storage Stack - * FILE: drivers/storage/scsiport/scsiport.c - * PURPOSE: SCSI port driver - * PROGRAMMER: Eric Kohl - * Aleksey Bragin (aleksey reactos org) + * PROJECT: ReactOS Storage Stack + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: SCSI Port driver SCSI requests handling + * COPYRIGHT: Eric Kohl (eric.kohl(a)reactos.org) + * Aleksey Bragin (aleksey(a)reactos.org) */ /* INCLUDES *****************************************************************/ -#include "precomp.h" - -#include <ntddk.h> -#include <stdio.h> -#include <scsi.h> -#include <ntddscsi.h> -#include <ntdddisk.h> -#include <mountdev.h> +#include "scsiport.h" #define NDEBUG #include <debug.h> -#include "scsiport_int.h" - ULONG InternalDebugLevel = 0x00; #undef ScsiPortMoveMemory @@ -58,21 +30,21 @@ SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject, static NTSTATUS NTAPI ScsiPortCreateClose(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PIRP Irp); static DRIVER_DISPATCH ScsiPortDispatchScsi; static NTSTATUS NTAPI ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PIRP Irp); static NTSTATUS NTAPI ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PIRP Irp); static DRIVER_STARTIO ScsiPortStartIo; static VOID NTAPI ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp); + IN PIRP Irp); static BOOLEAN NTAPI ScsiPortStartPacket(IN OUT PVOID Context); @@ -87,9 +59,9 @@ SpiAllocateLunExtension(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension); static PSCSI_PORT_LUN_EXTENSION SpiGetLunExtension (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, - IN UCHAR PathId, - IN UCHAR TargetId, - IN UCHAR Lun); + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun); static PSCSI_REQUEST_BLOCK_INFO SpiAllocateSrbStructures(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, @@ -105,7 +77,7 @@ SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension); static NTSTATUS SpiGetInquiryData (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, - IN PIRP Irp); + IN PIRP Irp); static PSCSI_REQUEST_BLOCK_INFO SpiGetSrbData(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, @@ -116,17 +88,17 @@ SpiGetSrbData(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, static BOOLEAN NTAPI ScsiPortIsr(IN PKINTERRUPT Interrupt, - IN PVOID ServiceContext); + IN PVOID ServiceContext); static VOID NTAPI ScsiPortDpcForIsr(IN PKDPC Dpc, - IN PDEVICE_OBJECT DpcDeviceObject, - IN PIRP DpcIrp, - IN PVOID DpcContext); + IN PDEVICE_OBJECT DpcDeviceObject, + IN PIRP DpcIrp, + IN PVOID DpcContext); static VOID NTAPI ScsiPortIoTimer(PDEVICE_OBJECT DeviceObject, - PVOID Context); + PVOID Context); IO_ALLOCATION_ACTION NTAPI @@ -221,29 +193,29 @@ NTHALAPI NTSTATUS NTAPI HalAssignSlotResources(PUNICODE_STRING, PUNICODE_STRING, /* FUNCTIONS *****************************************************************/ /********************************************************************** - * NAME EXPORTED - * DriverEntry + * NAME EXPORTED + * DriverEntry * * DESCRIPTION - * This function initializes the driver. + * This function initializes the driver. * * RUN LEVEL - * PASSIVE_LEVEL + * PASSIVE_LEVEL * * ARGUMENTS - * DriverObject - * System allocated Driver Object for this driver. + * DriverObject + * System allocated Driver Object for this driver. * - * RegistryPath - * Name of registry driver service key. + * RegistryPath + * Name of registry driver service key. * * RETURN VALUE - * Status. + * Status. */ NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPath) + IN PUNICODE_STRING RegistryPath) { DPRINT("ScsiPort Driver %s\n", VERSION); return(STATUS_SUCCESS); @@ -251,35 +223,35 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, /********************************************************************** - * NAME EXPORTED - * ScsiDebugPrint + * NAME EXPORTED + * ScsiDebugPrint * * DESCRIPTION - * Prints debugging messages. + * Prints debugging messages. * * RUN LEVEL - * PASSIVE_LEVEL + * PASSIVE_LEVEL * * ARGUMENTS - * DebugPrintLevel - * Debug level of the given message. + * DebugPrintLevel + * Debug level of the given message. * - * DebugMessage - * Pointer to printf()-compatible format string. + * DebugMessage + * Pointer to printf()-compatible format string. * - * ... - Additional output data (see printf()). + * ... + Additional output data (see printf()). * * RETURN VALUE - * None. + * None. * * @implemented */ VOID ScsiDebugPrint(IN ULONG DebugPrintLevel, - IN PCHAR DebugMessage, - ...) + IN PCHAR DebugMessage, + ...) { char Buffer[256]; va_list ap; @@ -420,7 +392,7 @@ ScsiPortFlushDma(IN PVOID HwDeviceExtension) */ VOID NTAPI ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, - IN PVOID MappedAddress) + IN PVOID MappedAddress) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PMAPPED_ADDRESS NextMa, LastMa; @@ -472,11 +444,11 @@ ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, */ ULONG NTAPI ScsiPortGetBusData(IN PVOID DeviceExtension, - IN ULONG BusDataType, - IN ULONG SystemIoBusNumber, - IN ULONG SlotNumber, - IN PVOID Buffer, - IN ULONG Length) + IN ULONG BusDataType, + IN ULONG SystemIoBusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length) { DPRINT("ScsiPortGetBusData()\n"); @@ -522,11 +494,11 @@ ScsiPortSetBusDataByOffset(IN PVOID DeviceExtension, */ PVOID NTAPI ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension, - IN INTERFACE_TYPE BusType, - IN ULONG SystemIoBusNumber, - IN SCSI_PHYSICAL_ADDRESS IoAddress, - IN ULONG NumberOfBytes, - IN BOOLEAN InIoSpace) + IN INTERFACE_TYPE BusType, + IN ULONG SystemIoBusNumber, + IN SCSI_PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN InIoSpace) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PHYSICAL_ADDRESS TranslatedAddress; @@ -581,9 +553,9 @@ ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension, */ PVOID NTAPI ScsiPortGetLogicalUnit(IN PVOID HwDeviceExtension, - IN UCHAR PathId, - IN UCHAR TargetId, - IN UCHAR Lun) + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PSCSI_PORT_LUN_EXTENSION LunExtension; @@ -687,10 +659,10 @@ ScsiPortGetPhysicalAddress(IN PVOID HwDeviceExtension, */ PSCSI_REQUEST_BLOCK NTAPI ScsiPortGetSrb(IN PVOID DeviceExtension, - IN UCHAR PathId, - IN UCHAR TargetId, - IN UCHAR Lun, - IN LONG QueueTag) + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN LONG QueueTag) { DPRINT1("ScsiPortGetSrb() unimplemented\n"); UNIMPLEMENTED; @@ -703,8 +675,8 @@ ScsiPortGetSrb(IN PVOID DeviceExtension, */ PVOID NTAPI ScsiPortGetUncachedExtension(IN PVOID HwDeviceExtension, - IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, - IN ULONG NumberOfBytes) + IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, + IN ULONG NumberOfBytes) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; DEVICE_DESCRIPTION DeviceDescription; @@ -976,39 +948,40 @@ SpiInitOpenKeys(PCONFIGURATION_INFO ConfigInfo, PUNICODE_STRING RegistryPath) /********************************************************************** - * NAME EXPORTED - * ScsiPortInitialize + * NAME EXPORTED + * ScsiPortInitialize * * DESCRIPTION - * Initializes SCSI port driver specific data. + * Initializes SCSI port driver specific data. * * RUN LEVEL - * PASSIVE_LEVEL + * PASSIVE_LEVEL * * ARGUMENTS - * Argument1 - * Pointer to the miniport driver's driver object. + * Argument1 + * Pointer to the miniport driver's driver object. * - * Argument2 - * Pointer to the miniport driver's registry path. + * Argument2 + * Pointer to the miniport driver's registry path. * - * HwInitializationData - * Pointer to port driver specific configuration data. + * HwInitializationData + * Pointer to port driver specific configuration data. * - * HwContext - Miniport driver specific context. + * HwContext + Miniport driver specific context. * * RETURN VALUE - * Status. + * Status. * * @implemented */ ULONG NTAPI -ScsiPortInitialize(IN PVOID Argument1, - IN PVOID Argument2, - IN struct _HW_INITIALIZATION_DATA *HwInitializationData, - IN PVOID HwContext) +ScsiPortInitialize( + IN PVOID Argument1, + IN PVOID Argument2, + IN struct _HW_INITIALIZATION_DATA *HwInitializationData, + IN PVOID HwContext) { PDRIVER_OBJECT DriverObject = (PDRIVER_OBJECT)Argument1; PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2; @@ -1227,463 +1200,435 @@ CreatePortConfig: HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE)); } - /* Search for matching PCI device */ - if ((HwInitializationData->AdapterInterfaceType == PCIBus) && - (HwInitializationData->VendorIdLength > 0) && - (HwInitializationData->VendorId != NULL) && - (HwInitializationData->DeviceIdLength > 0) && - (HwInitializationData->DeviceId != NULL)) - { - PortConfig->BusInterruptLevel = 0; - - /* Get PCI device data */ - DPRINT("VendorId '%.*s' DeviceId '%.*s'\n", - HwInitializationData->VendorIdLength, - HwInitializationData->VendorId, - HwInitializationData->DeviceIdLength, - HwInitializationData->DeviceId); - - if (!SpiGetPciConfigData(DriverObject, - PortDeviceObject, - HwInitializationData, - PortConfig, - RegistryPath, - ConfigInfo.BusNumber, - &SlotNumber)) - { - /* Continue to the next bus, nothing here */ - ConfigInfo.BusNumber++; - DeviceExtension->PortConfig = NULL; - ExFreePool(PortConfig); - Again = FALSE; - goto CreatePortConfig; - } + /* Search for matching PCI device */ + if ((HwInitializationData->AdapterInterfaceType == PCIBus) && + (HwInitializationData->VendorIdLength > 0) && + (HwInitializationData->VendorId != NULL) && + (HwInitializationData->DeviceIdLength > 0) && (HwInitializationData->DeviceId != NULL)) + { + PortConfig->BusInterruptLevel = 0; - if (!PortConfig->BusInterruptLevel) - { - /* Bypass this slot, because no interrupt was assigned */ - DeviceExtension->PortConfig = NULL; - ExFreePool(PortConfig); - goto CreatePortConfig; - } - } - else - { - DPRINT("Non-pci bus\n"); - } - - /* Note: HwFindAdapter is called once for each bus */ - Again = FALSE; - DPRINT("Calling HwFindAdapter() for Bus %lu\n", PortConfig->SystemIoBusNumber); - Result = (HwInitializationData->HwFindAdapter)(&DeviceExtension->MiniPortDeviceExtension, - HwContext, - 0, /* BusInformation */ - ConfigInfo.Parameter, /* ArgumentString */ - PortConfig, - &Again); - - DPRINT("HwFindAdapter() Result: %lu Again: %s\n", - Result, (Again) ? "True" : "False"); - - /* Free MapRegisterBase, it's not needed anymore */ - if (DeviceExtension->MapRegisterBase != NULL) - { - ExFreePool(DeviceExtension->MapRegisterBase); - DeviceExtension->MapRegisterBase = NULL; - } - - /* If result is nothing good... */ - if (Result != SP_RETURN_FOUND) - { - DPRINT("HwFindAdapter() Result: %lu\n", Result); - - if (Result == SP_RETURN_NOT_FOUND) - { - /* We can continue on the next bus */ - ConfigInfo.BusNumber++; - Again = FALSE; + /* Get PCI device data */ + DPRINT( + "VendorId '%.*s' DeviceId '%.*s'\n", HwInitializationData->VendorIdLength, + HwInitializationData->VendorId, HwInitializationData->DeviceIdLength, + HwInitializationData->DeviceId); - DeviceExtension->PortConfig = NULL; - ExFreePool(PortConfig); - goto CreatePortConfig; - } + if (!SpiGetPciConfigData( + DriverObject, PortDeviceObject, HwInitializationData, PortConfig, RegistryPath, + ConfigInfo.BusNumber, &SlotNumber)) + { + /* Continue to the next bus, nothing here */ + ConfigInfo.BusNumber++; + DeviceExtension->PortConfig = NULL; + ExFreePool(PortConfig); + Again = FALSE; + goto CreatePortConfig; + } - /* Otherwise, break */ - Status = STATUS_INTERNAL_ERROR; - break; - } - - DPRINT("ScsiPortInitialize(): Found HBA! (%x), adapter Id %d\n", - PortConfig->BusInterruptVector, PortConfig->InitiatorBusId[0]); - - /* If the SRB extension size was updated */ - if (!DeviceExtension->NonCachedExtension && - (PortConfig->SrbExtensionSize != DeviceExtension->SrbExtensionSize)) - { - /* Set it (rounding to LONGLONG again) */ - DeviceExtension->SrbExtensionSize = - (PortConfig->SrbExtensionSize + - sizeof(LONGLONG)) & ~(sizeof(LONGLONG) - 1); - } - - /* The same with LUN extension size */ - if (PortConfig->SpecificLuExtensionSize != DeviceExtension->LunExtensionSize) - DeviceExtension->LunExtensionSize = PortConfig->SpecificLuExtensionSize; - - - if (!((HwInitializationData->AdapterInterfaceType == PCIBus) && - (HwInitializationData->VendorIdLength > 0) && - (HwInitializationData->VendorId != NULL) && - (HwInitializationData->DeviceIdLength > 0) && - (HwInitializationData->DeviceId != NULL))) - { - /* Construct a resource list */ - ResourceList = SpiConfigToResource(DeviceExtension, - PortConfig); - - if (ResourceList) - { - UNICODE_STRING UnicodeString; - RtlInitUnicodeString(&UnicodeString, L"ScsiAdapter"); - DPRINT("Reporting resources\n"); - Status = IoReportResourceUsage(&UnicodeString, - DriverObject, - NULL, - 0, - PortDeviceObject, - ResourceList, - FIELD_OFFSET(CM_RESOURCE_LIST, - List[0].PartialResourceList.PartialDescriptors) + - ResourceList->List[0].PartialResourceList.Count - * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), - FALSE, - &Conflict); - ExFreePool(ResourceList); - - /* In case of a failure or a conflict, break */ - if (Conflict || (!NT_SUCCESS(Status))) - { - if (Conflict) - Status = STATUS_CONFLICTING_ADDRESSES; - break; - } + if (!PortConfig->BusInterruptLevel) + { + /* Bypass this slot, because no interrupt was assigned */ + DeviceExtension->PortConfig = NULL; + ExFreePool(PortConfig); + goto CreatePortConfig; } - } - - /* Reset the Conflict var */ - Conflict = FALSE; - - /* Copy all stuff which we ever need from PortConfig to the DeviceExtension */ - if (PortConfig->MaximumNumberOfTargets > SCSI_MAXIMUM_TARGETS_PER_BUS) - DeviceExtension->MaxTargedIds = SCSI_MAXIMUM_TARGETS_PER_BUS; - else - DeviceExtension->MaxTargedIds = PortConfig->MaximumNumberOfTargets; - - DeviceExtension->BusNum = PortConfig->NumberOfBuses; - DeviceExtension->CachesData = PortConfig->CachesData; - DeviceExtension->ReceiveEvent = PortConfig->ReceiveEvent; - DeviceExtension->SupportsTaggedQueuing = PortConfig->TaggedQueuing; - DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu; - - /* If something was disabled via registry - apply it */ - if (ConfigInfo.DisableMultipleLun) - DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu = FALSE; - - if (ConfigInfo.DisableTaggedQueueing) - DeviceExtension->SupportsTaggedQueuing = PortConfig->MultipleRequestPerLu = FALSE; - - /* Check if we need to alloc SRB data */ - if (DeviceExtension->SupportsTaggedQueuing || - DeviceExtension->MultipleReqsPerLun) - { - DeviceExtension->NeedSrbDataAlloc = TRUE; - } - else - { - DeviceExtension->NeedSrbDataAlloc = FALSE; - } - - /* Get a pointer to the port capabilities */ - PortCapabilities = &DeviceExtension->PortCapabilities; - - /* Copy one field there */ - DeviceExtension->MapBuffers = PortConfig->MapBuffers; - PortCapabilities->AdapterUsesPio = PortConfig->MapBuffers; - - if (DeviceExtension->AdapterObject == NULL && - (PortConfig->DmaChannel != SP_UNINITIALIZED_VALUE || PortConfig->Master)) - { - DPRINT1("DMA is not supported yet\n"); - ASSERT(FALSE); - } - - if (DeviceExtension->SrbExtensionBuffer == NULL && - (DeviceExtension->SrbExtensionSize != 0 || - PortConfig->AutoRequestSense)) - { - DeviceExtension->SupportsAutoSense = PortConfig->AutoRequestSense; - DeviceExtension->NeedSrbExtensionAlloc = TRUE; - - /* Allocate common buffer */ - Status = SpiAllocateCommonBuffer(DeviceExtension, 0); - - /* Check for failure */ - if (!NT_SUCCESS(Status)) - break; - } - - /* Allocate SrbData, if needed */ - if (DeviceExtension->NeedSrbDataAlloc) - { - ULONG Count; - PSCSI_REQUEST_BLOCK_INFO SrbData; - - if (DeviceExtension->SrbDataCount != 0) - Count = DeviceExtension->SrbDataCount; - else - Count = DeviceExtension->RequestsNumber * 2; - - /* Allocate the data */ - SrbData = ExAllocatePoolWithTag(NonPagedPool, Count * sizeof(SCSI_REQUEST_BLOCK_INFO), TAG_SCSIPORT); - if (SrbData == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - RtlZeroMemory(SrbData, Count * sizeof(SCSI_REQUEST_BLOCK_INFO)); - - DeviceExtension->SrbInfo = SrbData; - DeviceExtension->FreeSrbInfo = SrbData; - DeviceExtension->SrbDataCount = Count; - - /* Link it to the list */ - while (Count > 0) - { - SrbData->Requests.Flink = (PLIST_ENTRY)(SrbData + 1); - SrbData++; - Count--; - } + } + else + { + DPRINT("Non-pci bus\n"); + } - /* Mark the last entry of the list */ - SrbData--; - SrbData->Requests.Flink = NULL; - } + /* Note: HwFindAdapter is called once for each bus */ + Again = FALSE; + DPRINT("Calling HwFindAdapter() for Bus %lu\n", PortConfig->SystemIoBusNumber); + Result = (HwInitializationData->HwFindAdapter)( + &DeviceExtension->MiniPortDeviceExtension, HwContext, 0, /* BusInformation */ + ConfigInfo.Parameter, /* ArgumentString */ + PortConfig, &Again); - /* Initialize port capabilities */ - PortCapabilities = &DeviceExtension->PortCapabilities; - PortCapabilities->Length = sizeof(IO_SCSI_CAPABILITIES); - PortCapabilities->MaximumTransferLength = PortConfig->MaximumTransferLength; + DPRINT("HwFindAdapter() Result: %lu Again: %s\n", Result, (Again) ? "True" : "False"); - if (PortConfig->ReceiveEvent) - PortCapabilities->SupportedAsynchronousEvents |= SRBEV_SCSI_ASYNC_NOTIFICATION; + /* Free MapRegisterBase, it's not needed anymore */ + if (DeviceExtension->MapRegisterBase != NULL) + { + ExFreePool(DeviceExtension->MapRegisterBase); + DeviceExtension->MapRegisterBase = NULL; + } - PortCapabilities->TaggedQueuing = DeviceExtension->SupportsTaggedQueuing; - PortCapabilities->AdapterScansDown = PortConfig->AdapterScansDown; + /* If result is nothing good... */ + if (Result != SP_RETURN_FOUND) + { + DPRINT("HwFindAdapter() Result: %lu\n", Result); - if (PortConfig->AlignmentMask > PortDeviceObject->AlignmentRequirement) - PortDeviceObject->AlignmentRequirement = PortConfig->AlignmentMask; + if (Result == SP_RETURN_NOT_FOUND) + { + /* We can continue on the next bus */ + ConfigInfo.BusNumber++; + Again = FALSE; - PortCapabilities->AlignmentMask = PortDeviceObject->AlignmentRequirement; + DeviceExtension->PortConfig = NULL; + ExFreePool(PortConfig); + goto CreatePortConfig; + } - if (PortCapabilities->MaximumPhysicalPages == 0) - { - PortCapabilities->MaximumPhysicalPages = - BYTES_TO_PAGES(PortCapabilities->MaximumTransferLength); + /* Otherwise, break */ + Status = STATUS_INTERNAL_ERROR; + break; + } - /* Apply miniport's limits */ - if (PortConfig->NumberOfPhysicalBreaks < PortCapabilities->MaximumPhysicalPages) - { - PortCapabilities->MaximumPhysicalPages = PortConfig->NumberOfPhysicalBreaks; - } - } + DPRINT( + "ScsiPortInitialize(): Found HBA! (%x), adapter Id %d\n", + PortConfig->BusInterruptVector, PortConfig->InitiatorBusId[0]); - /* Deal with interrupts */ - if (DeviceExtension->HwInterrupt == NULL || - (PortConfig->BusInterruptLevel == 0 && PortConfig->BusInterruptVector == 0)) - { - /* No interrupts */ - DeviceExtension->InterruptCount = 0; + /* If the SRB extension size was updated */ + if (!DeviceExtension->NonCachedExtension && + (PortConfig->SrbExtensionSize != DeviceExtension->SrbExtensionSize)) + { + /* Set it (rounding to LONGLONG again) */ + DeviceExtension->SrbExtensionSize = + (PortConfig->SrbExtensionSize + sizeof(LONGLONG)) & ~(sizeof(LONGLONG) - 1); + } - DPRINT1("Interrupt Count: 0\n"); + /* The same with LUN extension size */ + if (PortConfig->SpecificLuExtensionSize != DeviceExtension->LunExtensionSize) + DeviceExtension->LunExtensionSize = PortConfig->SpecificLuExtensionSize; - UNIMPLEMENTED; + if (!((HwInitializationData->AdapterInterfaceType == PCIBus) && + (HwInitializationData->VendorIdLength > 0) && + (HwInitializationData->VendorId != NULL) && + (HwInitializationData->DeviceIdLength > 0) && + (HwInitializationData->DeviceId != NULL))) + { + /* Construct a resource list */ + ResourceList = SpiConfigToResource(DeviceExtension, PortConfig); - /* This code path will ALWAYS crash so stop it now */ - while(TRUE); - } - else - { - BOOLEAN InterruptShareable; - KINTERRUPT_MODE InterruptMode[2]; - ULONG InterruptVector[2], i, MappedIrq[2]; - KIRQL Dirql[2], MaxDirql; - KAFFINITY Affinity[2]; + if (ResourceList) + { + UNICODE_STRING UnicodeString; + RtlInitUnicodeString(&UnicodeString, L"ScsiAdapter"); + DPRINT("Reporting resources\n"); + Status = IoReportResourceUsage(&UnicodeString, + DriverObject, + NULL, + 0, + PortDeviceObject, + ResourceList, + FIELD_OFFSET(CM_RESOURCE_LIST, + List[0].PartialResourceList.PartialDescriptors) + + ResourceList->List[0].PartialResourceList.Count * + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR), + FALSE, + &Conflict); + ExFreePool(ResourceList); + + /* In case of a failure or a conflict, break */ + if (Conflict || (!NT_SUCCESS(Status))) + { + if (Conflict) + Status = STATUS_CONFLICTING_ADDRESSES; + break; + } + } + } - DeviceExtension->InterruptLevel[0] = PortConfig->BusInterruptLevel; - DeviceExtension->InterruptLevel[1] = PortConfig->BusInterruptLevel2; + /* Reset the Conflict var */ + Conflict = FALSE; - InterruptVector[0] = PortConfig->BusInterruptVector; - InterruptVector[1] = PortConfig->BusInterruptVector2; + /* Copy all stuff which we ever need from PortConfig to the DeviceExtension */ + if (PortConfig->MaximumNumberOfTargets > SCSI_MAXIMUM_TARGETS_PER_BUS) + DeviceExtension->MaxTargedIds = SCSI_MAXIMUM_TARGETS_PER_BUS; + else + DeviceExtension->MaxTargedIds = PortConfig->MaximumNumberOfTargets; - InterruptMode[0] = PortConfig->InterruptMode; - InterruptMode[1] = PortConfig->InterruptMode2; + DeviceExtension->BusNum = PortConfig->NumberOfBuses; + DeviceExtension->CachesData = PortConfig->CachesData; + DeviceExtension->ReceiveEvent = PortConfig->ReceiveEvent; + DeviceExtension->SupportsTaggedQueuing = PortConfig->TaggedQueuing; + DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu; - DeviceExtension->InterruptCount = (PortConfig->BusInterruptLevel2 != 0 || PortConfig->BusInterruptVector2 != 0) ? 2 : 1; + /* If something was disabled via registry - apply it */ + if (ConfigInfo.DisableMultipleLun) + DeviceExtension->MultipleReqsPerLun = PortConfig->MultipleRequestPerLu = FALSE; - for (i = 0; i < DeviceExtension->InterruptCount; i++) - { - /* Register an interrupt handler for this device */ - MappedIrq[i] = HalGetInterruptVector(PortConfig->AdapterInterfaceType, - PortConfig->SystemIoBusNumber, - DeviceExtension->InterruptLevel[i], - InterruptVector[i], - &Dirql[i], - &Affinity[i]); - } + if (ConfigInfo.DisableTaggedQueueing) + DeviceExtension->SupportsTaggedQueuing = PortConfig->MultipleRequestPerLu = FALSE; - if (DeviceExtension->InterruptCount == 1 || Dirql[0] > Dirql[1]) - MaxDirql = Dirql[0]; - else - MaxDirql = Dirql[1]; + /* Check if we need to alloc SRB data */ + if (DeviceExtension->SupportsTaggedQueuing || DeviceExtension->MultipleReqsPerLun) + { + DeviceExtension->NeedSrbDataAlloc = TRUE; + } + else + { + DeviceExtension->NeedSrbDataAlloc = FALSE; + } - for (i = 0; i < DeviceExtension->InterruptCount; i++) - { - /* Determine IRQ sharability as usual */ - if (PortConfig->AdapterInterfaceType == MicroChannel || - InterruptMode[i] == LevelSensitive) - { - InterruptShareable = TRUE; - } - else - { - InterruptShareable = FALSE; - } - - Status = IoConnectInterrupt(&DeviceExtension->Interrupt[i], - (PKSERVICE_ROUTINE)ScsiPortIsr, - DeviceExtension, - &DeviceExtension->IrqLock, - MappedIrq[i], - Dirql[i], - MaxDirql, - InterruptMode[i], - InterruptShareable, - Affinity[i], - FALSE); - - if (!(NT_SUCCESS(Status))) - { - DPRINT1("Could not connect interrupt %d\n", - InterruptVector[i]); - DeviceExtension->Interrupt[i] = NULL; - break; - } - } + /* Get a pointer to the port capabilities */ + PortCapabilities = &DeviceExtension->PortCapabilities; - if (!NT_SUCCESS(Status)) - break; - } - - /* Save IoAddress (from access ranges) */ - if (HwInitializationData->NumberOfAccessRanges != 0) - { - DeviceExtension->IoAddress = - ((*(PortConfig->AccessRanges))[0]).RangeStart.LowPart; - - DPRINT("Io Address %x\n", DeviceExtension->IoAddress); - } - - /* Set flag that it's allowed to disconnect during this command */ - DeviceExtension->Flags |= SCSI_PORT_DISCONNECT_ALLOWED; - - /* Initialize counter of active requests (-1 means there are none) */ - DeviceExtension->ActiveRequestCounter = -1; - - /* Analyze what we have about DMA */ - if (DeviceExtension->AdapterObject != NULL && - PortConfig->Master && - PortConfig->NeedPhysicalAddresses) - { - DeviceExtension->MapRegisters = TRUE; - } - else - { - DeviceExtension->MapRegisters = FALSE; - } - - /* Call HwInitialize at DISPATCH_LEVEL */ - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - - if (!KeSynchronizeExecution(DeviceExtension->Interrupt[0], - DeviceExtension->HwInitialize, - DeviceExtension->MiniPortDeviceExtension)) - { - DPRINT1("HwInitialize() failed!\n"); - KeLowerIrql(OldIrql); - Status = STATUS_ADAPTER_HARDWARE_ERROR; - break; - } - - /* Check if a notification is needed */ - if (DeviceExtension->InterruptData.Flags & SCSI_PORT_NOTIFICATION_NEEDED) - { - /* Call DPC right away, because we're already at DISPATCH_LEVEL */ - ScsiPortDpcForIsr(NULL, - DeviceExtension->DeviceObject, - NULL, - NULL); - } - - /* Lower irql back to what it was */ - KeLowerIrql(OldIrql); - - /* Start our timer */ - IoStartTimer(PortDeviceObject); - - /* Initialize bus scanning information */ - BusConfigSize = FIELD_OFFSET(BUSES_CONFIGURATION_INFORMATION, - BusScanInfo[DeviceExtension->PortConfig->NumberOfBuses]); - DeviceExtension->BusesConfig = ExAllocatePoolWithTag(PagedPool, - BusConfigSize, - TAG_SCSIPORT); - if (!DeviceExtension->BusesConfig) - { - DPRINT1("Out of resources!\n"); - Status = STATUS_INSUFFICIENT_RESOURCES; - break; - } + /* Copy one field there */ + DeviceExtension->MapBuffers = PortConfig->MapBuffers; + PortCapabilities->AdapterUsesPio = PortConfig->MapBuffers; + + if (DeviceExtension->AdapterObject == NULL && + (PortConfig->DmaChannel != SP_UNINITIALIZED_VALUE || PortConfig->Master)) + { + DPRINT1("DMA is not supported yet\n"); + ASSERT(FALSE); + } + + if (DeviceExtension->SrbExtensionBuffer == NULL && + (DeviceExtension->SrbExtensionSize != 0 || PortConfig->AutoRequestSense)) + { + DeviceExtension->SupportsAutoSense = PortConfig->AutoRequestSense; + DeviceExtension->NeedSrbExtensionAlloc = TRUE; + + /* Allocate common buffer */ + Status = SpiAllocateCommonBuffer(DeviceExtension, 0); + + /* Check for failure */ + if (!NT_SUCCESS(Status)) + break; + } + + /* Allocate SrbData, if needed */ + if (DeviceExtension->NeedSrbDataAlloc) + { + ULONG Count; + PSCSI_REQUEST_BLOCK_INFO SrbData; + + if (DeviceExtension->SrbDataCount != 0) + Count = DeviceExtension->SrbDataCount; + else + Count = DeviceExtension->RequestsNumber * 2; + + /* Allocate the data */ + SrbData = ExAllocatePoolWithTag( + NonPagedPool, Count * sizeof(SCSI_REQUEST_BLOCK_INFO), TAG_SCSIPORT); + if (SrbData == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + RtlZeroMemory(SrbData, Count * sizeof(SCSI_REQUEST_BLOCK_INFO)); + + DeviceExtension->SrbInfo = SrbData; + DeviceExtension->FreeSrbInfo = SrbData; + DeviceExtension->SrbDataCount = Count; + + /* Link it to the list */ + while (Count > 0) + { + SrbData->Requests.Flink = (PLIST_ENTRY)(SrbData + 1); + SrbData++; + Count--; + } + + /* Mark the last entry of the list */ + SrbData--; + SrbData->Requests.Flink = NULL; + } + + /* Initialize port capabilities */ + PortCapabilities = &DeviceExtension->PortCapabilities; + PortCapabilities->Length = sizeof(IO_SCSI_CAPABILITIES); + PortCapabilities->MaximumTransferLength = PortConfig->MaximumTransferLength; + + if (PortConfig->ReceiveEvent) + PortCapabilities->SupportedAsynchronousEvents |= SRBEV_SCSI_ASYNC_NOTIFICATION; + + PortCapabilities->TaggedQueuing = DeviceExtension->SupportsTaggedQueuing; + PortCapabilities->AdapterScansDown = PortConfig->AdapterScansDown; + + if (PortConfig->AlignmentMask > PortDeviceObject->AlignmentRequirement) + PortDeviceObject->AlignmentRequirement = PortConfig->AlignmentMask; + + PortCapabilities->AlignmentMask = PortDeviceObject->AlignmentRequirement; + + if (PortCapabilities->MaximumPhysicalPages == 0) + { + PortCapabilities->MaximumPhysicalPages = + BYTES_TO_PAGES(PortCapabilities->MaximumTransferLength); + + /* Apply miniport's limits */ + if (PortConfig->NumberOfPhysicalBreaks < PortCapabilities->MaximumPhysicalPages) + { + PortCapabilities->MaximumPhysicalPages = PortConfig->NumberOfPhysicalBreaks; + } + } + + /* Deal with interrupts */ + if (DeviceExtension->HwInterrupt == NULL || + (PortConfig->BusInterruptLevel == 0 && PortConfig->BusInterruptVector == 0)) + { + /* No interrupts */ + DeviceExtension->InterruptCount = 0; + + DPRINT1("Interrupt Count: 0\n"); + + UNIMPLEMENTED; + + /* This code path will ALWAYS crash so stop it now */ + while (TRUE); + } + else + { + BOOLEAN InterruptShareable; + KINTERRUPT_MODE InterruptMode[2]; + ULONG InterruptVector[2], i, MappedIrq[2]; + KIRQL Dirql[2], MaxDirql; + KAFFINITY Affinity[2]; + + DeviceExtension->InterruptLevel[0] = PortConfig->BusInterruptLevel; + DeviceExtension->InterruptLevel[1] = PortConfig->BusInterruptLevel2; + + InterruptVector[0] = PortConfig->BusInterruptVector; + InterruptVector[1] = PortConfig->BusInterruptVector2; + + InterruptMode[0] = PortConfig->InterruptMode; + InterruptMode[1] = PortConfig->InterruptMode2; + + DeviceExtension->InterruptCount = + (PortConfig->BusInterruptLevel2 != 0 || + PortConfig->BusInterruptVector2 != 0) ? 2 : 1; + + for (i = 0; i < DeviceExtension->InterruptCount; i++) + { + /* Register an interrupt handler for this device */ + MappedIrq[i] = HalGetInterruptVector( + PortConfig->AdapterInterfaceType, PortConfig->SystemIoBusNumber, + DeviceExtension->InterruptLevel[i], InterruptVector[i], &Dirql[i], + &Affinity[i]); + } + + if (DeviceExtension->InterruptCount == 1 || Dirql[0] > Dirql[1]) + MaxDirql = Dirql[0]; + else + MaxDirql = Dirql[1]; + + for (i = 0; i < DeviceExtension->InterruptCount; i++) + { + /* Determine IRQ sharability as usual */ + if (PortConfig->AdapterInterfaceType == MicroChannel || + InterruptMode[i] == LevelSensitive) + { + InterruptShareable = TRUE; + } + else + { + InterruptShareable = FALSE; + } + + Status = IoConnectInterrupt( + &DeviceExtension->Interrupt[i], (PKSERVICE_ROUTINE)ScsiPortIsr, DeviceExtension, + &DeviceExtension->IrqLock, MappedIrq[i], Dirql[i], MaxDirql, InterruptMode[i], + InterruptShareable, Affinity[i], FALSE); + + if (!(NT_SUCCESS(Status))) + { + DPRINT1("Could not connect interrupt %d\n", InterruptVector[i]); + DeviceExtension->Interrupt[i] = NULL; + break; + } + } + + if (!NT_SUCCESS(Status)) + break; + } + + /* Save IoAddress (from access ranges) */ + if (HwInitializationData->NumberOfAccessRanges != 0) + { + DeviceExtension->IoAddress = ((*(PortConfig->AccessRanges))[0]).RangeStart.LowPart; + + DPRINT("Io Address %x\n", DeviceExtension->IoAddress); + } + + /* Set flag that it's allowed to disconnect during this command */ + DeviceExtension->Flags |= SCSI_PORT_DISCONNECT_ALLOWED; + + /* Initialize counter of active requests (-1 means there are none) */ + DeviceExtension->ActiveRequestCounter = -1; + + /* Analyze what we have about DMA */ + if (DeviceExtension->AdapterObject != NULL && PortConfig->Master && + PortConfig->NeedPhysicalAddresses) + { + DeviceExtension->MapRegisters = TRUE; + } + else + { + DeviceExtension->MapRegisters = FALSE; + } + + /* Call HwInitialize at DISPATCH_LEVEL */ + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + + if (!KeSynchronizeExecution( + DeviceExtension->Interrupt[0], DeviceExtension->HwInitialize, + DeviceExtension->MiniPortDeviceExtension)) + { + DPRINT1("HwInitialize() failed!\n"); + KeLowerIrql(OldIrql); + Status = STATUS_ADAPTER_HARDWARE_ERROR; + break; + } + + /* Check if a notification is needed */ + if (DeviceExtension->InterruptData.Flags & SCSI_PORT_NOTIFICATION_NEEDED) + { + /* Call DPC right away, because we're already at DISPATCH_LEVEL */ + ScsiPortDpcForIsr(NULL, DeviceExtension->DeviceObject, NULL, NULL); + } + + /* Lower irql back to what it was */ + KeLowerIrql(OldIrql); + + /* Start our timer */ + IoStartTimer(PortDeviceObject); + + /* Initialize bus scanning information */ + BusConfigSize = FIELD_OFFSET( + BUSES_CONFIGURATION_INFORMATION, + BusScanInfo[DeviceExtension->PortConfig->NumberOfBuses]); + DeviceExtension->BusesConfig = + ExAllocatePoolWithTag(PagedPool, BusConfigSize, TAG_SCSIPORT); + if (!DeviceExtension->BusesConfig) + { + DPRINT1("Out of resources!\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } - /* Zero it */ - RtlZeroMemory(DeviceExtension->BusesConfig, BusConfigSize); + /* Zero it */ + RtlZeroMemory(DeviceExtension->BusesConfig, BusConfigSize); - /* Store number of buses there */ - DeviceExtension->BusesConfig->NumberOfBuses = (UCHAR)DeviceExtension->BusNum; + /* Store number of buses there */ + DeviceExtension->BusesConfig->NumberOfBuses = (UCHAR)DeviceExtension->BusNum; - /* Scan the adapter for devices */ - SpiScanAdapter(DeviceExtension); + /* Scan the adapter for devices */ + SpiScanAdapter(DeviceExtension); - /* Build the registry device map */ - SpiBuildDeviceMap(DeviceExtension, - (PUNICODE_STRING)Argument2); + /* Build the registry device map */ + SpiBuildDeviceMap(DeviceExtension, (PUNICODE_STRING)Argument2); - /* Create the dos device link */ - swprintf(DosNameBuffer, - L"\\??\\Scsi%lu:", - SystemConfig->ScsiPortCount); - RtlInitUnicodeString(&DosDeviceName, DosNameBuffer); - IoCreateSymbolicLink(&DosDeviceName, &DeviceName); + /* Create the dos device link */ + swprintf(DosNameBuffer, L"\\??\\Scsi%lu:", SystemConfig->ScsiPortCount); + RtlInitUnicodeString(&DosDeviceName, DosNameBuffer); + IoCreateSymbolicLink(&DosDeviceName, &DeviceName); - /* Increase the port count */ - SystemConfig->ScsiPortCount++; - FirstConfigCall = FALSE; + /* Increase the port count */ + SystemConfig->ScsiPortCount++; + FirstConfigCall = FALSE; - /* Increase adapter number and bus number respectively */ - ConfigInfo.AdapterNumber++; + /* Increase adapter number and bus number respectively */ + ConfigInfo.AdapterNumber++; - if (!Again) - ConfigInfo.BusNumber++; + if (!Again) + ConfigInfo.BusNumber++; - DPRINT("Bus: %lu MaxBus: %lu\n", ConfigInfo.BusNumber, MaxBus); + DPRINT("Bus: %lu MaxBus: %lu\n", ConfigInfo.BusNumber, MaxBus); - DeviceFound = TRUE; + DeviceFound = TRUE; } /* Clean up the mess */ @@ -1816,9 +1761,9 @@ SpiCleanupAfterInit(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension) */ VOID NTAPI ScsiPortIoMapTransfer(IN PVOID HwDeviceExtension, - IN PSCSI_REQUEST_BLOCK Srb, - IN PVOID LogicalAddress, - IN ULONG Length) + IN PSCSI_REQUEST_BLOCK Srb, + IN PVOID LogicalAddress, + IN ULONG Length) { DPRINT1("ScsiPortIoMapTransfer()\n"); UNIMPLEMENTED; @@ -1829,12 +1774,12 @@ ScsiPortIoMapTransfer(IN PVOID HwDeviceExtension, */ VOID NTAPI ScsiPortLogError(IN PVOID HwDeviceExtension, - IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, - IN UCHAR PathId, - IN UCHAR TargetId, - IN UCHAR Lun, - IN ULONG ErrorCode, - IN ULONG UniqueId) + IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun, + IN ULONG ErrorCode, + IN ULONG UniqueId) { //PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; @@ -1853,12 +1798,12 @@ ScsiPortLogError(IN PVOID HwDeviceExtension, */ VOID NTAPI ScsiPortMoveMemory(OUT PVOID Destination, - IN PVOID Source, - IN ULONG Length) + IN PVOID Source, + IN ULONG Length) { RtlMoveMemory(Destination, - Source, - Length); + Source, + Length); } @@ -1866,18 +1811,15 @@ ScsiPortMoveMemory(OUT PVOID Destination, * @implemented */ VOID -ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, - IN PVOID HwDeviceExtension, - ...) +ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, IN PVOID HwDeviceExtension, ...) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; va_list ap; DPRINT("ScsiPortNotification() called\n"); - DeviceExtension = CONTAINING_RECORD(HwDeviceExtension, - SCSI_PORT_DEVICE_EXTENSION, - MiniPortDeviceExtension); + DeviceExtension = + CONTAINING_RECORD(HwDeviceExtension, SCSI_PORT_DEVICE_EXTENSION, MiniPortDeviceExtension); DPRINT("DeviceExtension %p\n", DeviceExtension); @@ -1885,18 +1827,20 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, switch (NotificationType) { - case RequestComplete: + case RequestComplete: { PSCSI_REQUEST_BLOCK Srb; PSCSI_REQUEST_BLOCK_INFO SrbData; - Srb = (PSCSI_REQUEST_BLOCK) va_arg (ap, PSCSI_REQUEST_BLOCK); + Srb = (PSCSI_REQUEST_BLOCK)va_arg(ap, PSCSI_REQUEST_BLOCK); DPRINT("Notify: RequestComplete (Srb %p)\n", Srb); /* Make sure Srb is alright */ ASSERT(Srb->SrbStatus != SRB_STATUS_PENDING); - ASSERT(Srb->Function != SRB_FUNCTION_EXECUTE_SCSI || Srb->SrbStatus != SRB_STATUS_SUCCESS || Srb->ScsiStatus == SCSISTAT_GOOD); + ASSERT( + Srb->Function != SRB_FUNCTION_EXECUTE_SCSI || + Srb->SrbStatus != SRB_STATUS_SUCCESS || Srb->ScsiStatus == SCSISTAT_GOOD); if (!(Srb->SrbFlags & SRB_FLAGS_IS_ACTIVE)) { @@ -1916,11 +1860,8 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, else { /* Get the SRB data */ - SrbData = SpiGetSrbData(DeviceExtension, - Srb->PathId, - Srb->TargetId, - Srb->Lun, - Srb->QueueTag); + SrbData = SpiGetSrbData( + DeviceExtension, Srb->PathId, Srb->TargetId, Srb->Lun, Srb->QueueTag); /* Make sure there are no CompletedRequests and there is a Srb */ ASSERT(SrbData->CompletedRequests == NULL && SrbData->Srb != NULL); @@ -1929,7 +1870,7 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, if ((Srb->SrbStatus == SRB_STATUS_SUCCESS) && ((Srb->Cdb[0] == SCSIOP_READ) || (Srb->Cdb[0] == SCSIOP_WRITE))) { - ASSERT(Srb->DataTransferLength); + ASSERT(Srb->DataTransferLength); } SrbData->CompletedRequests = DeviceExtension->InterruptData.CompletedRequests; @@ -1938,40 +1879,37 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, } break; - case NextRequest: - DPRINT("Notify: NextRequest\n"); - DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY; - break; + case NextRequest: + DPRINT("Notify: NextRequest\n"); + DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY; + break; - case NextLuRequest: + case NextLuRequest: { UCHAR PathId; UCHAR TargetId; UCHAR Lun; PSCSI_PORT_LUN_EXTENSION LunExtension; - PathId = (UCHAR) va_arg (ap, int); - TargetId = (UCHAR) va_arg (ap, int); - Lun = (UCHAR) va_arg (ap, int); + PathId = (UCHAR)va_arg(ap, int); + TargetId = (UCHAR)va_arg(ap, int); + Lun = (UCHAR)va_arg(ap, int); - DPRINT("Notify: NextLuRequest(PathId %u TargetId %u Lun %u)\n", - PathId, TargetId, Lun); + DPRINT( + "Notify: NextLuRequest(PathId %u TargetId %u Lun %u)\n", PathId, TargetId, Lun); /* Mark it in the flags field */ DeviceExtension->InterruptData.Flags |= SCSI_PORT_NEXT_REQUEST_READY; /* Get the LUN extension */ - LunExtension = SpiGetLunExtension(DeviceExtension, - PathId, - TargetId, - Lun); + LunExtension = SpiGetLunExtension(DeviceExtension, PathId, TargetId, Lun); /* If returned LunExtension is NULL, break out */ - if (!LunExtension) break; + if (!LunExtension) + break; /* This request should not be processed if */ - if ((LunExtension->ReadyLun) || - (LunExtension->SrbInfo.Srb)) + if ((LunExtension->ReadyLun) || (LunExtension->SrbInfo.Srb)) { /* Nothing to do here */ break; @@ -1980,38 +1918,37 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, /* Add this LUN to the list */ LunExtension->ReadyLun = DeviceExtension->InterruptData.ReadyLun; DeviceExtension->InterruptData.ReadyLun = LunExtension; - } - break; + } + break; - case ResetDetected: - DPRINT("Notify: ResetDetected\n"); - /* Add RESET flags */ - DeviceExtension->InterruptData.Flags |= - SCSI_PORT_RESET | SCSI_PORT_RESET_REPORTED; - break; + case ResetDetected: + DPRINT("Notify: ResetDetected\n"); + /* Add RESET flags */ + DeviceExtension->InterruptData.Flags |= SCSI_PORT_RESET | SCSI_PORT_RESET_REPORTED; + break; - case CallDisableInterrupts: - DPRINT1("UNIMPLEMENTED SCSI Notification called: CallDisableInterrupts!\n"); - break; + case CallDisableInterrupts: + DPRINT1("UNIMPLEMENTED SCSI Notification called: CallDisableInterrupts!\n"); + break; - case CallEnableInterrupts: - DPRINT1("UNIMPLEMENTED SCSI Notification called: CallEnableInterrupts!\n"); - break; + case CallEnableInterrupts: + DPRINT1("UNIMPLEMENTED SCSI Notification called: CallEnableInterrupts!\n"); + break; - case RequestTimerCall: - DPRINT("Notify: RequestTimerCall\n"); - DeviceExtension->InterruptData.Flags |= SCSI_PORT_TIMER_NEEDED; - DeviceExtension->InterruptData.HwScsiTimer = (PHW_TIMER)va_arg(ap, PHW_TIMER); - DeviceExtension->InterruptData.MiniportTimerValue = (ULONG)va_arg(ap, ULONG); - break; + case RequestTimerCall: + DPRINT("Notify: RequestTimerCall\n"); + DeviceExtension->InterruptData.Flags |= SCSI_PORT_TIMER_NEEDED; + DeviceExtension->InterruptData.HwScsiTimer = (PHW_TIMER)va_arg(ap, PHW_TIMER); + DeviceExtension->InterruptData.MiniportTimerValue = (ULONG)va_arg(ap, ULONG); + break; - case BusChangeDetected: - DPRINT1("UNIMPLEMENTED SCSI Notification called: BusChangeDetected!\n"); - break; + case BusChangeDetected: + DPRINT1("UNIMPLEMENTED SCSI Notification called: BusChangeDetected!\n"); + break; - default: - DPRINT1 ("Unsupported notification from WMI: %lu\n", NotificationType); - break; + default: + DPRINT1("Unsupported notification from WMI: %lu\n", NotificationType); + break; } va_end(ap); @@ -2025,11 +1962,11 @@ ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, */ BOOLEAN NTAPI ScsiPortValidateRange(IN PVOID HwDeviceExtension, - IN INTERFACE_TYPE BusType, - IN ULONG SystemIoBusNumber, - IN SCSI_PHYSICAL_ADDRESS IoAddress, - IN ULONG NumberOfBytes, - IN BOOLEAN InIoSpace) + IN INTERFACE_TYPE BusType, + IN ULONG SystemIoBusNumber, + IN SCSI_PHYSICAL_ADDRESS IoAddress, + IN ULONG NumberOfBytes, + IN BOOLEAN InIoSpace) { DPRINT("ScsiPortValidateRange()\n"); return(TRUE); @@ -2423,24 +2360,24 @@ SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject, /********************************************************************** - * NAME INTERNAL - * ScsiPortCreateClose + * NAME INTERNAL + * ScsiPortCreateClose * * DESCRIPTION - * Answer requests for Create/Close calls: a null operation. + * Answer requests for Create/Close calls: a null operation. * * RUN LEVEL - * PASSIVE_LEVEL + * PASSIVE_LEVEL * * ARGUMENTS - * DeviceObject - * Pointer to a device object. + * DeviceObject + * Pointer to a device object. * - * Irp - * Pointer to an IRP. + * Irp + * Pointer to an IRP. * * RETURN VALUE - * Status. + * Status. */ static NTSTATUS NTAPI @@ -2539,25 +2476,24 @@ SpiHandleAttachRelease(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, /********************************************************************** - * NAME INTERNAL - * ScsiPortDispatchScsi + * NAME INTERNAL + * ScsiPortDispatchScsi * * DESCRIPTION - * Answer requests for SCSI calls + * Answer requests for SCSI calls * * RUN LEVEL - * PASSIVE_LEVEL + * PASSIVE_LEVEL * * ARGUMENTS - * Standard dispatch arguments + * Standard dispatch arguments * * RETURNS - * NTSTATUS + * NTSTATUS */ static NTSTATUS NTAPI -ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) +ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PSCSI_PORT_LUN_EXTENSION LunExtension; @@ -2568,8 +2504,7 @@ ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, PIRP NextIrp, IrpList; PKDEVICE_QUEUE_ENTRY Entry; - DPRINT("ScsiPortDispatchScsi(DeviceObject %p Irp %p)\n", - DeviceObject, Irp); + DPRINT("ScsiPortDispatchScsi(DeviceObject %p Irp %p)\n", DeviceObject, Irp); DeviceExtension = DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); @@ -2585,17 +2520,14 @@ ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); + return (Status); } DPRINT("Srb: %p\n", Srb); DPRINT("Srb->Function: %lu\n", Srb->Function); DPRINT("PathId: %lu TargetId: %lu Lun: %lu\n", Srb->PathId, Srb->TargetId, Srb->Lun); - LunExtension = SpiGetLunExtension(DeviceExtension, - Srb->PathId, - Srb->TargetId, - Srb->Lun); + LunExtension = SpiGetLunExtension(DeviceExtension, Srb->PathId, Srb->TargetId, Srb->Lun); if (LunExtension == NULL) { DPRINT("ScsiPortDispatchScsi() called with an invalid LUN\n"); @@ -2607,132 +2539,131 @@ ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); + return (Status); } switch (Srb->Function) { - case SRB_FUNCTION_SHUTDOWN: - case SRB_FUNCTION_FLUSH: - DPRINT (" SRB_FUNCTION_SHUTDOWN or FLUSH\n"); - if (DeviceExtension->CachesData == FALSE) - { - /* All success here */ - Srb->SrbStatus = SRB_STATUS_SUCCESS; - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } - /* Fall through to a usual execute operation */ - - case SRB_FUNCTION_EXECUTE_SCSI: - case SRB_FUNCTION_IO_CONTROL: - DPRINT(" SRB_FUNCTION_EXECUTE_SCSI or SRB_FUNCTION_IO_CONTROL\n"); - /* Mark IRP as pending in all cases */ - IoMarkIrpPending(Irp); - - if (Srb->SrbFlags & SRB_FLAGS_BYPASS_FROZEN_QUEUE) - { - /* Start IO directly */ - IoStartPacket(DeviceObject, Irp, NULL, NULL); - } - else - { - KIRQL oldIrql; + case SRB_FUNCTION_SHUTDOWN: + case SRB_FUNCTION_FLUSH: + DPRINT(" SRB_FUNCTION_SHUTDOWN or FLUSH\n"); + if (DeviceExtension->CachesData == FALSE) + { + /* All success here */ + Srb->SrbStatus = SRB_STATUS_SUCCESS; + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + } + /* Fall through to a usual execute operation */ - /* We need to be at DISPATCH_LEVEL */ - KeRaiseIrql (DISPATCH_LEVEL, &oldIrql); + case SRB_FUNCTION_EXECUTE_SCSI: + case SRB_FUNCTION_IO_CONTROL: + DPRINT(" SRB_FUNCTION_EXECUTE_SCSI or SRB_FUNCTION_IO_CONTROL\n"); + /* Mark IRP as pending in all cases */ + IoMarkIrpPending(Irp); - /* Insert IRP into the queue */ - if (!KeInsertByKeyDeviceQueue(&LunExtension->DeviceQueue, - &Irp->Tail.Overlay.DeviceQueueEntry, - Srb->QueueSortKey)) + if (Srb->SrbFlags & SRB_FLAGS_BYPASS_FROZEN_QUEUE) { - /* It means the queue is empty, and we just start this request */ + /* Start IO directly */ IoStartPacket(DeviceObject, Irp, NULL, NULL); } + else + { + KIRQL oldIrql; - /* Back to the old IRQL */ - KeLowerIrql (oldIrql); - } - return STATUS_PENDING; + /* We need to be at DISPATCH_LEVEL */ + KeRaiseIrql(DISPATCH_LEVEL, &oldIrql); - case SRB_FUNCTION_CLAIM_DEVICE: - case SRB_FUNCTION_ATTACH_DEVICE: - DPRINT (" SRB_FUNCTION_CLAIM_DEVICE or ATTACH\n"); + /* Insert IRP into the queue */ + if (!KeInsertByKeyDeviceQueue( + &LunExtension->DeviceQueue, + &Irp->Tail.Overlay.DeviceQueueEntry, + Srb->QueueSortKey)) + { + /* It means the queue is empty, and we just start this request */ + IoStartPacket(DeviceObject, Irp, NULL, NULL); + } - /* Reference device object and keep the device object */ - Status = SpiHandleAttachRelease(DeviceExtension, Irp); - break; + /* Back to the old IRQL */ + KeLowerIrql(oldIrql); + } + return STATUS_PENDING; - case SRB_FUNCTION_RELEASE_DEVICE: - DPRINT (" SRB_FUNCTION_RELEASE_DEVICE\n"); + case SRB_FUNCTION_CLAIM_DEVICE: + case SRB_FUNCTION_ATTACH_DEVICE: + DPRINT(" SRB_FUNCTION_CLAIM_DEVICE or ATTACH\n"); - /* Dereference device object and clear the device object */ - Status = SpiHandleAttachRelease(DeviceExtension, Irp); - break; + /* Reference device object and keep the device object */ + Status = SpiHandleAttachRelease(DeviceExtension, Irp); + break; - case SRB_FUNCTION_RELEASE_QUEUE: - DPRINT(" SRB_FUNCTION_RELEASE_QUEUE\n"); + case SRB_FUNCTION_RELEASE_DEVICE: + DPRINT(" SRB_FUNCTION_RELEASE_DEVICE\n"); - /* Guard with the spinlock */ - KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); + /* Dereference device object and clear the device object */ + Status = SpiHandleAttachRelease(DeviceExtension, Irp); + break; - if (!(LunExtension->Flags & LUNEX_FROZEN_QUEUE)) - { - DPRINT("Queue is not frozen really\n"); + case SRB_FUNCTION_RELEASE_QUEUE: + DPRINT(" SRB_FUNCTION_RELEASE_QUEUE\n"); - KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); - Srb->SrbStatus = SRB_STATUS_SUCCESS; - Status = STATUS_SUCCESS; - break; + /* Guard with the spinlock */ + KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); - } + if (!(LunExtension->Flags & LUNEX_FROZEN_QUEUE)) + { + DPRINT("Queue is not frozen really\n"); - /* Unfreeze the queue */ - LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Srb->SrbStatus = SRB_STATUS_SUCCESS; + Status = STATUS_SUCCESS; + break; + } - if (LunExtension->SrbInfo.Srb == NULL) - { - /* Get next logical unit request */ - SpiGetNextRequestFromLun(DeviceExtension, LunExtension); + /* Unfreeze the queue */ + LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; - /* SpiGetNextRequestFromLun() releases the spinlock */ - KeLowerIrql(Irql); - } - else - { - DPRINT("The queue has active request\n"); - KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); - } + if (LunExtension->SrbInfo.Srb == NULL) + { + /* Get next logical unit request */ + SpiGetNextRequestFromLun(DeviceExtension, LunExtension); + /* SpiGetNextRequestFromLun() releases the spinlock */ + KeLowerIrql(Irql); + } + else + { + DPRINT("The queue has active request\n"); + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + } - Srb->SrbStatus = SRB_STATUS_SUCCESS; - Status = STATUS_SUCCESS; - break; + Srb->SrbStatus = SRB_STATUS_SUCCESS; + Status = STATUS_SUCCESS; + break; - case SRB_FUNCTION_FLUSH_QUEUE: - DPRINT(" SRB_FUNCTION_FLUSH_QUEUE\n"); + case SRB_FUNCTION_FLUSH_QUEUE: + DPRINT(" SRB_FUNCTION_FLUSH_QUEUE\n"); - /* Guard with the spinlock */ - KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); + /* Guard with the spinlock */ + KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); - if (!(LunExtension->Flags & LUNEX_FROZEN_QUEUE)) - { - DPRINT("Queue is not frozen really\n"); + if (!(LunExtension->Flags & LUNEX_FROZEN_QUEUE)) + { + DPRINT("Queue is not frozen really\n"); - KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); - Status = STATUS_INVALID_DEVICE_REQUEST; - break; - } + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Status = STATUS_INVALID_DEVICE_REQUEST; + break; + } - /* Make sure there is no active request */ - ASSERT(LunExtension->SrbInfo.Srb == NULL); + /* Make sure there is no active request */ + ASSERT(LunExtension->SrbInfo.Srb == NULL); - /* Compile a list from the device queue */ - IrpList = NULL; - while ((Entry = KeRemoveDeviceQueue(&LunExtension->DeviceQueue)) != NULL) - { + /* Compile a list from the device queue */ + IrpList = NULL; + while ((Entry = KeRemoveDeviceQueue(&LunExtension->DeviceQueue)) != NULL) + { NextIrp = CONTAINING_RECORD(Entry, IRP, Tail.Overlay.DeviceQueueEntry); /* Get the Srb */ @@ -2746,60 +2677,59 @@ ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, /* Add then to the list */ NextIrp->Tail.Overlay.ListEntry.Flink = (PLIST_ENTRY)IrpList; IrpList = NextIrp; - } + } - /* Unfreeze the queue */ - LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; + /* Unfreeze the queue */ + LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; - /* Release the spinlock */ - KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + /* Release the spinlock */ + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); - /* Complete those requests */ - while (IrpList) - { - NextIrp = IrpList; - IrpList = (PIRP)NextIrp->Tail.Overlay.ListEntry.Flink; + /* Complete those requests */ + while (IrpList) + { + NextIrp = IrpList; + IrpList = (PIRP)NextIrp->Tail.Overlay.ListEntry.Flink; - IoCompleteRequest(NextIrp, 0); - } + IoCompleteRequest(NextIrp, 0); + } - Status = STATUS_SUCCESS; - break; + Status = STATUS_SUCCESS; + break; - default: - DPRINT1("SRB function not implemented (Function %lu)\n", Srb->Function); - Status = STATUS_NOT_IMPLEMENTED; - break; + default: + DPRINT1("SRB function not implemented (Function %lu)\n", Srb->Function); + Status = STATUS_NOT_IMPLEMENTED; + break; } Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return(Status); + return Status; } /********************************************************************** - * NAME INTERNAL - * ScsiPortDeviceControl + * NAME INTERNAL + * ScsiPortDeviceControl * * DESCRIPTION - * Answer requests for device control calls + * Answer requests for device control calls * * RUN LEVEL - * PASSIVE_LEVEL + * PASSIVE_LEVEL * * ARGUMENTS - * Standard dispatch arguments + * Standard dispatch arguments * * RETURNS - * NTSTATUS + * NTSTATUS */ static NTSTATUS NTAPI ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) + IN PIRP Irp) { PIO_STACK_LOCATION Stack; PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; @@ -2907,7 +2837,7 @@ ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject, static VOID NTAPI ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) + IN PIRP Irp) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PSCSI_PORT_LUN_EXTENSION LunExtension; @@ -3363,9 +3293,9 @@ SpiAllocateLunExtension(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension) static PSCSI_PORT_LUN_EXTENSION SpiGetLunExtension (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, - IN UCHAR PathId, - IN UCHAR TargetId, - IN UCHAR Lun) + IN UCHAR PathId, + IN UCHAR TargetId, + IN UCHAR Lun) { PSCSI_PORT_LUN_EXTENSION LunExtension; @@ -4594,7 +4524,7 @@ SpiCompletionRoutine(PDEVICE_OBJECT DeviceObject, if (Irp->MdlAddress != NULL) { - MmUnlockPages(Irp->MdlAddress); + MmUnlockPages(Irp->MdlAddress); IoFreeMdl(Irp->MdlAddress); Irp->MdlAddress = NULL; } @@ -4863,9 +4793,9 @@ SpiGetNextRequestFromLun(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, // static VOID NTAPI ScsiPortDpcForIsr(IN PKDPC Dpc, - IN PDEVICE_OBJECT DpcDeviceObject, - IN PIRP DpcIrp, - IN PVOID DpcContext) + IN PDEVICE_OBJECT DpcDeviceObject, + IN PIRP DpcIrp, + IN PVOID DpcContext) { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension = DpcDeviceObject->DeviceExtension; SCSI_PORT_INTERRUPT_DATA InterruptData; @@ -4881,7 +4811,7 @@ ScsiPortDpcForIsr(IN PKDPC Dpc, /* We need to acquire spinlock */ KeAcquireSpinLockAtDpcLevel(&DeviceExtension->SpinLock); - RtlZeroMemory(&InterruptData, sizeof(SCSI_PORT_INTERRUPT_DATA)); + RtlZeroMemory(&InterruptData, sizeof(SCSI_PORT_INTERRUPT_DATA)); TryAgain: diff --git a/drivers/storage/port/scsiport/scsiport_int.h b/drivers/storage/port/scsiport/scsiport.h similarity index 98% rename from drivers/storage/port/scsiport/scsiport_int.h rename to drivers/storage/port/scsiport/scsiport.h index e05f163631a..b0076e543a9 100644 --- a/drivers/storage/port/scsiport/scsiport_int.h +++ b/drivers/storage/port/scsiport/scsiport.h @@ -7,6 +7,14 @@ #pragma once +#include <wdm.h> +#include <ntddk.h> +#include <stdio.h> +#include <scsi.h> +#include <ntddscsi.h> +#include <ntdddisk.h> +#include <mountdev.h> + #define VERSION "0.0.3" #ifndef PAGE_ROUND_UP
4 years, 3 months
1
0
0
0
[reactos] 01/01: [RAPPS] Remove string casts after the conutils fix
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3da04a9b683c3d3a13201…
commit 3da04a9b683c3d3a13201c74f4c430370473c12a Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Sep 20 22:15:47 2020 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Fri Sep 25 22:03:28 2020 +0200 [RAPPS] Remove string casts after the conutils fix --- base/applications/rapps/unattended.cpp | 37 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/base/applications/rapps/unattended.cpp b/base/applications/rapps/unattended.cpp index d20ef8aa3f2..f1589a3b544 100644 --- a/base/applications/rapps/unattended.cpp +++ b/base/applications/rapps/unattended.cpp @@ -5,14 +5,11 @@ * COPYRIGHT: Copyright 2017 Alexander Shaposhnikov (sanchaez(a)reactos.org) * Copyright 2020 He Yang (1160386205(a)qq.com) */ -#include "rapps.h" +#include "rapps.h" #include "unattended.h" - #include "winmain.h" - #include <setupapi.h> - #include <conutils.h> BOOL MatchCmdOption(LPWSTR argvOption, LPCWSTR szOptToMacth) @@ -119,13 +116,13 @@ BOOL HandleSetupCommand(LPWSTR szCommand, int argcLeft, LPWSTR * argvLeft) BOOL CALLBACK CmdFindAppEnum(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param) { LPCWSTR lpszSearch = (LPCWSTR)param; - if (!SearchPatternMatch(Info->m_szName.GetString(), lpszSearch) && - !SearchPatternMatch(Info->m_szDesc.GetString(), lpszSearch)) + if (!SearchPatternMatch(Info->m_szName, lpszSearch) && + !SearchPatternMatch(Info->m_szDesc, lpszSearch)) { return TRUE; } - ConPrintf(StdOut, (LPWSTR)L"%s (%s)\n", (LPCWSTR)(Info->m_szName), (LPCWSTR)(Info->m_szPkgName)); + ConPrintf(StdOut, L"%s (%s)\n", Info->m_szName.GetString(), Info->m_szPkgName.GetString()); return TRUE; } @@ -144,7 +141,7 @@ BOOL HandleFindCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft) { ConResMsgPrintf(StdOut, NULL, IDS_CMD_FIND_RESULT_FOR, argvLeft[i]); apps.Enum(ENUM_ALL_AVAILABLE, CmdFindAppEnum, argvLeft[i]); - ConPrintf(StdOut, (LPWSTR)L"\n"); + ConPrintf(StdOut, L"\n"); } return TRUE; @@ -176,47 +173,47 @@ BOOL HandleInfoCommand(LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft) // is in a mess. It should be refactored, and should not placed in class CAppRichEdit. // and the code here should reused that code after refactor. - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szName); + ConPuts(StdOut, AppInfo->m_szName); if (AppInfo->m_szVersion) { ConResPrintf(StdOut, IDS_AINFO_VERSION); - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szVersion); + ConPuts(StdOut, AppInfo->m_szVersion); } if (AppInfo->m_szLicense) { ConResPrintf(StdOut, IDS_AINFO_LICENSE); - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szLicense); + ConPuts(StdOut, AppInfo->m_szLicense); } if (AppInfo->m_szSize) { ConResPrintf(StdOut, IDS_AINFO_SIZE); - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szSize); + ConPuts(StdOut, AppInfo->m_szSize); } if (AppInfo->m_szUrlSite) { ConResPrintf(StdOut, IDS_AINFO_URLSITE); - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szUrlSite); + ConPuts(StdOut, AppInfo->m_szUrlSite); } if (AppInfo->m_szDesc) { ConResPrintf(StdOut, IDS_AINFO_DESCRIPTION); - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szDesc); + ConPuts(StdOut, AppInfo->m_szDesc); } if (AppInfo->m_szUrlDownload) { ConResPrintf(StdOut, IDS_AINFO_URLDOWNLOAD); - ConPuts(StdOut, (LPWSTR)(LPCWSTR)AppInfo->m_szUrlDownload); + ConPuts(StdOut, AppInfo->m_szUrlDownload); } - ConPrintf(StdOut, (LPWSTR)L"\n"); + ConPrintf(StdOut, L"\n"); } - ConPrintf(StdOut, (LPWSTR)L"\n"); + ConPrintf(StdOut, L"\n"); } return TRUE; } @@ -228,12 +225,12 @@ BOOL HandleHelpCommand(LPWSTR szCommand, int argcLeft, LPWSTR * argvLeft) return FALSE; } - ConPrintf(StdOut, (LPWSTR)L"\n"); + ConPrintf(StdOut, L"\n"); ConResPuts(StdOut, IDS_APPTITLE); - ConPrintf(StdOut, (LPWSTR)L"\n\n"); + ConPrintf(StdOut, L"\n\n"); ConResPuts(StdOut, IDS_CMD_USAGE); - ConPrintf(StdOut, (LPWSTR)L"%ls\n", UsageString); + ConPrintf(StdOut, L"%ls\n", UsageString); return TRUE; }
4 years, 3 months
1
0
0
0
[reactos] 03/03: [KERNEL32_VISTA] Move vista.c from kernel32 to kernel32_vista
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8b5c00c338e3cb508a6a…
commit d8b5c00c338e3cb508a6aabf00cdbfd32906c542 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Sep 13 18:55:17 2020 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Fri Sep 25 09:45:54 2020 +0200 [KERNEL32_VISTA] Move vista.c from kernel32 to kernel32_vista - Remove duplicated functions - Use AreFileApisANSI() instead of global variable bIsFileApiAnsi in shared kernel32_shared --- dll/win32/kernel32/CMakeLists.txt | 1 - dll/win32/kernel32/client/file/fileutils.c | 10 +- dll/win32/kernel32/kernel32_vista/CMakeLists.txt | 3 + dll/win32/kernel32/kernel32_vista/k32_vista.h | 11 ++ .../kernel32/kernel32_vista/kernel32_vista.spec | 24 ++++ .../kernel32/{client => kernel32_vista}/vista.c | 155 ++------------------- 6 files changed, 57 insertions(+), 147 deletions(-) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index 616e0f453b5..7d31686837d 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -44,7 +44,6 @@ list(APPEND SOURCE client/vdm.c client/version.c client/virtmem.c - client/vista.c client/console/alias.c client/console/console.c client/console/history.c diff --git a/dll/win32/kernel32/client/file/fileutils.c b/dll/win32/kernel32/client/file/fileutils.c index 078f83006e2..2257608588a 100644 --- a/dll/win32/kernel32/client/file/fileutils.c +++ b/dll/win32/kernel32/client/file/fileutils.c @@ -28,7 +28,7 @@ FilenameA2W(LPCSTR NameA, BOOL alloc) RtlInitAnsiString(&str, NameA); pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString; - if (bIsFileApiAnsi) + if (AreFileApisANSI()) Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc ); else Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc ); @@ -64,7 +64,7 @@ FilenameU2A_FitOrFail( /* destLen should never exceed MAX_PATH */ if (destLen > MAX_PATH) destLen = MAX_PATH; - ret = bIsFileApiAnsi? RtlUnicodeStringToAnsiSize(SourceU) : RtlUnicodeStringToOemSize(SourceU); + ret = AreFileApisANSI() ? RtlUnicodeStringToAnsiSize(SourceU) : RtlUnicodeStringToOemSize(SourceU); /* ret incl. nullchar */ if (DestA && (INT)ret <= destLen) @@ -75,7 +75,7 @@ FilenameU2A_FitOrFail( str.MaximumLength = (USHORT)destLen; - if (bIsFileApiAnsi) + if (AreFileApisANSI()) RtlUnicodeStringToAnsiString(&str, SourceU, FALSE ); else RtlUnicodeStringToOemString(&str, SourceU, FALSE ); @@ -129,7 +129,7 @@ FilenameA2W_N( if (srclen < 0) srclen = strlen( src ) + 1; - if (bIsFileApiAnsi) + if (AreFileApisANSI()) RtlMultiByteToUnicodeN( dest, destlen* sizeof(WCHAR), &ret, (LPSTR)src, srclen ); else RtlOemToUnicodeN( dest, destlen* sizeof(WCHAR), &ret, (LPSTR)src, srclen ); @@ -154,7 +154,7 @@ FilenameW2A_N( if (srclen < 0) srclen = wcslen( src ) + 1; - if (bIsFileApiAnsi) + if (AreFileApisANSI()) RtlUnicodeToMultiByteN( dest, destlen, &ret, (LPWSTR) src, srclen * sizeof(WCHAR)); else RtlUnicodeToOemN( dest, destlen, &ret, (LPWSTR) src, srclen * sizeof(WCHAR) ); diff --git a/dll/win32/kernel32/kernel32_vista/CMakeLists.txt b/dll/win32/kernel32/kernel32_vista/CMakeLists.txt index 915346689a1..51efae70f8b 100644 --- a/dll/win32/kernel32/kernel32_vista/CMakeLists.txt +++ b/dll/win32/kernel32/kernel32_vista/CMakeLists.txt @@ -3,6 +3,7 @@ remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) add_definitions(-D_WIN32_WINNT=0x600 -DWINVER=0x600) add_definitions(-D_KERNEL32_) +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys) spec2def(kernel32_vista.dll kernel32_vista.spec ADD_IMPORTLIB) list(APPEND SOURCE @@ -11,10 +12,12 @@ list(APPEND SOURCE GetTickCount64.c InitOnceExecuteOnce.c sync.c + vista.c ${CMAKE_CURRENT_BINARY_DIR}/kernel32_vista.def) add_library(kernel32_vista MODULE ${SOURCE}) set_module_type(kernel32_vista win32dll ENTRYPOINT DllMain 12) +target_link_libraries(kernel32_vista kernel32_shared) add_importlibs(kernel32_vista kernel32 ntdll_vista ntdll) add_delay_importlibs(kernel32_vista ntdll_vista) add_dependencies(kernel32_vista psdk) diff --git a/dll/win32/kernel32/kernel32_vista/k32_vista.h b/dll/win32/kernel32/kernel32_vista/k32_vista.h index fff9ba8d0b4..7f78e53e68a 100644 --- a/dll/win32/kernel32/kernel32_vista/k32_vista.h +++ b/dll/win32/kernel32/kernel32_vista/k32_vista.h @@ -6,7 +6,18 @@ #include <windef.h> #include <winbase.h> +/* Redefine NTDDI_VERSION to 2K3 SP1 to get correct NDK definitions */ +#undef NTDDI_VERSION +#define NTDDI_VERSION NTDDI_WS03SP1 + +#include <ndk/iofuncs.h> #include <ndk/kefuncs.h> +#include <ndk/obfuncs.h> #include <ndk/psfuncs.h> #include <ndk/rtlfuncs.h> +/* CSRSS Headers */ +#include <win/base.h> + +/* Internal Kernel32 Header */ +#include "../include/kernel32.h" diff --git a/dll/win32/kernel32/kernel32_vista/kernel32_vista.spec b/dll/win32/kernel32/kernel32_vista/kernel32_vista.spec index f61e6e6dc36..02c1cb05739 100644 --- a/dll/win32/kernel32/kernel32_vista/kernel32_vista.spec +++ b/dll/win32/kernel32/kernel32_vista/kernel32_vista.spec @@ -16,3 +16,27 @@ @ stdcall WakeConditionVariable(ptr) @ stdcall InitializeCriticalSectionEx(ptr long long) + +@ stdcall ApplicationRecoveryFinished(long) +@ stdcall ApplicationRecoveryInProgress(ptr) +@ stdcall CreateSymbolicLinkA(str str long) +@ stdcall CreateSymbolicLinkW(wstr wstr long) +@ stdcall GetApplicationRecoveryCallback(ptr ptr ptr ptr ptr) +@ stdcall GetApplicationRestart(ptr wstr ptr ptr) +@ stdcall GetFileBandwidthReservation(ptr ptr ptr ptr ptr ptr) +@ stdcall GetFileMUIInfo(long wstr ptr ptr) +@ stdcall GetFileMUIPath(long wstr wstr ptr wstr ptr ptr) +@ stdcall GetFinalPathNameByHandleA(ptr str long long) +@ stdcall GetFinalPathNameByHandleW(ptr wstr long long) +@ stdcall GetSystemPreferredUILanguages(long ptr wstr ptr) +@ stdcall GetThreadPreferredUILanguages(long ptr wstr ptr) +@ stdcall GetThreadUILanguage() +@ stdcall GetUILanguageInfo(long wstr wstr ptr ptr) +@ stdcall GetUserPreferredUILanguages(long ptr wstr ptr) +@ stdcall OpenFileById(ptr ptr long long ptr long) +@ stdcall QueryFullProcessImageNameA(ptr long str ptr) +@ stdcall QueryFullProcessImageNameW(ptr long wstr ptr) +@ stdcall RegisterApplicationRecoveryCallback(ptr ptr long long) +@ stdcall RegisterApplicationRestart(wstr long) +@ stdcall SetFileBandwidthReservation(ptr long long long ptr ptr) +@ stdcall SetThreadPreferredUILanguages(long wstr ptr) diff --git a/dll/win32/kernel32/client/vista.c b/dll/win32/kernel32/kernel32_vista/vista.c similarity index 83% rename from dll/win32/kernel32/client/vista.c rename to dll/win32/kernel32/kernel32_vista/vista.c index 8fa60a995cd..743cb430721 100644 --- a/dll/win32/kernel32/client/vista.c +++ b/dll/win32/kernel32/kernel32_vista/vista.c @@ -7,125 +7,19 @@ /* INCLUDES *******************************************************************/ -#include <k32.h> +#include <k32_vista.h> -#define NDEBUG -#include <debug.h> - -#if _WIN32_WINNT >= 0x600 - -/* FIXME: Move these RTL declarations to the NDK */ -NTSTATUS -NTAPI -RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, - IN OUT PRTL_CRITICAL_SECTION CriticalSection, - IN PLARGE_INTEGER TimeOut OPTIONAL); - -NTSTATUS -NTAPI -RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, - IN OUT PRTL_SRWLOCK SRWLock, - IN PLARGE_INTEGER TimeOut OPTIONAL, - IN ULONG Flags); - -/* PUBLIC FUNCTIONS ***********************************************************/ - -/* - * @implemented - */ -BOOL -WINAPI -SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable, - IN OUT PCRITICAL_SECTION CriticalSection, - IN DWORD dwMilliseconds) -{ - NTSTATUS Status = STATUS_SUCCESS; -#if 0 - LARGE_INTEGER TimeOut; - PLARGE_INTEGER TimeOutPtr = NULL; - - if (dwMilliseconds != INFINITE) - { - TimeOut.QuadPart = dwMilliseconds * -10000LL; - TimeOutPtr = &TimeOut; - } - - Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable, - (PRTL_CRITICAL_SECTION)CriticalSection, - TimeOutPtr); +#if _WIN32_WINNT != _WIN32_WINNT_VISTA +#error "This file must be compiled with _WIN32_WINNT == _WIN32_WINNT_VISTA" #endif - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable, - IN OUT PSRWLOCK SRWLock, - IN DWORD dwMilliseconds, - IN ULONG Flags) -{ - NTSTATUS Status = STATUS_SUCCESS; -#if 0 - LARGE_INTEGER TimeOut; - PLARGE_INTEGER TimeOutPtr = NULL; - if (dwMilliseconds != INFINITE) - { - TimeOut.QuadPart = dwMilliseconds * -10000LL; - TimeOutPtr = &TimeOut; - } +// This is defined only in ntifs.h +#define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer) - Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable, - (PRTL_SRWLOCK)SRWLock, - TimeOutPtr, - Flags); -#endif - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - - -/* - * @implemented - */ -BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, - IN DWORD dwSpinCount, - IN DWORD flags) -{ - NTSTATUS Status; - - /* FIXME: Flags ignored */ - - /* Initialize the critical section */ - Status = RtlInitializeCriticalSectionAndSpinCount( - (PRTL_CRITICAL_SECTION)lpCriticalSection, - dwSpinCount); - if (!NT_SUCCESS(Status)) - { - /* Set failure code */ - BaseSetLastNTError(Status); - return FALSE; - } - - /* Success */ - return TRUE; -} +#define NDEBUG +#include <debug.h> +/* PUBLIC FUNCTIONS ***********************************************************/ /* * @implemented @@ -267,7 +161,7 @@ GetApplicationRestart(IN HANDLE hProcess, */ VOID WINAPI -RecoveryFinished(IN BOOL bSuccess) +ApplicationRecoveryFinished(IN BOOL bSuccess) { UNIMPLEMENTED; } @@ -278,7 +172,7 @@ RecoveryFinished(IN BOOL bSuccess) */ HRESULT WINAPI -RecoveryInProgress(OUT PBOOL pbCancelled) +ApplicationRecoveryInProgress(OUT PBOOL pbCancelled) { UNIMPLEMENTED; return E_FAIL; @@ -692,30 +586,6 @@ OpenFileById(IN HANDLE hFile, } -/* - * @implemented - */ -ULONGLONG -WINAPI -GetTickCount64(VOID) -{ - ULARGE_INTEGER TickCount; - - while (TRUE) - { - TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time; - TickCount.LowPart = SharedUserData->TickCount.LowPart; - - if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time) break; - - YieldProcessor(); - } - - return (UInt32x32To64(TickCount.LowPart, SharedUserData->TickCountMultiplier) >> 24) + - (UInt32x32To64(TickCount.HighPart, SharedUserData->TickCountMultiplier) << 8); -} - -#endif /* Vista+ MUI support functions @@ -766,6 +636,7 @@ GetFileMUIPath( /* * @unimplemented */ +#if 0 // This is Windows 7+ BOOL WINAPI GetProcessPreferredUILanguages( @@ -778,6 +649,7 @@ GetProcessPreferredUILanguages( SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } +#endif /* * @unimplemented @@ -860,6 +732,7 @@ GetUserPreferredUILanguages( /* * @unimplemented */ +#if 0 // Tis is Windows 7+ BOOL WINAPI SetProcessPreferredUILanguages( @@ -871,7 +744,7 @@ SetProcessPreferredUILanguages( SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } - +#endif /* * @unimplemented
4 years, 3 months
1
0
0
0
[reactos] 02/03: [KERNEL32] Move some functions into a static library to be shared between kernel32 and kernel32_vista
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fcd83242d4e20e86b54de…
commit fcd83242d4e20e86b54dec7f7c7091f997a537fe Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Sep 13 10:03:58 2020 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Fri Sep 25 09:45:54 2020 +0200 [KERNEL32] Move some functions into a static library to be shared between kernel32 and kernel32_vista --- dll/win32/kernel32/CMakeLists.txt | 10 +- dll/win32/kernel32/client/except.c | 15 --- dll/win32/kernel32/client/file/fileinfo.c | 150 -------------------------- dll/win32/kernel32/client/file/fileutils.c | 167 +++++++++++++++++++++++++++++ dll/win32/kernel32/client/shared_utils.c | 30 ++++++ 5 files changed, 206 insertions(+), 166 deletions(-) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index 984cb8eaa0d..616e0f453b5 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -5,6 +5,14 @@ add_definitions(-D_KERNEL32_) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys) spec2def(kernel32.dll kernel32.spec ADD_IMPORTLIB) +# Shared between kernel32 and kernel32_vista +add_library(kernel32_shared + client/shared_utils.c + client/file/fileutils.c +) + +add_dependencies(kernel32_shared psdk) + list(APPEND SOURCE client/actctx.c client/appcache.c @@ -114,7 +122,7 @@ set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12) set_subsystem(kernel32 console) ################# END HACK ################# -target_link_libraries(kernel32 wine chkstk ${PSEH_LIB}) +target_link_libraries(kernel32 kernel32_shared wine chkstk ${PSEH_LIB}) add_importlibs(kernel32 ntdll) add_pch(kernel32 k32.h SOURCE) add_dependencies(kernel32 psdk errcodes asm) diff --git a/dll/win32/kernel32/client/except.c b/dll/win32/kernel32/client/except.c index dbb76b7be49..36fab314f49 100644 --- a/dll/win32/kernel32/client/except.c +++ b/dll/win32/kernel32/client/except.c @@ -1036,21 +1036,6 @@ SetLastError(IN DWORD dwErrCode) if (NtCurrentTeb()->LastErrorValue != dwErrCode) NtCurrentTeb()->LastErrorValue = dwErrCode; } -/* - * @implemented - */ -DWORD -WINAPI -BaseSetLastNTError(IN NTSTATUS Status) -{ - DWORD dwErrCode; - - /* Convert from NT to Win32, then set */ - dwErrCode = RtlNtStatusToDosError(Status); - SetLastError(dwErrCode); - return dwErrCode; -} - /* * @implemented */ diff --git a/dll/win32/kernel32/client/file/fileinfo.c b/dll/win32/kernel32/client/file/fileinfo.c index 2721c826315..b70a99a137c 100644 --- a/dll/win32/kernel32/client/file/fileinfo.c +++ b/dll/win32/kernel32/client/file/fileinfo.c @@ -18,156 +18,6 @@ DEBUG_CHANNEL(kernel32file); /* FUNCTIONS ****************************************************************/ -PWCHAR -FilenameA2W(LPCSTR NameA, BOOL alloc) -{ - ANSI_STRING str; - UNICODE_STRING strW; - PUNICODE_STRING pstrW; - NTSTATUS Status; - - //ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer); - ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer)); - - RtlInitAnsiString(&str, NameA); - pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString; - - if (bIsFileApiAnsi) - Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc ); - else - Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc ); - - if (NT_SUCCESS(Status)) - return pstrW->Buffer; - - if (Status== STATUS_BUFFER_OVERFLOW) - SetLastError( ERROR_FILENAME_EXCED_RANGE ); - else - BaseSetLastNTError(Status); - - return NULL; -} - - -/* -No copy/conversion is done if the dest. buffer is too small. - -Returns: - Success: number of TCHARS copied into dest. buffer NOT including nullterm - Fail: size of buffer in TCHARS required to hold the converted filename, including nullterm -*/ -DWORD -FilenameU2A_FitOrFail( - LPSTR DestA, - INT destLen, /* buffer size in TCHARS incl. nullchar */ - PUNICODE_STRING SourceU - ) -{ - DWORD ret; - - /* destLen should never exceed MAX_PATH */ - if (destLen > MAX_PATH) destLen = MAX_PATH; - - ret = bIsFileApiAnsi? RtlUnicodeStringToAnsiSize(SourceU) : RtlUnicodeStringToOemSize(SourceU); - /* ret incl. nullchar */ - - if (DestA && (INT)ret <= destLen) - { - ANSI_STRING str; - - str.Buffer = DestA; - str.MaximumLength = (USHORT)destLen; - - - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString(&str, SourceU, FALSE ); - else - RtlUnicodeStringToOemString(&str, SourceU, FALSE ); - - ret = str.Length; /* SUCCESS: length without terminating 0 */ - } - - return ret; -} - - -/* -No copy/conversion is done if the dest. buffer is too small. - -Returns: - Success: number of TCHARS copied into dest. buffer NOT including nullterm - Fail: size of buffer in TCHARS required to hold the converted filename, including nullterm -*/ -DWORD -FilenameW2A_FitOrFail( - LPSTR DestA, - INT destLen, /* buffer size in TCHARS incl. nullchar */ - LPCWSTR SourceW, - INT sourceLen /* buffer size in TCHARS incl. nullchar */ - ) -{ - UNICODE_STRING strW; - - if (sourceLen < 0) sourceLen = wcslen(SourceW) + 1; - - strW.Buffer = (PWCHAR)SourceW; - strW.MaximumLength = sourceLen * sizeof(WCHAR); - strW.Length = strW.MaximumLength - sizeof(WCHAR); - - return FilenameU2A_FitOrFail(DestA, destLen, &strW); -} - - -/* -Return: num. TCHARS copied into dest including nullterm -*/ -DWORD -FilenameA2W_N( - LPWSTR dest, - INT destlen, /* buffer size in TCHARS incl. nullchar */ - LPCSTR src, - INT srclen /* buffer size in TCHARS incl. nullchar */ - ) -{ - DWORD ret; - - if (srclen < 0) srclen = strlen( src ) + 1; - - if (bIsFileApiAnsi) - RtlMultiByteToUnicodeN( dest, destlen* sizeof(WCHAR), &ret, (LPSTR)src, srclen ); - else - RtlOemToUnicodeN( dest, destlen* sizeof(WCHAR), &ret, (LPSTR)src, srclen ); - - if (ret) dest[(ret/sizeof(WCHAR))-1]=0; - - return ret/sizeof(WCHAR); -} - -/* -Return: num. TCHARS copied into dest including nullterm -*/ -DWORD -FilenameW2A_N( - LPSTR dest, - INT destlen, /* buffer size in TCHARS incl. nullchar */ - LPCWSTR src, - INT srclen /* buffer size in TCHARS incl. nullchar */ - ) -{ - DWORD ret; - - if (srclen < 0) srclen = wcslen( src ) + 1; - - if (bIsFileApiAnsi) - RtlUnicodeToMultiByteN( dest, destlen, &ret, (LPWSTR) src, srclen * sizeof(WCHAR)); - else - RtlUnicodeToOemN( dest, destlen, &ret, (LPWSTR) src, srclen * sizeof(WCHAR) ); - - if (ret) dest[ret-1]=0; - - return ret; -} - /* * @implemented */ diff --git a/dll/win32/kernel32/client/file/fileutils.c b/dll/win32/kernel32/client/file/fileutils.c new file mode 100644 index 00000000000..078f83006e2 --- /dev/null +++ b/dll/win32/kernel32/client/file/fileutils.c @@ -0,0 +1,167 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: dll/win32/kernel32/client/file/fileutils.c + * PURPOSE: File utility function shared with kernel32_vista + * PROGRAMMER: Taken from wine + */ + +/* INCLUDES *****************************************************************/ + +#include <k32.h> +#define NDEBUG +#include <debug.h> + +/* FUNCTIONS ****************************************************************/ + +PWCHAR +FilenameA2W(LPCSTR NameA, BOOL alloc) +{ + ANSI_STRING str; + UNICODE_STRING strW; + PUNICODE_STRING pstrW; + NTSTATUS Status; + + //ASSERT(NtCurrentTeb()->StaticUnicodeString.Buffer == NtCurrentTeb()->StaticUnicodeBuffer); + ASSERT(NtCurrentTeb()->StaticUnicodeString.MaximumLength == sizeof(NtCurrentTeb()->StaticUnicodeBuffer)); + + RtlInitAnsiString(&str, NameA); + pstrW = alloc ? &strW : &NtCurrentTeb()->StaticUnicodeString; + + if (bIsFileApiAnsi) + Status= RtlAnsiStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc ); + else + Status= RtlOemStringToUnicodeString( pstrW, &str, (BOOLEAN)alloc ); + + if (NT_SUCCESS(Status)) + return pstrW->Buffer; + + if (Status== STATUS_BUFFER_OVERFLOW) + SetLastError( ERROR_FILENAME_EXCED_RANGE ); + else + BaseSetLastNTError(Status); + + return NULL; +} + + +/* +No copy/conversion is done if the dest. buffer is too small. + +Returns: + Success: number of TCHARS copied into dest. buffer NOT including nullterm + Fail: size of buffer in TCHARS required to hold the converted filename, including nullterm +*/ +DWORD +FilenameU2A_FitOrFail( + LPSTR DestA, + INT destLen, /* buffer size in TCHARS incl. nullchar */ + PUNICODE_STRING SourceU + ) +{ + DWORD ret; + + /* destLen should never exceed MAX_PATH */ + if (destLen > MAX_PATH) destLen = MAX_PATH; + + ret = bIsFileApiAnsi? RtlUnicodeStringToAnsiSize(SourceU) : RtlUnicodeStringToOemSize(SourceU); + /* ret incl. nullchar */ + + if (DestA && (INT)ret <= destLen) + { + ANSI_STRING str; + + str.Buffer = DestA; + str.MaximumLength = (USHORT)destLen; + + + if (bIsFileApiAnsi) + RtlUnicodeStringToAnsiString(&str, SourceU, FALSE ); + else + RtlUnicodeStringToOemString(&str, SourceU, FALSE ); + + ret = str.Length; /* SUCCESS: length without terminating 0 */ + } + + return ret; +} + + +/* +No copy/conversion is done if the dest. buffer is too small. + +Returns: + Success: number of TCHARS copied into dest. buffer NOT including nullterm + Fail: size of buffer in TCHARS required to hold the converted filename, including nullterm +*/ +DWORD +FilenameW2A_FitOrFail( + LPSTR DestA, + INT destLen, /* buffer size in TCHARS incl. nullchar */ + LPCWSTR SourceW, + INT sourceLen /* buffer size in TCHARS incl. nullchar */ + ) +{ + UNICODE_STRING strW; + + if (sourceLen < 0) sourceLen = wcslen(SourceW) + 1; + + strW.Buffer = (PWCHAR)SourceW; + strW.MaximumLength = sourceLen * sizeof(WCHAR); + strW.Length = strW.MaximumLength - sizeof(WCHAR); + + return FilenameU2A_FitOrFail(DestA, destLen, &strW); +} + + +/* +Return: num. TCHARS copied into dest including nullterm +*/ +DWORD +FilenameA2W_N( + LPWSTR dest, + INT destlen, /* buffer size in TCHARS incl. nullchar */ + LPCSTR src, + INT srclen /* buffer size in TCHARS incl. nullchar */ + ) +{ + DWORD ret; + + if (srclen < 0) srclen = strlen( src ) + 1; + + if (bIsFileApiAnsi) + RtlMultiByteToUnicodeN( dest, destlen* sizeof(WCHAR), &ret, (LPSTR)src, srclen ); + else + RtlOemToUnicodeN( dest, destlen* sizeof(WCHAR), &ret, (LPSTR)src, srclen ); + + if (ret) dest[(ret/sizeof(WCHAR))-1]=0; + + return ret/sizeof(WCHAR); +} + +/* +Return: num. TCHARS copied into dest including nullterm +*/ +DWORD +FilenameW2A_N( + LPSTR dest, + INT destlen, /* buffer size in TCHARS incl. nullchar */ + LPCWSTR src, + INT srclen /* buffer size in TCHARS incl. nullchar */ + ) +{ + DWORD ret; + + if (srclen < 0) srclen = wcslen( src ) + 1; + + if (bIsFileApiAnsi) + RtlUnicodeToMultiByteN( dest, destlen, &ret, (LPWSTR) src, srclen * sizeof(WCHAR)); + else + RtlUnicodeToOemN( dest, destlen, &ret, (LPWSTR) src, srclen * sizeof(WCHAR) ); + + if (ret) dest[ret-1]=0; + + return ret; +} + +/* EOF */ diff --git a/dll/win32/kernel32/client/shared_utils.c b/dll/win32/kernel32/client/shared_utils.c new file mode 100644 index 00000000000..05b10675e72 --- /dev/null +++ b/dll/win32/kernel32/client/shared_utils.c @@ -0,0 +1,30 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: dll/win32/kernel32/client/utils_shared.c + * PURPOSE: Utility functions shared with kernel32_vista + * PROGRAMMER: Thomas Faber +*/ + +/* INCLUDES *******************************************************************/ + +#include <k32.h> +#include <strsafe.h> + +#define NDEBUG +#include <debug.h> + +/* +* @implemented +*/ +DWORD +WINAPI +BaseSetLastNTError(IN NTSTATUS Status) +{ + DWORD dwErrCode; + + /* Convert from NT to Win32, then set */ + dwErrCode = RtlNtStatusToDosError(Status); + SetLastError(dwErrCode); + return dwErrCode; +}
4 years, 3 months
1
0
0
0
[reactos] 01/03: [KERNEL32_VISTA] Move under kernel32
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4e72da08584e4f21c86bb…
commit 4e72da08584e4f21c86bbe527536a31c8c566d26 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Sep 13 09:16:17 2020 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Fri Sep 25 09:45:54 2020 +0200 [KERNEL32_VISTA] Move under kernel32 --- dll/win32/CMakeLists.txt | 1 - dll/win32/kernel32/CMakeLists.txt | 2 ++ dll/win32/{ => kernel32}/kernel32_vista/CMakeLists.txt | 0 dll/win32/{ => kernel32}/kernel32_vista/DllMain.c | 0 dll/win32/{ => kernel32}/kernel32_vista/GetFileInformationByHandleEx.c | 0 dll/win32/{ => kernel32}/kernel32_vista/GetTickCount64.c | 0 dll/win32/{ => kernel32}/kernel32_vista/InitOnceExecuteOnce.c | 0 dll/win32/{ => kernel32}/kernel32_vista/k32_vista.h | 0 dll/win32/{ => kernel32}/kernel32_vista/kernel32_vista.spec | 0 dll/win32/{ => kernel32}/kernel32_vista/sync.c | 0 10 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dll/win32/CMakeLists.txt b/dll/win32/CMakeLists.txt index 01e6dee240e..9e7c13363ab 100644 --- a/dll/win32/CMakeLists.txt +++ b/dll/win32/CMakeLists.txt @@ -74,7 +74,6 @@ add_subdirectory(itss) add_subdirectory(jscript) add_subdirectory(jsproxy) add_subdirectory(kernel32) -add_subdirectory(kernel32_vista) add_subdirectory(loadperf) add_subdirectory(lpk) add_subdirectory(lsasrv) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index f2a4e0f0292..984cb8eaa0d 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -1,4 +1,6 @@ +add_subdirectory(kernel32_vista) + add_definitions(-D_KERNEL32_) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/subsys) spec2def(kernel32.dll kernel32.spec ADD_IMPORTLIB) diff --git a/dll/win32/kernel32_vista/CMakeLists.txt b/dll/win32/kernel32/kernel32_vista/CMakeLists.txt similarity index 100% rename from dll/win32/kernel32_vista/CMakeLists.txt rename to dll/win32/kernel32/kernel32_vista/CMakeLists.txt diff --git a/dll/win32/kernel32_vista/DllMain.c b/dll/win32/kernel32/kernel32_vista/DllMain.c similarity index 100% rename from dll/win32/kernel32_vista/DllMain.c rename to dll/win32/kernel32/kernel32_vista/DllMain.c diff --git a/dll/win32/kernel32_vista/GetFileInformationByHandleEx.c b/dll/win32/kernel32/kernel32_vista/GetFileInformationByHandleEx.c similarity index 100% rename from dll/win32/kernel32_vista/GetFileInformationByHandleEx.c rename to dll/win32/kernel32/kernel32_vista/GetFileInformationByHandleEx.c diff --git a/dll/win32/kernel32_vista/GetTickCount64.c b/dll/win32/kernel32/kernel32_vista/GetTickCount64.c similarity index 100% rename from dll/win32/kernel32_vista/GetTickCount64.c rename to dll/win32/kernel32/kernel32_vista/GetTickCount64.c diff --git a/dll/win32/kernel32_vista/InitOnceExecuteOnce.c b/dll/win32/kernel32/kernel32_vista/InitOnceExecuteOnce.c similarity index 100% rename from dll/win32/kernel32_vista/InitOnceExecuteOnce.c rename to dll/win32/kernel32/kernel32_vista/InitOnceExecuteOnce.c diff --git a/dll/win32/kernel32_vista/k32_vista.h b/dll/win32/kernel32/kernel32_vista/k32_vista.h similarity index 100% rename from dll/win32/kernel32_vista/k32_vista.h rename to dll/win32/kernel32/kernel32_vista/k32_vista.h diff --git a/dll/win32/kernel32_vista/kernel32_vista.spec b/dll/win32/kernel32/kernel32_vista/kernel32_vista.spec similarity index 100% rename from dll/win32/kernel32_vista/kernel32_vista.spec rename to dll/win32/kernel32/kernel32_vista/kernel32_vista.spec diff --git a/dll/win32/kernel32_vista/sync.c b/dll/win32/kernel32/kernel32_vista/sync.c similarity index 100% rename from dll/win32/kernel32_vista/sync.c rename to dll/win32/kernel32/kernel32_vista/sync.c
4 years, 3 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
39
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
Results per page:
10
25
50
100
200