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
November 2013
----- 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
16 participants
348 discussions
Start a n
N
ew thread
[aandrejevic] 60929: [FAST486] Implement the two operand version of IMUL.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Mon Nov 11 00:10:46 2013 New Revision: 60929 URL:
http://svn.reactos.org/svn/reactos?rev=60929&view=rev
Log: [FAST486] Implement the two operand version of IMUL. Modified: branches/ntvdm/lib/fast486/extraops.c branches/ntvdm/lib/fast486/extraops.h Modified: branches/ntvdm/lib/fast486/extraops.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.c?re…
============================================================================== --- branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] Mon Nov 11 00:10:46 2013 @@ -212,7 +212,7 @@ NULL, // TODO: OPCODE 0xAC NOT IMPLEMENTED NULL, // TODO: OPCODE 0xAD NOT IMPLEMENTED NULL, // TODO: OPCODE 0xAE NOT IMPLEMENTED - NULL, // TODO: OPCODE 0xAF NOT IMPLEMENTED + Fast486ExtOpcodeImul, Fast486ExtOpcodeCmpXchgByte, Fast486ExtOpcodeCmpXchg, NULL, // TODO: OPCODE 0xB2 NOT IMPLEMENTED @@ -712,6 +712,70 @@ return TRUE; } +FAST486_OPCODE_HANDLER(Fast486ExtOpcodeImul) +{ + BOOLEAN OperandSize, AddressSize; + FAST486_MOD_REG_RM ModRegRm; + + OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + + /* Get the operands */ + if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) + { + /* Exception occurred */ + return FALSE; + } + + if (OperandSize) + { + LONG Source, Destination; + LONGLONG Result; + + /* Read the operands */ + if (!Fast486ReadModrmDwordOperands(State, + &ModRegRm, + (PULONG)&Destination, + (PULONG)&Source)) + { + /* Exception occurred */ + return FALSE; + } + + /* Calculate the result */ + Result = (LONGLONG)Source * (LONGLONG)Destination; + + /* Update the flags */ + State->Flags.Cf = State->Flags.Of = ((Result < -2147483648LL) || (Result > 2147483647LL)); + + /* Write back the result */ + return Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, (ULONG)((LONG)Result)); + } + else + { + SHORT Source, Destination; + LONG Result; + + /* Read the operands */ + if (!Fast486ReadModrmWordOperands(State, + &ModRegRm, + (PUSHORT)&Destination, + (PUSHORT)&Source)) + { + /* Exception occurred */ + return FALSE; + } + + /* Calculate the result */ + Result = (LONG)Source * (LONG)Destination; + + /* Update the flags */ + State->Flags.Cf = State->Flags.Of = ((Result < -32768) || (Result > 32767)); + + /* Write back the result */ + return Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, (USHORT)((SHORT)Result)); + } +} + FAST486_OPCODE_HANDLER(Fast486ExtOpcodeCmpXchgByte) { FAST486_MOD_REG_RM ModRegRm; Modified: branches/ntvdm/lib/fast486/extraops.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.h?re…
============================================================================== --- branches/ntvdm/lib/fast486/extraops.h [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/extraops.h [iso-8859-1] Mon Nov 11 00:10:46 2013 @@ -37,6 +37,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodePushGs); FAST486_OPCODE_HANDLER(Fast486ExtOpcodePopGs); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBts); +FAST486_OPCODE_HANDLER(Fast486ExtOpcodeImul); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeCmpXchgByte); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeCmpXchg); FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtr);
11 years, 1 month
1
0
0
0
[ekohl] 60928: [TRANSLATIONS] Fixed turkish translations. Patch by Erdem Ersoy. CORE-7408 #comment Sorry, my editor likes to eat non-ANSI characters! :-/
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Nov 10 23:52:15 2013 New Revision: 60928 URL:
http://svn.reactos.org/svn/reactos?rev=60928&view=rev
Log: [TRANSLATIONS] Fixed turkish translations. Patch by Erdem Ersoy. CORE-7408 #comment Sorry, my editor likes to eat non-ANSI characters! :-/ Modified: trunk/reactos/dll/cpl/inetcpl/lang/tr-TR.rc Modified: trunk/reactos/dll/cpl/inetcpl/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/inetcpl/lang/tr-TR…
============================================================================== --- trunk/reactos/dll/cpl/inetcpl/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/inetcpl/lang/tr-TR.rc [iso-8859-1] Sun Nov 10 23:52:15 2013 @@ -34,14 +34,14 @@ BEGIN GROUPBOX " Ana Sayfa ", IDC_STATIC, 4, 4, 312, 52 - LTEXT "Ana sayfa olarak kullanilacak adresi degistirebilirsiniz.", + LTEXT "Ana sayfa olarak kullanılacak adresi deÄiÅtirebilirsiniz.", IDC_STATIC, 58, 10, 252, 10 EDITTEXT IDC_HOME_EDIT, 58, 22, 252, 12, WS_VISIBLE | ES_AUTOHSCROLL - PUSHBUTTON "&Simdiki Sayfa", IDC_HOME_CURRENT, 58, 36, 80, 14 - PUSHBUTTON "&Ãntanimli Sayfa", IDC_HOME_DEFAULT, 144, 36, 80, 14 - PUSHBUTTON "&Bos Sayfa", IDC_HOME_BLANK, 230, 36, 80, 14 - GROUPBOX " Tarama Geçmisi ", IDC_STATIC, 4, 60, 312, 46 - LTEXT "Saklanan sayfalari, yemisleri ve diger verileri silebilirsiniz.", + PUSHBUTTON "&Åimdiki Sayfa", IDC_HOME_CURRENT, 58, 36, 80, 14 + PUSHBUTTON "&Ãntanımlı Sayfa", IDC_HOME_DEFAULT, 144, 36, 80, 14 + PUSHBUTTON "&BoÅ Sayfa", IDC_HOME_BLANK, 230, 36, 80, 14 + GROUPBOX " Tarama GeçmiÅi ", IDC_STATIC, 4, 60, 312, 46 + LTEXT "Saklanan sayfaları, yemiÅleri ve diÄer verileri silebilirsiniz.", IDC_STATIC, 58, 72, 252, 10 PUSHBUTTON "&Kütükleri Sil...", IDC_HISTORY_DELETE, 144, 86, 80, 14 PUSHBUTTON "&Ayarlar...", IDC_HISTORY_SETTINGS, 230, 86, 80, 14 @@ -52,20 +52,20 @@ IDD_DELETE_HISTORY DIALOG 0, 0, 250, 250 STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" -CAPTION "Tarama Geçmisini Silme" +CAPTION "Tarama GeçmiÅini Silme" BEGIN - AUTOCHECKBOX "Geçici Ãrütbag Kütüleri:\nSaklanan sayfa sûretleri, resimler ve onay belgeleri.", + AUTOCHECKBOX "Geçici ÃrütbaÄ Kütüleri:\nSaklanan sayfa sûretleri, resimler ve onay belgeleri.", IDC_DELETE_TEMP_FILES, 10, 8, 230, 30, BS_TOP | BS_MULTILINE - AUTOCHECKBOX "Yemisler:\nÃrütbag siteleri eliyle bilgisayara kaydedilmis, kullanici yeglemeleri ve oturum açma bilgileri gibi seyleri saklayan kütükler.", + AUTOCHECKBOX "YemiÅler:\nÃrütbaÄ siteleri eliyle bilgisayara kaydedilmiÅ, kullanıcı yeÄlemeleri ve oturum açma bilgileri gibi Åeyleri saklayan kütükler.", IDC_DELETE_COOKIES, 10, 38, 230, 30, BS_TOP | BS_MULTILINE - AUTOCHECKBOX "Geçmis:\nErisilen sayfalarin dizelgesi.", + AUTOCHECKBOX "GeçmiÅ:\nEriÅilen sayfaların dizelgesi.", IDC_DELETE_HISTORY, 10, 68, 230, 30, BS_TOP | BS_MULTILINE - AUTOCHECKBOX "Form Verileri:\nFormlarda girilen kullanici adlari ve diger bilgiler.", + AUTOCHECKBOX "Form Verileri:\nFormlarda girilen kullanıcı adları ve diÄer bilgiler.", IDC_DELETE_FORM_DATA, 10, 98, 230, 30, BS_TOP | BS_MULTILINE - AUTOCHECKBOX "Sifreler:\nFormlarda girilen sifreler.", + AUTOCHECKBOX "Åifreler:\nFormlarda girilen Åifreler.", IDC_DELETE_PASSWORDS, 10, 128, 230, 30, BS_TOP | BS_MULTILINE - DEFPUSHBUTTON "Iptal", IDCANCEL, 185, 230, 60, 15, WS_GROUP + DEFPUSHBUTTON "Ä°ptal", IDCANCEL, 185, 230, 60, 15, WS_GROUP PUSHBUTTON "Tamam (Sil)", IDOK, 120, 230, 60, 15, WS_GROUP END @@ -92,26 +92,26 @@ IDD_CONTENT DIALOG 0, 0, 320, 220 STYLE WS_CAPTION | WS_CHILD | WS_DISABLED FONT 8, "MS Shell Dlg" -CAPTION "Içerik" +CAPTION "İçerik" BEGIN GROUPBOX " Onay Belgeleri ", IDC_STATIC, 4, 4, 312, 50 - LTEXT "Onay belgeleri, sahsî tanilamada ve yetkili kisilerle yayimcilari tanimada kullanilir.", + LTEXT "Onay belgeleri, Åahsî tanılamada ve yetkili kiÅilerle yayımcıları tanımada kullanılır.", IDC_STATIC, 58, 14, 252, 18 PUSHBUTTON "&Onay Belgeleri...", IDC_CERT, 146, 34, 80, 14 - PUSHBUTTON "&Yayimcilar...", IDC_CERT_PUBLISHER, 230, 34, 80, 14 + PUSHBUTTON "&Yayımcılar...", IDC_CERT_PUBLISHER, 230, 34, 80, 14 END STRINGTABLE BEGIN - IDS_CPL_NAME "Ãrütbag Ayarlari" - IDS_CPL_INFO "Wine Ãrütbag Tarayicisi'ni ve bununla iliskili ayarlari yapilandirir." - IDS_SEC_SETTINGS "Bölgeye Göre Güvenlik Ayarlari: " - IDS_SEC_LEVEL0 "Degisik" - IDS_SEC_LEVEL1 "Ãok Düsük" - IDS_SEC_LEVEL2 "Düsük" + IDS_CPL_NAME "ÃrütbaÄ Ayarları" + IDS_CPL_INFO "Wine ÃrütbaÄ Tarayıcısı'nı ve bununla iliÅkili ayarları yapılandırır." + IDS_SEC_SETTINGS "Bölgeye Göre Güvenlik Ayarları: " + IDS_SEC_LEVEL0 "DeÄiÅik" + IDS_SEC_LEVEL1 "Ãok DüÅük" + IDS_SEC_LEVEL2 "DüÅük" IDS_SEC_LEVEL3 "Orta" - IDS_SEC_LEVEL4 "Yükseltilmis" + IDS_SEC_LEVEL4 "YükseltilmiÅ" IDS_SEC_LEVEL5 "Yüksek" END
11 years, 1 month
1
0
0
0
[aandrejevic] 60927: [FAST486] Don't mix up ADSIZE and OPSIZE (continued).
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Nov 10 23:42:57 2013 New Revision: 60927 URL:
http://svn.reactos.org/svn/reactos?rev=60927&view=rev
Log: [FAST486] Don't mix up ADSIZE and OPSIZE (continued). Modified: branches/ntvdm/lib/fast486/opcodes.c Modified: branches/ntvdm/lib/fast486/opcodes.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opcodes.c?rev…
============================================================================== --- branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] Sun Nov 10 23:42:57 2013 @@ -5133,15 +5133,15 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovAlOffset) { - BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; ULONG Offset; /* Make sure this is the right instruction */ ASSERT(Opcode == 0xA0); - TOGGLE_OPSIZE(Size); - - if (Size) + TOGGLE_ADSIZE(AddressSize); + + if (AddressSize) { if (!Fast486FetchDword(State, &Offset)) { @@ -5174,14 +5174,17 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovEaxOffset) { - BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN OperandSize, AddressSize; + + OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; /* Make sure this is the right instruction */ ASSERT(Opcode == 0xA1); - TOGGLE_OPSIZE(Size); - - if (Size) + TOGGLE_OPSIZE(OperandSize); + TOGGLE_ADSIZE(AddressSize); + + if (AddressSize) { ULONG Offset; @@ -5192,13 +5195,26 @@ } /* Read from memory */ - return Fast486ReadMemory(State, - (State->PrefixFlags & FAST486_PREFIX_SEG) ? - State->SegmentOverride : FAST486_REG_DS, - Offset, - FALSE, - &State->GeneralRegs[FAST486_REG_EAX].Long, - sizeof(ULONG)); + if (OperandSize) + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].Long, + sizeof(ULONG)); + } + else + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].LowWord, + sizeof(USHORT)); + } } else { @@ -5211,13 +5227,26 @@ } /* Read from memory */ - return Fast486ReadMemory(State, - (State->PrefixFlags & FAST486_PREFIX_SEG) ? - State->SegmentOverride : FAST486_REG_DS, - Offset, - FALSE, - &State->GeneralRegs[FAST486_REG_EAX].LowWord, - sizeof(USHORT)); + if (OperandSize) + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].Long, + sizeof(ULONG)); + } + else + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].LowWord, + sizeof(USHORT)); + } } }
11 years, 1 month
1
0
0
0
[aandrejevic] 60926: [FAST486] Don't mix up ADSIZE and OPSIZE.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Nov 10 23:34:34 2013 New Revision: 60926 URL:
http://svn.reactos.org/svn/reactos?rev=60926&view=rev
Log: [FAST486] Don't mix up ADSIZE and OPSIZE. Modified: branches/ntvdm/lib/fast486/opcodes.c Modified: branches/ntvdm/lib/fast486/opcodes.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opcodes.c?rev…
============================================================================== --- branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] Sun Nov 10 23:34:34 2013 @@ -5223,15 +5223,15 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetAl) { - BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; ULONG Offset; /* Make sure this is the right instruction */ ASSERT(Opcode == 0xA2); - TOGGLE_OPSIZE(Size); - - if (Size) + TOGGLE_ADSIZE(AddressSize); + + if (AddressSize) { if (!Fast486FetchDword(State, &Offset)) { @@ -5263,14 +5263,17 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax) { - BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN OperandSize, AddressSize; + + OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; /* Make sure this is the right instruction */ ASSERT(Opcode == 0xA3); - TOGGLE_OPSIZE(Size); - - if (Size) + TOGGLE_OPSIZE(OperandSize); + TOGGLE_ADSIZE(AddressSize); + + if (AddressSize) { ULONG Offset; @@ -5281,12 +5284,24 @@ } /* Write to memory */ - return Fast486WriteMemory(State, - (State->PrefixFlags & FAST486_PREFIX_SEG) ? - State->SegmentOverride : FAST486_REG_DS, - Offset, - &State->GeneralRegs[FAST486_REG_EAX].Long, - sizeof(ULONG)); + if (OperandSize) + { + return Fast486WriteMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + &State->GeneralRegs[FAST486_REG_EAX].Long, + sizeof(ULONG)); + } + else + { + return Fast486WriteMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + &State->GeneralRegs[FAST486_REG_EAX].LowWord, + sizeof(USHORT)); + } } else { @@ -5299,12 +5314,24 @@ } /* Write to memory */ - return Fast486WriteMemory(State, - (State->PrefixFlags & FAST486_PREFIX_SEG) ? - State->SegmentOverride : FAST486_REG_DS, - Offset, - &State->GeneralRegs[FAST486_REG_EAX].LowWord, - sizeof(USHORT)); + if (OperandSize) + { + return Fast486WriteMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + &State->GeneralRegs[FAST486_REG_EAX].Long, + sizeof(ULONG)); + } + else + { + return Fast486WriteMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + &State->GeneralRegs[FAST486_REG_EAX].LowWord, + sizeof(USHORT)); + } } }
11 years, 1 month
1
0
0
0
[aandrejevic] 60925: [FAST486] Increment SP, not ESP for 16-bit stacks.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Nov 10 22:49:19 2013 New Revision: 60925 URL:
http://svn.reactos.org/svn/reactos?rev=60925&view=rev
Log: [FAST486] Increment SP, not ESP for 16-bit stacks. Modified: branches/ntvdm/lib/fast486/common.inl Modified: branches/ntvdm/lib/fast486/common.inl URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.inl?re…
============================================================================== --- branches/ntvdm/lib/fast486/common.inl [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/common.inl [iso-8859-1] Sun Nov 10 22:49:19 2013 @@ -365,7 +365,7 @@ } /* Increment SP by 2 */ - State->GeneralRegs[FAST486_REG_ESP].Long += 2; + State->GeneralRegs[FAST486_REG_ESP].LowWord += 2; /* Store the value in the result */ *Value = ShortValue;
11 years, 1 month
1
0
0
0
[tfaber] 60924: [WIN32K] - Do not leak process references (In|De)crementGdiHandleCount. CORE-7565 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Nov 10 22:31:01 2013 New Revision: 60924 URL:
http://svn.reactos.org/svn/reactos?rev=60924&view=rev
Log: [WIN32K] - Do not leak process references (In|De)crementGdiHandleCount. CORE-7565 #resolve Modified: trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c Modified: trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] Sun Nov 10 22:31:01 2013 @@ -249,6 +249,7 @@ ppi = PsGetProcessWin32Process(pep); if (ppi) InterlockedIncrement((LONG*)&ppi->GDIHandleCount); + if (NT_SUCCESS(Status)) ObDereferenceObject(pep); } FORCEINLINE @@ -264,6 +265,7 @@ ppi = PsGetProcessWin32Process(pep); if (ppi) InterlockedDecrement((LONG*)&ppi->GDIHandleCount); + if (NT_SUCCESS(Status)) ObDereferenceObject(pep); } static
11 years, 1 month
1
0
0
0
[aandrejevic] 60923: [FAST486] Modularize linear memory access by adding two new functions: Fast486ReadLinearMemory and Fast486WriteLinearMemory. Implement Fast486GetPageTableEntry.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Nov 10 22:27:24 2013 New Revision: 60923 URL:
http://svn.reactos.org/svn/reactos?rev=60923&view=rev
Log: [FAST486] Modularize linear memory access by adding two new functions: Fast486ReadLinearMemory and Fast486WriteLinearMemory. Implement Fast486GetPageTableEntry. Modified: branches/ntvdm/include/reactos/libs/fast486/fast486.h branches/ntvdm/lib/fast486/common.c branches/ntvdm/lib/fast486/common.h branches/ntvdm/lib/fast486/common.inl branches/ntvdm/lib/fast486/fast486.c branches/ntvdm/subsystems/ntvdm/emulator.c Modified: branches/ntvdm/include/reactos/libs/fast486/fast486.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/libs/fast…
============================================================================== --- branches/ntvdm/include/reactos/libs/fast486/fast486.h [iso-8859-1] (original) +++ branches/ntvdm/include/reactos/libs/fast486/fast486.h [iso-8859-1] Sun Nov 10 22:27:24 2013 @@ -401,6 +401,7 @@ FAST486_SEG_REGS SegmentOverride; FAST486_INT_STATUS IntStatus; UCHAR PendingIntNum; + PULONG Tlb; }; /* FUNCTIONS ******************************************************************/ @@ -414,7 +415,8 @@ FAST486_IO_WRITE_PROC IoWriteCallback, FAST486_IDLE_PROC IdleCallback, FAST486_BOP_PROC BopCallback, - FAST486_INT_ACK_PROC IntAckCallback); + FAST486_INT_ACK_PROC IntAckCallback, + PULONG Tlb); VOID NTAPI Modified: branches/ntvdm/lib/fast486/common.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.c?rev=…
============================================================================== --- branches/ntvdm/lib/fast486/common.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/common.c [iso-8859-1] Sun Nov 10 22:27:24 2013 @@ -29,19 +29,6 @@ #include <fast486.h> #include "common.h" -/* PRIVATE FUNCTIONS **********************************************************/ - -static inline -ULONG -Fast486GetPageTableEntry(PFAST486_STATE State, - ULONG VirtualAddress) -{ - // TODO: NOT IMPLEMENTED - UNIMPLEMENTED; - - return 0; -} - /* PUBLIC FUNCTIONS ***********************************************************/ BOOLEAN @@ -54,7 +41,6 @@ { ULONG LinearAddress; PFAST486_SEG_REG CachedDescriptor; - INT Cpl = Fast486GetCurrentPrivLevel(State); ASSERT(SegmentReg < FAST486_NUM_SEG_REGS); @@ -108,58 +94,8 @@ /* Find the linear address */ LinearAddress = CachedDescriptor->Base + Offset; - /* Check if paging is enabled */ - if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PG) - { - ULONG Page; - FAST486_PAGE_TABLE TableEntry; - - for (Page = PAGE_ALIGN(LinearAddress); - Page <= PAGE_ALIGN(LinearAddress + Size - 1); - Page += PAGE_SIZE) - { - ULONG PageOffset = 0, PageLength = PAGE_SIZE; - - /* Get the table entry */ - TableEntry.Value = Fast486GetPageTableEntry(State, Page); - - if (!TableEntry.Present || (!TableEntry.Usermode && (Cpl > 0))) - { - /* Exception */ - Fast486ExceptionWithErrorCode(State, - FAST486_EXCEPTION_PF, - TableEntry.Value & 0x07); - return FALSE; - } - - /* Check if this is the first page */ - if (Page == PAGE_ALIGN(LinearAddress)) - { - /* Start copying from the offset from the beginning of the page */ - PageOffset = PAGE_OFFSET(LinearAddress); - } - - /* Check if this is the last page */ - if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) - { - /* Copy only a part of the page */ - PageLength = PAGE_OFFSET(LinearAddress + Size); - } - - /* Read the memory */ - State->MemReadCallback(State, - (TableEntry.Address << 12) | PageOffset, - Buffer, - PageLength); - } - } - else - { - /* Read the memory */ - State->MemReadCallback(State, LinearAddress, Buffer, Size); - } - - return TRUE; + /* Read from the linear address */ + return Fast486ReadLinearMemory(State, LinearAddress, Buffer, Size); } BOOLEAN @@ -171,7 +107,6 @@ { ULONG LinearAddress; PFAST486_SEG_REG CachedDescriptor; - INT Cpl = Fast486GetCurrentPrivLevel(State); ASSERT(SegmentReg < FAST486_NUM_SEG_REGS); @@ -220,60 +155,8 @@ /* Find the linear address */ LinearAddress = CachedDescriptor->Base + Offset; - /* Check if paging is enabled */ - if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PG) - { - ULONG Page; - FAST486_PAGE_TABLE TableEntry; - - for (Page = PAGE_ALIGN(LinearAddress); - Page <= PAGE_ALIGN(LinearAddress + Size - 1); - Page += PAGE_SIZE) - { - ULONG PageOffset = 0, PageLength = PAGE_SIZE; - - /* Get the table entry */ - TableEntry.Value = Fast486GetPageTableEntry(State, Page); - - if ((!TableEntry.Present || (!TableEntry.Usermode && (Cpl > 0))) - || ((State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_WP) - && !TableEntry.Writeable)) - { - /* Exception */ - Fast486ExceptionWithErrorCode(State, - FAST486_EXCEPTION_PF, - TableEntry.Value & 0x07); - return FALSE; - } - - /* Check if this is the first page */ - if (Page == PAGE_ALIGN(LinearAddress)) - { - /* Start copying from the offset from the beginning of the page */ - PageOffset = PAGE_OFFSET(LinearAddress); - } - - /* Check if this is the last page */ - if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) - { - /* Copy only a part of the page */ - PageLength = PAGE_OFFSET(LinearAddress + Size); - } - - /* Write the memory */ - State->MemWriteCallback(State, - (TableEntry.Address << 12) | PageOffset, - Buffer, - PageLength); - } - } - else - { - /* Write the memory */ - State->MemWriteCallback(State, LinearAddress, Buffer, Size); - } - - return TRUE; + /* Write to the linear address */ + return Fast486WriteLinearMemory(State, LinearAddress, Buffer, Size); } BOOLEAN @@ -293,11 +176,14 @@ if (Fast486GetCurrentPrivLevel(State) > GET_SEGMENT_RPL(SegmentSelector)) { /* Read the TSS */ - // FIXME: This code is only correct when paging is disabled!!! - State->MemReadCallback(State, - State->Tss.Address, - &Tss, - sizeof(Tss)); + if (!Fast486ReadLinearMemory(State, + State->Tss.Address, + &Tss, + sizeof(Tss))) + { + /* Exception occurred */ + return FALSE; + } /* Check the new (higher) privilege level */ switch (GET_SEGMENT_RPL(SegmentSelector)) Modified: branches/ntvdm/lib/fast486/common.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.h?rev=…
============================================================================== --- branches/ntvdm/lib/fast486/common.h [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/common.h [iso-8859-1] Sun Nov 10 22:27:24 2013 @@ -56,6 +56,9 @@ #define PAGE_ALIGN(x) ((x) & 0xFFFFF000) #define PAGE_OFFSET(x) ((x) & 0x00000FFF) +#define GET_ADDR_PDE(x) ((x) >> 22) +#define GET_ADDR_PTE(x) (((x) >> 12) & 0x3FF) +#define INVALID_TLB_FIELD 0xFFFFFFFF #ifndef PAGE_SIZE #define PAGE_SIZE 4096 @@ -92,6 +95,8 @@ ULONG Value; } FAST486_PAGE_DIR, *PFAST486_PAGE_DIR; +C_ASSERT(sizeof(FAST486_PAGE_DIR) == sizeof(ULONG)); + typedef union _FAST486_PAGE_TABLE { struct @@ -110,6 +115,8 @@ }; ULONG Value; } FAST486_PAGE_TABLE, *PFAST486_PAGE_TABLE; + +C_ASSERT(sizeof(FAST486_PAGE_DIR) == sizeof(ULONG)); #pragma pack(pop) Modified: branches/ntvdm/lib/fast486/common.inl URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.inl?re…
============================================================================== --- branches/ntvdm/lib/fast486/common.inl [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/common.inl [iso-8859-1] Sun Nov 10 22:27:24 2013 @@ -19,7 +19,221 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "common.h" + /* PUBLIC FUNCTIONS ***********************************************************/ + +FORCEINLINE +ULONG +Fast486GetPageTableEntry(PFAST486_STATE State, + ULONG VirtualAddress, + BOOLEAN MarkAsDirty) +{ + ULONG PdeIndex = GET_ADDR_PDE(VirtualAddress); + ULONG PteIndex = GET_ADDR_PTE(VirtualAddress); + FAST486_PAGE_DIR DirectoryEntry; + FAST486_PAGE_TABLE TableEntry; + ULONG PageDirectory = State->ControlRegisters[FAST486_REG_CR3]; + + if ((State->Tlb != NULL) + && (State->Tlb[VirtualAddress >> 12] != INVALID_TLB_FIELD)) + { + /* Return the cached entry */ + return State->Tlb[VirtualAddress >> 12]; + } + + /* Read the directory entry */ + State->MemReadCallback(State, + PageDirectory + PdeIndex * sizeof(ULONG), + &DirectoryEntry.Value, + sizeof(DirectoryEntry)); + + /* Make sure it is present */ + if (!DirectoryEntry.Present) return 0; + + /* Was the directory entry accessed before? */ + if (!DirectoryEntry.Accessed) + { + /* Well, it is now */ + DirectoryEntry.Accessed = TRUE; + + /* Write back the directory entry */ + State->MemWriteCallback(State, + PageDirectory + PdeIndex * sizeof(ULONG), + &DirectoryEntry.Value, + sizeof(DirectoryEntry)); + } + + /* Read the table entry */ + State->MemReadCallback(State, + (DirectoryEntry.TableAddress << 12) + + PteIndex * sizeof(ULONG), + &TableEntry.Value, + sizeof(TableEntry)); + + /* Make sure it is present */ + if (!TableEntry.Present) return 0; + + if (MarkAsDirty) TableEntry.Dirty = TRUE; + + /* Was the table entry accessed before? */ + if (!TableEntry.Accessed) + { + /* Well, it is now */ + TableEntry.Accessed = TRUE; + + /* Write back the table entry */ + State->MemWriteCallback(State, + (DirectoryEntry.TableAddress << 12) + + PteIndex * sizeof(ULONG), + &TableEntry.Value, + sizeof(TableEntry)); + } + + /* + * The resulting permissions depend on the permissions + * in the page directory table too + */ + TableEntry.Writeable &= DirectoryEntry.Writeable; + TableEntry.Usermode &= DirectoryEntry.Usermode; + + if (State->Tlb != NULL) + { + /* Set the TLB entry */ + State->Tlb[VirtualAddress >> 12] = TableEntry.Value; + } + + /* Return the table entry */ + return TableEntry.Value; +} + +FORCEINLINE +BOOLEAN +Fast486ReadLinearMemory(PFAST486_STATE State, + ULONG LinearAddress, + PVOID Buffer, + ULONG Size) +{ + INT Cpl = Fast486GetCurrentPrivLevel(State); + + /* Check if paging is enabled */ + if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PG) + { + ULONG Page; + FAST486_PAGE_TABLE TableEntry; + + for (Page = PAGE_ALIGN(LinearAddress); + Page <= PAGE_ALIGN(LinearAddress + Size - 1); + Page += PAGE_SIZE) + { + ULONG PageOffset = 0, PageLength = PAGE_SIZE; + + /* Get the table entry */ + TableEntry.Value = Fast486GetPageTableEntry(State, Page, FALSE); + + if (!TableEntry.Present || (!TableEntry.Usermode && (Cpl > 0))) + { + /* Exception */ + Fast486ExceptionWithErrorCode(State, + FAST486_EXCEPTION_PF, + TableEntry.Value & 0x07); + return FALSE; + } + + /* Check if this is the first page */ + if (Page == PAGE_ALIGN(LinearAddress)) + { + /* Start copying from the offset from the beginning of the page */ + PageOffset = PAGE_OFFSET(LinearAddress); + } + + /* Check if this is the last page */ + if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) + { + /* Copy only a part of the page */ + PageLength = PAGE_OFFSET(LinearAddress + Size); + } + + /* Read the memory */ + State->MemReadCallback(State, + (TableEntry.Address << 12) | PageOffset, + Buffer, + PageLength); + } + } + else + { + /* Read the memory */ + State->MemReadCallback(State, LinearAddress, Buffer, Size); + } + + return TRUE; +} + +FORCEINLINE +BOOLEAN +Fast486WriteLinearMemory(PFAST486_STATE State, + ULONG LinearAddress, + PVOID Buffer, + ULONG Size) +{ + INT Cpl = Fast486GetCurrentPrivLevel(State); + + /* Check if paging is enabled */ + if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PG) + { + ULONG Page; + FAST486_PAGE_TABLE TableEntry; + + for (Page = PAGE_ALIGN(LinearAddress); + Page <= PAGE_ALIGN(LinearAddress + Size - 1); + Page += PAGE_SIZE) + { + ULONG PageOffset = 0, PageLength = PAGE_SIZE; + + /* Get the table entry */ + TableEntry.Value = Fast486GetPageTableEntry(State, Page, TRUE); + + if ((!TableEntry.Present || (!TableEntry.Usermode && (Cpl > 0))) + || ((State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_WP) + && !TableEntry.Writeable)) + { + /* Exception */ + Fast486ExceptionWithErrorCode(State, + FAST486_EXCEPTION_PF, + TableEntry.Value & 0x07); + return FALSE; + } + + /* Check if this is the first page */ + if (Page == PAGE_ALIGN(LinearAddress)) + { + /* Start copying from the offset from the beginning of the page */ + PageOffset = PAGE_OFFSET(LinearAddress); + } + + /* Check if this is the last page */ + if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) + { + /* Copy only a part of the page */ + PageLength = PAGE_OFFSET(LinearAddress + Size); + } + + /* Write the memory */ + State->MemWriteCallback(State, + (TableEntry.Address << 12) | PageOffset, + Buffer, + PageLength); + } + } + else + { + /* Write the memory */ + State->MemWriteCallback(State, LinearAddress, Buffer, Size); + } + + return TRUE; +} FORCEINLINE VOID @@ -185,12 +399,15 @@ } /* Read the GDT */ - // FIXME: This code is only correct when paging is disabled!!! - State->MemReadCallback(State, - State->Gdtr.Address - + GET_SEGMENT_INDEX(Selector), - &GdtEntry, - sizeof(GdtEntry)); + if (!Fast486ReadLinearMemory(State, + State->Gdtr.Address + + GET_SEGMENT_INDEX(Selector), + &GdtEntry, + sizeof(GdtEntry))) + { + /* Exception occurred */ + return FALSE; + } if (Segment == FAST486_REG_SS) { @@ -388,12 +605,15 @@ if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE) { /* Read from the IDT */ - // FIXME: This code is only correct when paging is disabled!!! - State->MemReadCallback(State, - State->Idtr.Address - + Number * sizeof(*IdtEntry), - IdtEntry, - sizeof(*IdtEntry)); + if (!Fast486ReadLinearMemory(State, + State->Idtr.Address + + Number * sizeof(*IdtEntry), + IdtEntry, + sizeof(*IdtEntry))) + { + /* Exception occurred */ + return FALSE; + } } else { @@ -417,10 +637,6 @@ IdtEntry->OffsetHigh = 0; } - /* - * Once paging support is implemented this function - * will not always return true - */ return TRUE; } Modified: branches/ntvdm/lib/fast486/fast486.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fast486.c?rev…
============================================================================== --- branches/ntvdm/lib/fast486/fast486.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fast486.c [iso-8859-1] Sun Nov 10 22:27:24 2013 @@ -203,7 +203,8 @@ FAST486_IO_WRITE_PROC IoWriteCallback, FAST486_IDLE_PROC IdleCallback, FAST486_BOP_PROC BopCallback, - FAST486_INT_ACK_PROC IntAckCallback) + FAST486_INT_ACK_PROC IntAckCallback, + PULONG Tlb) { /* Set the callbacks (or use default ones if some are NULL) */ State->MemReadCallback = (MemReadCallback ? MemReadCallback : Fast486MemReadCallback ); @@ -214,6 +215,9 @@ State->BopCallback = (BopCallback ? BopCallback : Fast486BopCallback ); State->IntAckCallback = (IntAckCallback ? IntAckCallback : Fast486IntAckCallback ); + /* Set the TLB (if given) */ + State->Tlb = Tlb; + /* Reset the CPU */ Fast486Reset(State); } @@ -231,6 +235,7 @@ FAST486_IDLE_PROC IdleCallback = State->IdleCallback; FAST486_BOP_PROC BopCallback = State->BopCallback; FAST486_INT_ACK_PROC IntAckCallback = State->IntAckCallback; + PULONG Tlb = State->Tlb; /* Clear the entire structure */ RtlZeroMemory(State, sizeof(*State)); @@ -266,7 +271,7 @@ /* Initialize CR0 */ State->ControlRegisters[FAST486_REG_CR0] |= FAST486_CR0_ET; - /* Restore the callbacks */ + /* Restore the callbacks and TLB */ State->MemReadCallback = MemReadCallback; State->MemWriteCallback = MemWriteCallback; State->IoReadCallback = IoReadCallback; @@ -274,6 +279,7 @@ State->IdleCallback = IdleCallback; State->BopCallback = BopCallback; State->IntAckCallback = IntAckCallback; + State->Tlb = Tlb; } VOID Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Sun Nov 10 22:27:24 2013 @@ -296,7 +296,8 @@ EmulatorWriteIo, NULL, EmulatorBiosOperation, - EmulatorIntAcknowledge); + EmulatorIntAcknowledge, + NULL /* TODO: Use a TLB */); /* Enable interrupts */ EmulatorSetFlag(EMULATOR_FLAG_IF);
11 years, 1 month
1
0
0
0
[tfaber] 60922: [CLASSPNP] - Do not disable compiler warnings - Fix a ton of them
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Nov 10 20:54:19 2013 New Revision: 60922 URL:
http://svn.reactos.org/svn/reactos?rev=60922&view=rev
Log: [CLASSPNP] - Do not disable compiler warnings - Fix a ton of them Modified: trunk/reactos/drivers/storage/classpnp/CMakeLists.txt trunk/reactos/drivers/storage/classpnp/autorun.c trunk/reactos/drivers/storage/classpnp/class.c trunk/reactos/drivers/storage/classpnp/classp.h trunk/reactos/drivers/storage/classpnp/create.c trunk/reactos/drivers/storage/classpnp/debug.c trunk/reactos/drivers/storage/classpnp/debug.h trunk/reactos/drivers/storage/classpnp/power.c trunk/reactos/drivers/storage/classpnp/utils.c trunk/reactos/drivers/storage/classpnp/xferpkt.c trunk/reactos/include/ddk/classpnp.h Modified: trunk/reactos/drivers/storage/classpnp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/C…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/CMakeLists.txt [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -34,11 +34,8 @@ if(ARCH STREQUAL "i386") # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
- if(MSVC) - #add_target_compile_flags(classpnp "/Gz") - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "/Gz") - else() - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-w") + if(NOT MSVC) + set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=switch") endif() endif() Modified: trunk/reactos/drivers/storage/classpnp/autorun.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/a…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/autorun.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/autorun.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -103,12 +103,7 @@ IN ULONG CountDown ); -VOID -NTAPI -ClasspFailurePredict( - IN PDEVICE_OBJECT DeviceObject, - IN PFAILURE_PREDICTION_INFO Info - ); +IO_WORKITEM_ROUTINE ClasspFailurePredict; NTSTATUS NTAPI @@ -489,7 +484,7 @@ SET_FLAG(FdoExtension->DeviceObject->Flags, DO_VERIFY_VOLUME); } - InterlockedIncrement(&FdoExtension->MediaChangeCount); + InterlockedIncrement((PLONG)&FdoExtension->MediaChangeCount); ClasspSetMediaChangeStateEx(FdoExtension, MediaPresent, FALSE, @@ -599,7 +594,7 @@ ) { #if DBG - PUCHAR states[] = {"Unknown", "Present", "Not Present"}; + PCSTR states[] = {"Unknown", "Present", "Not Present"}; #endif MEDIA_CHANGE_DETECTION_STATE oldMediaState; PMEDIA_CHANGE_DETECTION_INFO info = FdoExtension->MediaChangeDetectionInfo; @@ -818,9 +813,10 @@ ClasspMediaChangeDetectionCompletion( PDEVICE_OBJECT DeviceObject, PIRP Irp, - PSCSI_REQUEST_BLOCK Srb + PVOID Context ) { + PSCSI_REQUEST_BLOCK srb = Context; PFUNCTIONAL_DEVICE_EXTENSION fdoExtension; PCLASS_PRIVATE_FDO_DATA fdoData; PMEDIA_CHANGE_DETECTION_INFO info; @@ -840,7 +836,7 @@ info = fdoExtension->MediaChangeDetectionInfo; ASSERT(info->MediaChangeIrp != NULL); - ASSERT(!TEST_FLAG(Srb->SrbStatus, SRB_STATUS_QUEUE_FROZEN)); + ASSERT(!TEST_FLAG(srb->SrbStatus, SRB_STATUS_QUEUE_FROZEN)); DBGTRACE(ClassDebugMCN, ("> ClasspMediaChangeDetectionCompletion: Device %p completed MCN irp %p.", DeviceObject, Irp)); /* @@ -855,15 +851,15 @@ * This hack only applies to drives with the CAUSE_NOT_REPORTABLE_HACK bit set; this * is set by disk.sys when HackCauseNotReportableHack is set for the drive in its BadControllers list. */ - if ((SRB_STATUS(Srb->SrbStatus) != SRB_STATUS_SUCCESS) && + if ((SRB_STATUS(srb->SrbStatus) != SRB_STATUS_SUCCESS) && TEST_FLAG(fdoExtension->ScanForSpecialFlags, CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK) && - (Srb->SenseInfoBufferLength >= RTL_SIZEOF_THROUGH_FIELD(SENSE_DATA, AdditionalSenseCode))){ - - PSENSE_DATA senseData = Srb->SenseInfoBuffer; + (srb->SenseInfoBufferLength >= RTL_SIZEOF_THROUGH_FIELD(SENSE_DATA, AdditionalSenseCode))){ + + PSENSE_DATA senseData = srb->SenseInfoBuffer; if ((senseData->SenseKey == SCSI_SENSE_NOT_READY) && (senseData->AdditionalSenseCode == SCSI_ADSENSE_LUN_NOT_READY)){ - Srb->SrbStatus = SRB_STATUS_SUCCESS; + srb->SrbStatus = SRB_STATUS_SUCCESS; } } @@ -873,12 +869,12 @@ // to call ClassError() with correct parameters. // status = STATUS_SUCCESS; - if (SRB_STATUS(Srb->SrbStatus) != SRB_STATUS_SUCCESS) { - - DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion - failed - srb status=%s, sense=%s/%s/%s.", DBGGETSRBSTATUSSTR(Srb), DBGGETSENSECODESTR(Srb), DBGGETADSENSECODESTR(Srb), DBGGETADSENSEQUALIFIERSTR(Srb))); + if (SRB_STATUS(srb->SrbStatus) != SRB_STATUS_SUCCESS) { + + DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion - failed - srb status=%s, sense=%s/%s/%s.", DBGGETSRBSTATUSSTR(srb), DBGGETSENSECODESTR(srb), DBGGETADSENSECODESTR(srb), DBGGETADSENSEQUALIFIERSTR(srb))); ClassInterpretSenseInfo(DeviceObject, - Srb, + srb, IRP_MJ_SCSI, 0, 0, @@ -936,8 +932,8 @@ // free port-allocated sense buffer, if any. // - if (PORT_ALLOCATED_SENSE(fdoExtension, Srb)) { - FREE_PORT_ALLOCATED_SENSE_BUFFER(fdoExtension, Srb); + if (PORT_ALLOCATED_SENSE(fdoExtension, srb)) { + FREE_PORT_ALLOCATED_SENSE_BUFFER(fdoExtension, srb); } // @@ -945,7 +941,7 @@ // ASSERT(IoGetNextIrpStackLocation(Irp)); - IoGetNextIrpStackLocation(Irp)->Parameters.Scsi.Srb = Srb; + IoGetNextIrpStackLocation(Irp)->Parameters.Scsi.Srb = srb; // // Reset the MCN timer. @@ -2394,9 +2390,9 @@ // PWSTR nullMultiSz; - PUCHAR vendorId; - PUCHAR productId; - PUCHAR revisionId; + PCSTR vendorId; + PCSTR productId; + PCSTR revisionId; ULONG length; ULONG offset; @@ -2417,21 +2413,21 @@ if (deviceDescriptor->VendorIdOffset == 0) { vendorId = NULL; } else { - vendorId = (PUCHAR) deviceDescriptor + deviceDescriptor->VendorIdOffset; + vendorId = (PCSTR) deviceDescriptor + deviceDescriptor->VendorIdOffset; length = strlen(vendorId); } if ( deviceDescriptor->ProductIdOffset == 0 ) { productId = NULL; } else { - productId = (PUCHAR) deviceDescriptor + deviceDescriptor->ProductIdOffset; + productId = (PCSTR) deviceDescriptor + deviceDescriptor->ProductIdOffset; length += strlen(productId); } if ( deviceDescriptor->ProductRevisionOffset == 0 ) { revisionId = NULL; } else { - revisionId = (PUCHAR) deviceDescriptor + deviceDescriptor->ProductRevisionOffset; + revisionId = (PCSTR) deviceDescriptor + deviceDescriptor->ProductRevisionOffset; length += strlen(revisionId); } @@ -2441,10 +2437,10 @@ deviceString.Length = (USHORT)( length ); deviceString.MaximumLength = deviceString.Length + 1; - deviceString.Buffer = (PUCHAR)ExAllocatePoolWithTag( NonPagedPool, - deviceString.MaximumLength, - CLASS_TAG_AUTORUN_DISABLE - ); + deviceString.Buffer = ExAllocatePoolWithTag( NonPagedPool, + deviceString.MaximumLength, + CLASS_TAG_AUTORUN_DISABLE + ); if (deviceString.Buffer == NULL) { DebugPrint((ClassDebugMCN, "ClassMediaChangeDisabledForHardware: Unable to alloc " @@ -2941,7 +2937,7 @@ // ClassDisableMediaChangeDetection(FdoExtension); - InterlockedIncrement(&(fsContext->McnDisableCount)); + InterlockedIncrement((PLONG)&fsContext->McnDisableCount); } else { @@ -2950,7 +2946,7 @@ LEAVE; } - InterlockedDecrement(&(fsContext->McnDisableCount)); + InterlockedDecrement((PLONG)&fsContext->McnDisableCount); ClassEnableMediaChangeDetection(FdoExtension); } @@ -3144,7 +3140,7 @@ // resets CountDown uses InterlockedExchange which is also // atomic. // - countDown = InterlockedDecrement(&info->CountDown); + countDown = InterlockedDecrement((PLONG)&info->CountDown); if (countDown == 0) { DebugPrint((4, "ClasspTimerTick: Send FP irp for %p\n", @@ -3165,7 +3161,7 @@ DebugPrint((1, "ClassTimerTick: Couldn't allocate " "item - try again in one minute\n")); - InterlockedExchange(&info->CountDown, 60); + InterlockedExchange((PLONG)&info->CountDown, 60); } else { @@ -3343,9 +3339,10 @@ NTAPI ClasspFailurePredict( IN PDEVICE_OBJECT DeviceObject, - IN PFAILURE_PREDICTION_INFO Info + IN PVOID Context ) { + PFAILURE_PREDICTION_INFO info = Context; PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = DeviceObject->DeviceExtension; PIO_WORKITEM workItem; STORAGE_PREDICT_FAILURE checkFailure; @@ -3353,7 +3350,7 @@ NTSTATUS status; - ASSERT(Info != NULL); + ASSERT(info != NULL); DebugPrint((1, "ClasspFailurePredict: Polling for failure\n")); @@ -3364,8 +3361,8 @@ // the lock. // - InterlockedExchange(&Info->CountDown, Info->Period); - workItem = InterlockedExchangePointer(&(Info->WorkQueueItem), NULL); + InterlockedExchange((PLONG)&info->CountDown, info->Period); + workItem = InterlockedExchangePointer(&info->WorkQueueItem, NULL); if (ClasspCanSendPollingIrp(fdoExtension)) { @@ -3613,11 +3610,11 @@ if (PollingPeriod != 0) { - InterlockedExchange(&info->Period, PollingPeriod); - - } - - InterlockedExchange(&info->CountDown, info->Period); + InterlockedExchange((PLONG)&info->Period, PollingPeriod); + + } + + InterlockedExchange((PLONG)&info->CountDown, info->Period); info->Method = FailurePredictionMethod; if (FailurePredictionMethod != FailurePredictionNone) { Modified: trunk/reactos/drivers/storage/classpnp/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/c…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/class.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/class.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -238,7 +238,7 @@ status = IoAllocateDriverObjectExtension(DriverObject, CLASS_DRIVER_EXTENSION_KEY, sizeof(CLASS_DRIVER_EXTENSION), - &driverExtension); + (PVOID *)&driverExtension); if(NT_SUCCESS(status)) { @@ -1044,7 +1044,7 @@ if (NT_SUCCESS(status)) { IoAdjustPagingPathCount( - &commonExtension->PagingPathCount, + (PLONG)&commonExtension->PagingPathCount, irpStack->Parameters.UsageNotification.InPath); if (irpStack->Parameters.UsageNotification.InPath) { @@ -1097,13 +1097,13 @@ case DeviceUsageTypeHibernation: { IoAdjustPagingPathCount( - &commonExtension->HibernationPathCount, + (PLONG)&commonExtension->HibernationPathCount, irpStack->Parameters.UsageNotification.InPath ); status = ClassForwardIrpSynchronous(commonExtension, Irp); if (!NT_SUCCESS(status)) { IoAdjustPagingPathCount( - &commonExtension->HibernationPathCount, + (PLONG)&commonExtension->HibernationPathCount, !irpStack->Parameters.UsageNotification.InPath ); } @@ -1113,13 +1113,13 @@ case DeviceUsageTypeDumpFile: { IoAdjustPagingPathCount( - &commonExtension->DumpPathCount, + (PLONG)&commonExtension->DumpPathCount, irpStack->Parameters.UsageNotification.InPath ); status = ClassForwardIrpSynchronous(commonExtension, Irp); if (!NT_SUCCESS(status)) { IoAdjustPagingPathCount( - &commonExtension->DumpPathCount, + (PLONG)&commonExtension->DumpPathCount, !irpStack->Parameters.UsageNotification.InPath ); } @@ -1362,7 +1362,7 @@ status = ClassGetDescriptor( commonExtension->LowerDeviceObject, &propertyId, - &fdoExtension->AdapterDescriptor); + (PSTORAGE_DESCRIPTOR_HEADER *)&fdoExtension->AdapterDescriptor); if(!NT_SUCCESS(status)) { @@ -1384,7 +1384,7 @@ status = ClassGetDescriptor( commonExtension->LowerDeviceObject, &propertyId, - &fdoExtension->DeviceDescriptor); + (PSTORAGE_DESCRIPTOR_HEADER *)&fdoExtension->DeviceDescriptor); if(!NT_SUCCESS(status)) { @@ -2113,7 +2113,7 @@ ClassAcquireRemoveLock(Fdo, irp); IoSetCompletionRoutine(irp, - (PIO_COMPLETION_ROUTINE)ClassAsynchronousCompletion, + ClassAsynchronousCompletion, context, TRUE, TRUE, @@ -3453,7 +3453,7 @@ // count for the physical device // - count = InterlockedIncrement(&fdoExtension->MediaChangeCount); + count = InterlockedIncrement((PLONG)&fdoExtension->MediaChangeCount); DebugPrint((ClassDebugSenseInfo, "ClassInterpretSenseInfo: " "Media change count for device %d incremented to %#lx\n", fdoExtension->DeviceNumber, count)); @@ -3918,7 +3918,7 @@ ULONG totalSize; ULONG senseBufferSize = 0; IO_ERROR_LOG_PACKET staticErrLogEntry = {0}; - CLASS_ERROR_LOG_DATA staticErrLogData = {0}; + CLASS_ERROR_LOG_DATA staticErrLogData = { { { 0 } } }; // // Calculate the total size of the error log entry. @@ -4215,7 +4215,7 @@ IN BOOLEAN Use6Byte ) { - PUCHAR limit; + PCHAR limit; ULONG parameterHeaderLength; PVOID result = NULL; @@ -6516,9 +6516,11 @@ ClassSignalCompletion( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, - IN PKEVENT Event + IN PVOID Context ) { + PKEVENT Event = Context; + KeSetEvent(Event, IO_NO_INCREMENT, FALSE); return STATUS_MORE_PROCESSING_REQUIRED; @@ -6566,7 +6568,7 @@ // one. // - if(InterlockedIncrement(&(fdoExtension->EnumerationInterlock)) == 1) { + if(InterlockedIncrement((PLONG)&fdoExtension->EnumerationInterlock) == 1) { status = driverExtension->InitData.ClassEnumerateDevice(Fdo); } @@ -6576,7 +6578,7 @@ Fdo, BusRelations, (PDEVICE_RELATIONS*)&Irp->IoStatus.Information); - InterlockedDecrement(&(fdoExtension->EnumerationInterlock)); + InterlockedDecrement((PLONG)&fdoExtension->EnumerationInterlock); return Irp->IoStatus.Status; } // end ClassPnpQueryFdoRelations() @@ -6929,10 +6931,10 @@ ASSERT_FDO(Fdo); ASSERT(driverExtension->InitData.ClassEnumerateDevice != NULL); - if(InterlockedIncrement(&(fdoExtension->EnumerationInterlock)) == 1) { + if(InterlockedIncrement((PLONG)&fdoExtension->EnumerationInterlock) == 1) { status = driverExtension->InitData.ClassEnumerateDevice(Fdo); } - InterlockedDecrement(&(fdoExtension->EnumerationInterlock)); + InterlockedDecrement((PLONG)&fdoExtension->EnumerationInterlock); if(!NT_SUCCESS(status)) { @@ -7124,7 +7126,7 @@ * to delete it ourselves. */ ClassAcquireChildLock(fdoExtension); - while (child = ClassRemoveChild(fdoExtension, NULL, FALSE)){ + while ((child = ClassRemoveChild(fdoExtension, NULL, FALSE))){ // // Yank the pdo. This routine will unlink the device from the @@ -7332,7 +7334,7 @@ NTSTATUS status; SCSI_ADDRESS scsiAddress; OBJECT_ATTRIBUTES objectAttributes; - PUCHAR buffer; + PSTR buffer; STRING string; UNICODE_STRING unicodeName; UNICODE_STRING unicodeRegistryPath; @@ -7447,7 +7449,7 @@ RtlInitUnicodeString(&unicodeName, L"DeviceName"); - sprintf(buffer, "%s%d", DeviceName, DeviceNumber); + sprintf(buffer, "%s%lu", DeviceName, DeviceNumber); RtlInitString(&string, buffer); status = RtlAnsiStringToUnicodeString(&unicodeData, &string, @@ -8704,11 +8706,12 @@ NTAPI ClasspRetryRequestDpc( IN PKDPC Dpc, - IN PDEVICE_OBJECT DeviceObject, + IN PVOID Context, IN PVOID Arg1, IN PVOID Arg2 ) { + PDEVICE_OBJECT deviceObject = Context; PFUNCTIONAL_DEVICE_EXTENSION fdoExtension; PCOMMON_DEVICE_EXTENSION commonExtension; PCLASS_PRIVATE_FDO_DATA fdoData; @@ -8716,9 +8719,9 @@ KIRQL irql; - commonExtension = DeviceObject->DeviceExtension; + commonExtension = deviceObject->DeviceExtension; ASSERT(commonExtension->IsFdo); - fdoExtension = DeviceObject->DeviceExtension; + fdoExtension = deviceObject->DeviceExtension; fdoData = fdoExtension->PrivateFdoData; Modified: trunk/reactos/drivers/storage/classpnp/classp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/c…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/classp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/classp.h [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -508,25 +508,11 @@ return (SListHdr->Next == NULL); } -NTSTATUS -NTAPI -DriverEntry( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPath - ); - -VOID -NTAPI -ClassUnload( - IN PDRIVER_OBJECT DriverObject - ); - -NTSTATUS -NTAPI -ClassCreateClose( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); +DRIVER_INITIALIZE DriverEntry; + +DRIVER_UNLOAD ClassUnload; + +DRIVER_DISPATCH ClassCreateClose; NTSTATUS NTAPI @@ -550,26 +536,11 @@ IN BOOLEAN Lock ); -NTSTATUS -NTAPI -ClassReadWrite( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); - -NTSTATUS -NTAPI -ClassDeviceControlDispatch( - PDEVICE_OBJECT DeviceObject, - PIRP Irp - ); - -NTSTATUS -NTAPI -ClassDispatchPnp( - PDEVICE_OBJECT DeviceObject, - PIRP Irp - ); +DRIVER_DISPATCH ClassReadWrite; + +DRIVER_DISPATCH ClassDeviceControlDispatch; + +DRIVER_DISPATCH ClassDispatchPnp; NTSTATUS NTAPI @@ -584,31 +555,15 @@ IN PIRP Irp ); -NTSTATUS -NTAPI -ClassSystemControl( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); +DRIVER_DISPATCH ClassSystemControl; // // Class internal routines // -NTSTATUS -NTAPI -ClassAddDevice( - IN PDRIVER_OBJECT DriverObject, - IN OUT PDEVICE_OBJECT PhysicalDeviceObject - ); - -NTSTATUS -NTAPI -ClasspSendSynchronousCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PVOID Context - ); +DRIVER_ADD_DEVICE ClassAddDevice; + +IO_COMPLETION_ROUTINE ClasspSendSynchronousCompletion; VOID NTAPI @@ -658,12 +613,7 @@ IN PDEVICE_CAPABILITIES Capabilities ); -VOID -NTAPI -ClasspStartIo( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); +DRIVER_STARTIO ClasspStartIo; NTSTATUS NTAPI @@ -767,13 +717,7 @@ IN PDEVICE_OBJECT Fdo ); -NTSTATUS -NTAPI -ClassReleaseQueueCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PVOID Context - ); +IO_COMPLETION_ROUTINE ClassReleaseQueueCompletion; VOID NTAPI @@ -792,12 +736,7 @@ // class power routines // -NTSTATUS -NTAPI -ClassDispatchPower( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp - ); +DRIVER_DISPATCH ClassDispatchPower; NTSTATUS NTAPI @@ -832,14 +771,7 @@ IN PCLASS_PRIVATE_FDO_DATA FdoData ); -VOID -NTAPI -ClasspRetryRequestDpc( - IN PKDPC Dpc, - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Arg1, - IN PVOID Arg2 - ); +KDEFERRED_ROUTINE ClasspRetryRequestDpc; VOID NTAPI Modified: trunk/reactos/drivers/storage/classpnp/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/c…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/create.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -27,7 +27,7 @@ ULONG BreakOnClose = 0; -PUCHAR LockTypeStrings[] = { +PCSTR LockTypeStrings[] = { "Simple", "Secure", "Internal" @@ -194,10 +194,10 @@ status = AllocateDictionaryEntry( &commonExtension->FileObjectDictionary, - (ULONGLONG) irpStack->FileObject, + (ULONG_PTR)irpStack->FileObject, sizeof(FILE_OBJECT_EXTENSION), CLASS_TAG_FILE_OBJECT_EXTENSION, - &fsContext); + (PVOID *)&fsContext); if(NT_SUCCESS(status)) { @@ -340,7 +340,7 @@ do { - InterlockedDecrement(&FsContext->LockCount); + InterlockedDecrement((PLONG)&FsContext->LockCount); newDeviceLockCount = InterlockedDecrement(&fdoExtension->ProtectedLockCount); @@ -977,5 +977,5 @@ { PAGED_CODE(); return GetDictionaryEntry(&(CommonExtension->FileObjectDictionary), - (ULONGLONG) FileObject); + (ULONG_PTR)FileObject); } Modified: trunk/reactos/drivers/storage/classpnp/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/d…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/debug.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/debug.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -63,7 +63,9 @@ #define CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS 512 #endif // CLASS_GLOBAL_BUFFERED_DEBUG_PRINT_BUFFERS - #pragma data_seg("NONPAGE") + #ifdef ALLOC_DATA_PRAGMA + #pragma data_seg("NONPAGE") + #endif @@ -178,8 +180,8 @@ // ULONG index; - PUCHAR buffer; - index = InterlockedIncrement(&ClasspnpGlobals.Index); + PSTR buffer; + index = InterlockedIncrement((PLONG)&ClasspnpGlobals.Index); index %= ClasspnpGlobals.NumberOfBuffers; index *= (ULONG)ClasspnpGlobals.EachBufferSize; Modified: trunk/reactos/drivers/storage/classpnp/debug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/d…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/debug.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/debug.h [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -53,7 +53,7 @@ ULONG Index; // index into buffer KSPIN_LOCK SpinLock; - PUCHAR Buffer; // requires spinlock to access + PSTR Buffer; // requires spinlock to access ULONG NumberOfBuffers; // number of buffers available SIZE_T EachBufferSize; // size of each buffer Modified: trunk/reactos/drivers/storage/classpnp/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/p…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/power.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/power.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -33,21 +33,9 @@ IN CLASS_POWER_OPTIONS Options ); -NTSTATUS -NTAPI -ClasspPowerDownCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PCLASS_POWER_CONTEXT Context - ); - -NTSTATUS -NTAPI -ClasspPowerUpCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp, - IN PCLASS_POWER_CONTEXT Context - ); +IO_COMPLETION_ROUTINE ClasspPowerDownCompletion; + +IO_COMPLETION_ROUTINE ClasspPowerUpCompletion; VOID NTAPI @@ -159,9 +147,10 @@ ClasspPowerUpCompletion( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, - IN PCLASS_POWER_CONTEXT Context + IN PVOID CompletionContext ) { + PCLASS_POWER_CONTEXT context = CompletionContext; PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension; PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = DeviceObject->DeviceExtension; @@ -173,20 +162,20 @@ DebugPrint((1, "ClasspPowerUpCompletion: Device Object %p, Irp %p, " "Context %p\n", - DeviceObject, Irp, Context)); - - ASSERT(!TEST_FLAG(Context->Srb.SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)); - ASSERT(!TEST_FLAG(Context->Srb.SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE)); - ASSERT(Context->Options.PowerDown == FALSE); - ASSERT(Context->Options.HandleSpinUp); + DeviceObject, Irp, context)); + + ASSERT(!TEST_FLAG(context->Srb.SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)); + ASSERT(!TEST_FLAG(context->Srb.SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE)); + ASSERT(context->Options.PowerDown == FALSE); + ASSERT(context->Options.HandleSpinUp); if(Irp->PendingReturned) { IoMarkIrpPending(Irp); } - Context->PowerChangeState.PowerUp++; - - switch(Context->PowerChangeState.PowerUp) { + context->PowerChangeState.PowerUp++; + + switch(context->PowerChangeState.PowerUp) { case PowerUpDeviceLocked: { @@ -203,13 +192,13 @@ // request unless we can ignore failed locks // - if((Context->Options.LockQueue == TRUE) && + if((context->Options.LockQueue == TRUE) && (!NT_SUCCESS(Irp->IoStatus.Status))) { DebugPrint((1, "(%p)\tIrp status was %lx\n", Irp, Irp->IoStatus.Status)); DebugPrint((1, "(%p)\tSrb status was %lx\n", - Irp, Context->Srb.SrbStatus)); + Irp, context->Srb.SrbStatus)); // // Lock was not successful - throw down the power IRP @@ -217,8 +206,8 @@ // the queue. // - Context->InUse = FALSE; - Context = NULL; + context->InUse = FALSE; + context = NULL; // // Set the new power state @@ -255,16 +244,16 @@ return STATUS_MORE_PROCESSING_REQUIRED; } else { - Context->QueueLocked = (UCHAR) Context->Options.LockQueue; + context->QueueLocked = (UCHAR) context->Options.LockQueue; } Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; - Context->PowerChangeState.PowerUp = PowerUpDeviceLocked; + context->PowerChangeState.PowerUp = PowerUpDeviceLocked; IoSetCompletionRoutine(Irp, ClasspPowerUpCompletion, - Context, + context, TRUE, TRUE, TRUE); @@ -287,42 +276,42 @@ // Issue the start unit command to the device. // - Context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); - Context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; - - Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0; - Context->Srb.DataTransferLength = 0; - - Context->Srb.TimeOutValue = START_UNIT_TIMEOUT; - - Context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER | + context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); + context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; + + context->Srb.SrbStatus = context->Srb.ScsiStatus = 0; + context->Srb.DataTransferLength = 0; + + context->Srb.TimeOutValue = START_UNIT_TIMEOUT; + + context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER | SRB_FLAGS_DISABLE_AUTOSENSE | SRB_FLAGS_DISABLE_SYNCH_TRANSFER | SRB_FLAGS_NO_QUEUE_FREEZE; - if(Context->Options.LockQueue) { - SET_FLAG(Context->Srb.SrbFlags, SRB_FLAGS_BYPASS_LOCKED_QUEUE); + if(context->Options.LockQueue) { + SET_FLAG(context->Srb.SrbFlags, SRB_FLAGS_BYPASS_LOCKED_QUEUE); } - Context->Srb.CdbLength = 6; - - cdb = (PCDB) (Context->Srb.Cdb); + context->Srb.CdbLength = 6; + + cdb = (PCDB) (context->Srb.Cdb); RtlZeroMemory(cdb, sizeof(CDB)); cdb->START_STOP.OperationCode = SCSIOP_START_STOP_UNIT; cdb->START_STOP.Start = 1; - Context->PowerChangeState.PowerUp = PowerUpDeviceOn; + context->PowerChangeState.PowerUp = PowerUpDeviceOn; IoSetCompletionRoutine(Irp, ClasspPowerUpCompletion, - Context, + context, TRUE, TRUE, TRUE); - nextStack->Parameters.Scsi.Srb = &(Context->Srb); + nextStack->Parameters.Scsi.Srb = &(context->Srb); nextStack->MajorFunction = IRP_MJ_SCSI; status = IoCallDriver(commonExtension->LowerDeviceObject, Irp); @@ -335,7 +324,7 @@ // we're done. // - Context->FinalStatus = Irp->IoStatus.Status; + context->FinalStatus = Irp->IoStatus.Status; goto ClasspPowerUpCompletionFailure; } @@ -348,32 +337,32 @@ // First deal with an error if one occurred. // - if(SRB_STATUS(Context->Srb.SrbStatus) != SRB_STATUS_SUCCESS) { + if(SRB_STATUS(context->Srb.SrbStatus) != SRB_STATUS_SUCCESS) { BOOLEAN retry; DebugPrint((1, "%p\tError occured when issuing START_UNIT " "command to device. Srb %p, Status %x\n", Irp, - &Context->Srb, - Context->Srb.SrbStatus)); - - ASSERT(!(TEST_FLAG(Context->Srb.SrbStatus, + &context->Srb, + context->Srb.SrbStatus)); + + ASSERT(!(TEST_FLAG(context->Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN))); - ASSERT(Context->Srb.Function == SRB_FUNCTION_EXECUTE_SCSI); - - Context->RetryInterval = 0; + ASSERT(context->Srb.Function == SRB_FUNCTION_EXECUTE_SCSI); + + context->RetryInterval = 0; retry = ClassInterpretSenseInfo( commonExtension->DeviceObject, - &Context->Srb, + &context->Srb, IRP_MJ_SCSI, IRP_MJ_POWER, - MAXIMUM_RETRIES - Context->RetryCount, + MAXIMUM_RETRIES - context->RetryCount, &status, - &Context->RetryInterval); - - if((retry == TRUE) && (Context->RetryCount-- != 0)) { + &context->RetryInterval); + + if((retry == TRUE) && (context->RetryCount-- != 0)) { DebugPrint((1, "(%p)\tRetrying failed request\n", Irp)); @@ -382,18 +371,18 @@ // next time. // - Context->PowerChangeState.PowerUp--; + context->PowerChangeState.PowerUp--; RetryPowerRequest(commonExtension->DeviceObject, Irp, - Context); + context); break; } - + // reset retries - Context->RetryCount = MAXIMUM_RETRIES; + context->RetryCount = MAXIMUM_RETRIES; } @@ -401,22 +390,22 @@ DebugPrint((1, "(%p)\tPreviously spun device up\n", Irp)); - if (Context->QueueLocked) { + if (context->QueueLocked) { DebugPrint((1, "(%p)\tUnlocking queue\n", Irp)); - Context->Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE; - Context->Srb.SrbFlags = SRB_FLAGS_BYPASS_LOCKED_QUEUE; - Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0; - Context->Srb.DataTransferLength = 0; - - nextStack->Parameters.Scsi.Srb = &(Context->Srb); + context->Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE; + context->Srb.SrbFlags = SRB_FLAGS_BYPASS_LOCKED_QUEUE; + context->Srb.SrbStatus = context->Srb.ScsiStatus = 0; + context->Srb.DataTransferLength = 0; + + nextStack->Parameters.Scsi.Srb = &(context->Srb); nextStack->MajorFunction = IRP_MJ_SCSI; - Context->PowerChangeState.PowerUp = PowerUpDeviceStarted; + context->PowerChangeState.PowerUp = PowerUpDeviceStarted; IoSetCompletionRoutine(Irp, ClasspPowerUpCompletion, - Context, + context, TRUE, TRUE, TRUE); @@ -439,21 +428,21 @@ // error conditions .... // - if (Context->QueueLocked) { + if (context->QueueLocked) { DebugPrint((1, "(%p)\tPreviously unlocked queue\n", Irp)); ASSERT(NT_SUCCESS(Irp->IoStatus.Status)); - ASSERT(Context->Srb.SrbStatus == SRB_STATUS_SUCCESS); + ASSERT(context->Srb.SrbStatus == SRB_STATUS_SUCCESS); } else { DebugPrint((1, "(%p)\tFall-through (queue not locked)\n", Irp)); } DebugPrint((1, "(%p)\tFreeing srb and completing\n", Irp)); - Context->InUse = FALSE; - - status = Context->FinalStatus; + context->InUse = FALSE; + + status = context->FinalStatus; Irp->IoStatus.Status = status; - Context = NULL; + context = NULL; // // Set the new power state @@ -528,9 +517,10 @@ ClasspPowerDownCompletion( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, - IN PCLASS_POWER_CONTEXT Context + IN PVOID CompletionContext ) { + PCLASS_POWER_CONTEXT context = CompletionContext; PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = DeviceObject->DeviceExtension; PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension; @@ -541,20 +531,20 @@ DebugPrint((1, "ClasspPowerDownCompletion: Device Object %p, " "Irp %p, Context %p\n", - DeviceObject, Irp, Context)); - - ASSERT(!TEST_FLAG(Context->Srb.SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)); - ASSERT(!TEST_FLAG(Context->Srb.SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE)); - ASSERT(Context->Options.PowerDown == TRUE); - ASSERT(Context->Options.HandleSpinDown); + DeviceObject, Irp, context)); + + ASSERT(!TEST_FLAG(context->Srb.SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)); + ASSERT(!TEST_FLAG(context->Srb.SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE)); + ASSERT(context->Options.PowerDown == TRUE); + ASSERT(context->Options.HandleSpinDown); if(Irp->PendingReturned) { IoMarkIrpPending(Irp); } - Context->PowerChangeState.PowerDown2++; - - switch(Context->PowerChangeState.PowerDown2) { + context->PowerChangeState.PowerDown2++; + + switch(context->PowerChangeState.PowerDown2) { case PowerDownDeviceLocked2: { @@ -562,7 +552,7 @@ DebugPrint((1, "(%p)\tPreviously sent power lock\n", Irp)); - if((Context->Options.LockQueue == TRUE) && + if((context->Options.LockQueue == TRUE) && (!NT_SUCCESS(Irp->IoStatus.Status))) { DebugPrint((1, "(%p)\tIrp status was %lx\n", @@ -570,7 +560,7 @@ Irp->IoStatus.Status)); DebugPrint((1, "(%p)\tSrb status was %lx\n", Irp, - Context->Srb.SrbStatus)); + context->Srb.SrbStatus)); Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; @@ -580,8 +570,8 @@ // the queue. // - Context->InUse = FALSE; - Context = NULL; + context->InUse = FALSE; + context = NULL; // // Set the new power state @@ -617,7 +607,7 @@ return STATUS_MORE_PROCESSING_REQUIRED; } else { - Context->QueueLocked = (UCHAR) Context->Options.LockQueue; + context->QueueLocked = (UCHAR) context->Options.LockQueue; } if (!TEST_FLAG(fdoExtension->PrivateFdoData->HackFlags, @@ -626,49 +616,49 @@ // // send SCSIOP_SYNCHRONIZE_CACHE // - - Context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); - Context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; - - Context->Srb.TimeOutValue = fdoExtension->TimeOutValue; - - Context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER | + + context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); + context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; + + context->Srb.TimeOutValue = fdoExtension->TimeOutValue; + + context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER | SRB_FLAGS_DISABLE_AUTOSENSE | SRB_FLAGS_DISABLE_SYNCH_TRANSFER | SRB_FLAGS_NO_QUEUE_FREEZE | SRB_FLAGS_BYPASS_LOCKED_QUEUE; - - Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0; - Context->Srb.DataTransferLength = 0; - - Context->Srb.CdbLength = 10; - - cdb = (PCDB) Context->Srb.Cdb; - + + context->Srb.SrbStatus = context->Srb.ScsiStatus = 0; + context->Srb.DataTransferLength = 0; + + context->Srb.CdbLength = 10; + + cdb = (PCDB) context->Srb.Cdb; + RtlZeroMemory(cdb, sizeof(CDB)); cdb->SYNCHRONIZE_CACHE10.OperationCode = SCSIOP_SYNCHRONIZE_CACHE; - + IoSetCompletionRoutine(Irp, ClasspPowerDownCompletion, - Context, + context, TRUE, TRUE, TRUE); - - nextStack->Parameters.Scsi.Srb = &(Context->Srb); + + nextStack->Parameters.Scsi.Srb = &(context->Srb); nextStack->MajorFunction = IRP_MJ_SCSI; - + status = IoCallDriver(commonExtension->LowerDeviceObject, Irp); - + DebugPrint((1, "(%p)\tIoCallDriver returned %lx\n", Irp, status)); break; - + } else { - + DebugPrint((1, "(%p)\tPower Down: not sending SYNCH_CACHE\n", DeviceObject)); - Context->PowerChangeState.PowerDown2++; - Context->Srb.SrbStatus = SRB_STATUS_SUCCESS; + context->PowerChangeState.PowerDown2++; + context->Srb.SrbStatus = SRB_STATUS_SUCCESS; // and fall through.... } // no break in case the device doesn't like synch_cache commands @@ -686,7 +676,7 @@ // SCSIOP_SYNCHRONIZE_CACHE was sent // - if(SRB_STATUS(Context->Srb.SrbStatus) != SRB_STATUS_SUCCESS) { + if(SRB_STATUS(context->Srb.SrbStatus) != SRB_STATUS_SUCCESS) { BOOLEAN retry; @@ -694,24 +684,24 @@ "SYNCHRONIZE_CACHE command to device. " "Srb %p, Status %lx\n", Irp, - &Context->Srb, - Context->Srb.SrbStatus)); - - ASSERT(!(TEST_FLAG(Context->Srb.SrbStatus, + &context->Srb, + context->Srb.SrbStatus)); + + ASSERT(!(TEST_FLAG(context->Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN))); - ASSERT(Context->Srb.Function == SRB_FUNCTION_EXECUTE_SCSI); - - Context->RetryInterval = 0; + ASSERT(context->Srb.Function == SRB_FUNCTION_EXECUTE_SCSI); + + context->RetryInterval = 0; retry = ClassInterpretSenseInfo( commonExtension->DeviceObject, - &Context->Srb, + &context->Srb, IRP_MJ_SCSI, IRP_MJ_POWER, - MAXIMUM_RETRIES - Context->RetryCount, + MAXIMUM_RETRIES - context->RetryCount, &status, - &Context->RetryInterval); - - if((retry == TRUE) && (Context->RetryCount-- != 0)) { + &context->RetryInterval); + + if((retry == TRUE) && (context->RetryCount-- != 0)) { DebugPrint((1, "(%p)\tRetrying failed request\n", Irp)); @@ -720,15 +710,15 @@ // the next time. // - Context->PowerChangeState.PowerDown2--; + context->PowerChangeState.PowerDown2--; RetryPowerRequest(commonExtension->DeviceObject, Irp, - Context); + context); break; } DebugPrint((1, "(%p)\tSYNCHRONIZE_CACHE not retried\n", Irp)); - Context->RetryCount = MAXIMUM_RETRIES; + context->RetryCount = MAXIMUM_RETRIES; } // end !SRB_STATUS_SUCCESS @@ -744,23 +734,23 @@ // Issue the start unit command to the device. // - Context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); - Context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; - - Context->Srb.TimeOutValue = START_UNIT_TIMEOUT; - - Context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER | + context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); + context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; + + context->Srb.TimeOutValue = START_UNIT_TIMEOUT; + + context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER | SRB_FLAGS_DISABLE_AUTOSENSE | SRB_FLAGS_DISABLE_SYNCH_TRANSFER | SRB_FLAGS_NO_QUEUE_FREEZE | SRB_FLAGS_BYPASS_LOCKED_QUEUE; - Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0; - Context->Srb.DataTransferLength = 0; - - Context->Srb.CdbLength = 6; - - cdb = (PCDB) Context->Srb.Cdb; + context->Srb.SrbStatus = context->Srb.ScsiStatus = 0; + context->Srb.DataTransferLength = 0; + + context->Srb.CdbLength = 6; + + cdb = (PCDB) context->Srb.Cdb; RtlZeroMemory(cdb, sizeof(CDB)); cdb->START_STOP.OperationCode = SCSIOP_START_STOP_UNIT; @@ -769,12 +759,12 @@ IoSetCompletionRoutine(Irp, ClasspPowerDownCompletion, - Context, + context, TRUE, TRUE, TRUE); - nextStack->Parameters.Scsi.Srb = &(Context->Srb); + nextStack->Parameters.Scsi.Srb = &(context->Srb); nextStack->MajorFunction = IRP_MJ_SCSI; status = IoCallDriver(commonExtension->LowerDeviceObject, Irp); @@ -792,31 +782,31 @@ // stop was sent // - if(SRB_STATUS(Context->Srb.SrbStatus) != SRB_STATUS_SUCCESS) { + if(SRB_STATUS(context->Srb.SrbStatus) != SRB_STATUS_SUCCESS) { BOOLEAN retry; DebugPrint((1, "(%p)\tError occured when issueing STOP_UNIT " "command to device. Srb %p, Status %lx\n", Irp, - &Context->Srb, - Context->Srb.SrbStatus)); - - ASSERT(!(TEST_FLAG(Context->Srb.SrbStatus, + &context->Srb, + context->Srb.SrbStatus)); + + ASSERT(!(TEST_FLAG(context->Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN))); - ASSERT(Context->Srb.Function == SRB_FUNCTION_EXECUTE_SCSI); - - Context->RetryInterval = 0; + ASSERT(context->Srb.Function == SRB_FUNCTION_EXECUTE_SCSI); + + context->RetryInterval = 0; retry = ClassInterpretSenseInfo( commonExtension->DeviceObject, - &Context->Srb, + &context->Srb, IRP_MJ_SCSI, IRP_MJ_POWER, - MAXIMUM_RETRIES - Context->RetryCount, + MAXIMUM_RETRIES - context->RetryCount, &status, - &Context->RetryInterval); - - if((retry == TRUE) && (Context->RetryCount-- != 0)) { + &context->RetryInterval); + + if((retry == TRUE) && (context->RetryCount-- != 0)) { DebugPrint((1, "(%p)\tRetrying failed request\n", Irp)); @@ -825,15 +815,15 @@ // the next time. // - Context->PowerChangeState.PowerDown2--; + context->PowerChangeState.PowerDown2--; RetryPowerRequest(commonExtension->DeviceObject, Irp, - Context); + context); break; } DebugPrint((1, "(%p)\tSTOP_UNIT not retried\n", Irp)); - Context->RetryCount = MAXIMUM_RETRIES; + context->RetryCount = MAXIMUM_RETRIES; } // end !SRB_STATUS_SUCCESS @@ -846,18 +836,18 @@ // if (!NT_SUCCESS(status)) { - - PSENSE_DATA senseBuffer = Context->Srb.SenseInfoBuffer; - - if (TEST_FLAG(Context->Srb.SrbStatus, + + PSENSE_DATA senseBuffer = context->Srb.SenseInfoBuffer; + + if (TEST_FLAG(context->Srb.SrbStatus, SRB_STATUS_AUTOSENSE_VALID) && ((senseBuffer->SenseKey & 0xf) == SCSI_SENSE_NOT_READY) && (senseBuffer->AdditionalSenseCode == SCSI_ADSENSE_LUN_NOT_READY) && (senseBuffer->AdditionalSenseCodeQualifier == SCSI_SENSEQ_FORMAT_IN_PROGRESS) ) { ignoreError = FALSE; - Context->FinalStatus = STATUS_DEVICE_BUSY; - status = Context->FinalStatus; + context->FinalStatus = STATUS_DEVICE_BUSY; + status = context->FinalStatus; } } @@ -874,7 +864,7 @@ IoSetCompletionRoutine(Irp, ClasspPowerDownCompletion, - Context, + context, TRUE, TRUE, TRUE); @@ -900,23 +890,23 @@ DebugPrint((1, "(%p)\tPreviously sent power irp\n", Irp)); - if (Context->QueueLocked) { + if (context->QueueLocked) { DebugPrint((1, "(%p)\tUnlocking queue\n", Irp)); - - Context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); - - Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0; - Context->Srb.DataTransferLength = 0; - - Context->Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE; - Context->Srb.SrbFlags = SRB_FLAGS_BYPASS_LOCKED_QUEUE; - nextStack->Parameters.Scsi.Srb = &(Context->Srb); + + context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK); + + context->Srb.SrbStatus = context->Srb.ScsiStatus = 0; + context->Srb.DataTransferLength = 0; + + context->Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE; + context->Srb.SrbFlags = SRB_FLAGS_BYPASS_LOCKED_QUEUE; + nextStack->Parameters.Scsi.Srb = &(context->Srb); nextStack->MajorFunction = IRP_MJ_SCSI; IoSetCompletionRoutine(Irp, ClasspPowerDownCompletion, - Context, + context, TRUE, TRUE, TRUE); @@ -938,18 +928,18 @@ // error conditions .... // - if (Context->QueueLocked == FALSE) { + if (context->QueueLocked == FALSE) { DebugPrint((1, "(%p)\tFall through (queue not locked)\n", Irp)); } else { DebugPrint((1, "(%p)\tPreviously unlocked queue\n", Irp)); ASSERT(NT_SUCCESS(Irp->IoStatus.Status)); - ASSERT(Context->Srb.SrbStatus == SRB_STATUS_SUCCESS); + ASSERT(context->Srb.SrbStatus == SRB_STATUS_SUCCESS); } DebugPrint((1, "(%p)\tFreeing srb and completing\n", Irp)); - Context->InUse = FALSE; - status = Context->FinalStatus; // allow failure to propogate - Context = NULL; + context->InUse = FALSE; + status = context->FinalStatus; // allow failure to propogate + context = NULL; if(Irp->PendingReturned) { IoMarkIrpPending(Irp); Modified: trunk/reactos/drivers/storage/classpnp/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/u…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/utils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/utils.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -31,7 +31,7 @@ #endif // custom string match -- careful! -BOOLEAN NTAPI ClasspMyStringMatches(IN PCHAR StringToMatch OPTIONAL, IN PCHAR TargetString) +BOOLEAN NTAPI ClasspMyStringMatches(IN PCSTR StringToMatch OPTIONAL, IN PCSTR TargetString) { ULONG length; // strlen returns an int, not size_t (!) PAGED_CODE(); @@ -217,10 +217,10 @@ IN PCLASS_SCAN_FOR_SPECIAL_HANDLER Function) { PSTORAGE_DEVICE_DESCRIPTOR deviceDescriptor; - PUCHAR vendorId; - PUCHAR productId; - PUCHAR productRevision; - UCHAR nullString[] = ""; + PCSTR vendorId; + PCSTR productId; + PCSTR productRevision; + CHAR nullString[] = ""; //ULONG j; PAGED_CODE(); @@ -242,21 +242,21 @@ if (deviceDescriptor->VendorIdOffset != 0 && deviceDescriptor->VendorIdOffset != -1) { - vendorId = ((PUCHAR)deviceDescriptor); + vendorId = ((PCSTR)deviceDescriptor); vendorId += deviceDescriptor->VendorIdOffset; } else { vendorId = nullString; } if (deviceDescriptor->ProductIdOffset != 0 && deviceDescriptor->ProductIdOffset != -1) { - productId = ((PUCHAR)deviceDescriptor); + productId = ((PCSTR)deviceDescriptor); productId += deviceDescriptor->ProductIdOffset; } else { productId = nullString; } if (deviceDescriptor->VendorIdOffset != 0 && deviceDescriptor->VendorIdOffset != -1) { - productRevision = ((PUCHAR)deviceDescriptor); + productRevision = ((PCSTR)deviceDescriptor); productRevision += deviceDescriptor->ProductRevisionOffset; } else { productRevision = nullString; @@ -342,7 +342,7 @@ KeAcquireSpinLock(&fdoData->SpinLock, &oldIrql); fdoData->Perf.SuccessfulIO = 0; // implicit interlock - errors = InterlockedIncrement(&FdoExtension->ErrorCount); + errors = InterlockedIncrement((PLONG)&FdoExtension->ErrorCount); if (errors >= CLASS_ERROR_LEVEL_1) { @@ -405,7 +405,7 @@ return; } - succeeded = InterlockedIncrement(&fdoData->Perf.SuccessfulIO); + succeeded = InterlockedIncrement((PLONG)&fdoData->Perf.SuccessfulIO); if (succeeded < fdoData->Perf.ReEnableThreshhold) { return; } @@ -433,7 +433,7 @@ fdoData->Perf.SuccessfulIO = 0; // implicit interlock ASSERT(FdoExtension->ErrorCount > 0); - errors = InterlockedDecrement(&FdoExtension->ErrorCount); + errors = InterlockedDecrement((PLONG)&FdoExtension->ErrorCount); // // note: do in reverse order of the sets "just in case" Modified: trunk/reactos/drivers/storage/classpnp/xferpkt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/x…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/xferpkt.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/xferpkt.c [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -107,7 +107,7 @@ while (fdoData->NumFreeTransferPackets < MIN_INITIAL_TRANSFER_PACKETS){ PTRANSFER_PACKET pkt = NewTransferPacket(Fdo); if (pkt){ - InterlockedIncrement(&fdoData->NumTotalTransferPackets); + InterlockedIncrement((PLONG)&fdoData->NumTotalTransferPackets); EnqueueFreeTransferPacket(Fdo, pkt); } else { @@ -142,9 +142,9 @@ ASSERT(IsListEmpty(&fdoData->DeferredClientIrpList)); - while (pkt = DequeueFreeTransferPacket(Fdo, FALSE)){ + while ((pkt = DequeueFreeTransferPacket(Fdo, FALSE))){ DestroyTransferPacket(pkt); - InterlockedDecrement(&fdoData->NumTotalTransferPackets); + InterlockedDecrement((PLONG)&fdoData->NumTotalTransferPackets); } ASSERT(fdoData->NumTotalTransferPackets == 0); @@ -225,7 +225,7 @@ ASSERT(!Pkt->SlistEntry.Next); InterlockedPushEntrySList(&fdoData->FreeTransferPacketsList, &Pkt->SlistEntry); - newNumPkts = InterlockedIncrement(&fdoData->NumFreeTransferPackets); + newNumPkts = InterlockedIncrement((PLONG)&fdoData->NumFreeTransferPackets); ASSERT(newNumPkts <= fdoData->NumTotalTransferPackets); /* @@ -264,7 +264,7 @@ pktToDelete = DequeueFreeTransferPacket(Fdo, FALSE); if (pktToDelete){ SimplePushSlist(&pktList, &pktToDelete->SlistEntry); - InterlockedDecrement(&fdoData->NumTotalTransferPackets); + InterlockedDecrement((PLONG)&fdoData->NumTotalTransferPackets); } else { DBGTRACE(ClassDebugTrace, ("Extremely unlikely condition (non-fatal): %d packets dequeued at once for Fdo %p. NumTotalTransferPackets=%d (1).", MaxWorkingSetTransferPackets, Fdo, fdoData->NumTotalTransferPackets)); @@ -273,7 +273,7 @@ } KeReleaseSpinLock(&fdoData->SpinLock, oldIrql); - while (slistEntry = SimplePopSlist(&pktList)){ + while ((slistEntry = SimplePopSlist(&pktList))){ pktToDelete = CONTAINING_RECORD(slistEntry, TRANSFER_PACKET, SlistEntry); DestroyTransferPacket(pktToDelete); } @@ -303,7 +303,7 @@ pktToDelete = DequeueFreeTransferPacket(Fdo, FALSE); if (pktToDelete){ - InterlockedDecrement(&fdoData->NumTotalTransferPackets); + InterlockedDecrement((PLONG)&fdoData->NumTotalTransferPackets); } else { DBGTRACE(ClassDebugTrace, ("Extremely unlikely condition (non-fatal): %d packets dequeued at once for Fdo %p. NumTotalTransferPackets=%d (2).", MinWorkingSetTransferPackets, Fdo, fdoData->NumTotalTransferPackets)); @@ -333,7 +333,7 @@ slistEntry->Next = NULL; pkt = CONTAINING_RECORD(slistEntry, TRANSFER_PACKET, SlistEntry); ASSERT(fdoData->NumFreeTransferPackets > 0); - InterlockedDecrement(&fdoData->NumFreeTransferPackets); + InterlockedDecrement((PLONG)&fdoData->NumFreeTransferPackets); } else { if (AllocIfNeeded){ @@ -345,7 +345,7 @@ */ pkt = NewTransferPacket(Fdo); if (pkt){ - InterlockedIncrement(&fdoData->NumTotalTransferPackets); + InterlockedIncrement((PLONG)&fdoData->NumTotalTransferPackets); fdoData->DbgPeakNumTransferPackets = max(fdoData->DbgPeakNumTransferPackets, fdoData->NumTotalTransferPackets); } else { Modified: trunk/reactos/include/ddk/classpnp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/classpnp.h?rev…
============================================================================== --- trunk/reactos/include/ddk/classpnp.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/classpnp.h [iso-8859-1] Sun Nov 10 20:54:19 2013 @@ -1134,12 +1134,7 @@ ClassReleaseChildLock( _In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension); -NTSTATUS -NTAPI -ClassSignalCompletion( - PDEVICE_OBJECT DeviceObject, - PIRP Irp, - PKEVENT Event); +IO_COMPLETION_ROUTINE ClassSignalCompletion; VOID NTAPI
11 years, 1 month
1
0
0
0
[hbelusca] 60921: Add unicode/ansi entries for the previous functions.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 10 20:25:05 2013 New Revision: 60921 URL:
http://svn.reactos.org/svn/reactos?rev=60921&view=rev
Log: Add unicode/ansi entries for the previous functions. Modified: trunk/reactos/include/psdk/wincon.h Modified: trunk/reactos/include/psdk/wincon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wincon.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wincon.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/wincon.h [iso-8859-1] Sun Nov 10 20:25:05 2013 @@ -717,6 +717,7 @@ #define PeekConsoleInput PeekConsoleInputW #define ReadConsole ReadConsoleW #define ReadConsoleInput ReadConsoleInputW +#define ReadConsoleInputEx ReadConsoleInputExW #define ReadConsoleOutput ReadConsoleOutputW #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW @@ -738,6 +739,7 @@ #define PeekConsoleInput PeekConsoleInputA #define ReadConsole ReadConsoleA #define ReadConsoleInput ReadConsoleInputA +#define ReadConsoleInputEx ReadConsoleInputExA #define ReadConsoleOutput ReadConsoleOutputA #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
11 years, 1 month
1
0
0
0
[hbelusca] 60920: [KERNEL32][CONSRV] Implement ReadConsoleInputExA/W, which are a generalization of ReadConsoleInputA/W and PeekConsoleInputA/W. They allow you to read console input events by eithe...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Nov 10 20:20:57 2013 New Revision: 60920 URL:
http://svn.reactos.org/svn/reactos?rev=60920&view=rev
Log: [KERNEL32][CONSRV] Implement ReadConsoleInputExA/W, which are a generalization of ReadConsoleInputA/W and PeekConsoleInputA/W. They allow you to read console input events by either waiting (or not) for their presence, and to remove them from the console input list (or not). Those functions are the read-equivalent of WriteConsoleInputVDMA/W. Used in Windows' NTVDM (guess why ;) ). Modified: trunk/reactos/dll/win32/kernel32/client/console/readwrite.c trunk/reactos/include/psdk/wincon.h trunk/reactos/include/reactos/subsys/win/conmsg.h trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c trunk/reactos/win32ss/user/winsrv/consrv/coninput.c trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c Modified: trunk/reactos/dll/win32/kernel32/client/console/readwrite.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] Sun Nov 10 20:20:57 2013 @@ -120,11 +120,11 @@ static BOOL IntGetConsoleInput(HANDLE hConsoleInput, - BOOL bRead, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead, - BOOL bUnicode) + WORD wFlags, + BOOLEAN bUnicode) { NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; @@ -158,10 +158,10 @@ /* Set up the data to send to the Console Server */ GetInputRequest->InputHandle = hConsoleInput; - GetInputRequest->Unicode = bUnicode; - GetInputRequest->bRead = bRead; GetInputRequest->InputsRead = 0; GetInputRequest->Length = nLength; + GetInputRequest->wFlags = wFlags; + GetInputRequest->Unicode = bUnicode; /* Call the server */ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, @@ -825,10 +825,10 @@ LPDWORD lpNumberOfEventsRead) { return IntGetConsoleInput(hConsoleInput, - FALSE, lpBuffer, nLength, lpNumberOfEventsRead, + CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE, TRUE); } @@ -846,10 +846,10 @@ LPDWORD lpNumberOfEventsRead) { return IntGetConsoleInput(hConsoleInput, - FALSE, lpBuffer, nLength, lpNumberOfEventsRead, + CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE, FALSE); } @@ -867,10 +867,10 @@ LPDWORD lpNumberOfEventsRead) { return IntGetConsoleInput(hConsoleInput, - TRUE, lpBuffer, nLength, lpNumberOfEventsRead, + 0, TRUE); } @@ -888,29 +888,55 @@ LPDWORD lpNumberOfEventsRead) { return IntGetConsoleInput(hConsoleInput, - TRUE, lpBuffer, nLength, lpNumberOfEventsRead, + 0, FALSE); } -BOOL -WINAPI -ReadConsoleInputExW(HANDLE hConsole, LPVOID lpBuffer, DWORD dwLen, LPDWORD Unknown1, DWORD Unknown2) -{ - STUB; - return FALSE; -} - - -BOOL -WINAPI -ReadConsoleInputExA(HANDLE hConsole, LPVOID lpBuffer, DWORD dwLen, LPDWORD Unknown1, DWORD Unknown2) -{ - STUB; - return FALSE; +/*-------------------------------------------------------------- + * ReadConsoleInputExW + * + * @implemented + */ +BOOL +WINAPI +ReadConsoleInputExW(HANDLE hConsoleInput, + PINPUT_RECORD lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsRead, + WORD wFlags) +{ + return IntGetConsoleInput(hConsoleInput, + lpBuffer, + nLength, + lpNumberOfEventsRead, + wFlags, + TRUE); +} + + +/*-------------------------------------------------------------- + * ReadConsoleInputExA + * + * @implemented + */ +BOOL +WINAPI +ReadConsoleInputExA(HANDLE hConsoleInput, + PINPUT_RECORD lpBuffer, + DWORD nLength, + LPDWORD lpNumberOfEventsRead, + WORD wFlags) +{ + return IntGetConsoleInput(hConsoleInput, + lpBuffer, + nLength, + lpNumberOfEventsRead, + wFlags, + FALSE); } Modified: trunk/reactos/include/psdk/wincon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wincon.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wincon.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/wincon.h [iso-8859-1] Sun Nov 10 20:20:57 2013 @@ -107,6 +107,12 @@ #if (_WIN32_WINNT >= 0x0600) #define HISTORY_NO_DUP_FLAG 0x0001 #endif + +/* + * Read input flags + */ +#define CONSOLE_READ_KEEPEVENT 0x0001 +#define CONSOLE_READ_CONTINUE 0x0002 /* * Event types @@ -436,6 +442,7 @@ BOOL WINAPI GetNumberOfConsoleInputEvents(_In_ HANDLE, _Out_ PDWORD); BOOL WINAPI GetNumberOfConsoleMouseButtons(_Out_ PDWORD); +_Success_(return != 0) BOOL WINAPI PeekConsoleInputA( _In_ HANDLE hConsoleInput, @@ -443,6 +450,7 @@ _In_ DWORD nLength, _Out_ LPDWORD lpNumberOfEventsRead); +_Success_(return != 0) BOOL WINAPI PeekConsoleInputW( @@ -488,6 +496,26 @@ _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, _In_ DWORD nLength, _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead); + +_Success_(return != 0) +BOOL +WINAPI +ReadConsoleInputExA( + _In_ HANDLE hConsoleInput, + _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, + _In_ DWORD nLength, + _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead, + _In_ WORD wFlags); + +_Success_(return != 0) +BOOL +WINAPI +ReadConsoleInputExW( + _In_ HANDLE hConsoleInput, + _Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer, + _In_ DWORD nLength, + _Out_ _Deref_out_range_(<= , nLength) LPDWORD lpNumberOfEventsRead, + _In_ WORD wFlags); BOOL WINAPI Modified: trunk/reactos/include/reactos/subsys/win/conmsg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
============================================================================== --- trunk/reactos/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/subsys/win/conmsg.h [iso-8859-1] Sun Nov 10 20:20:57 2013 @@ -469,13 +469,11 @@ typedef struct { HANDLE InputHandle; - BOOL Unicode; - BOOL bRead; // TRUE --> Read ; FALSE --> Peek - ULONG InputsRead; - + PINPUT_RECORD InputRecord; ULONG Length; - PINPUT_RECORD InputRecord; + WORD wFlags; + BOOLEAN Unicode; } CONSOLE_GETINPUT, *PCONSOLE_GETINPUT; typedef struct Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c [iso-8859-1] Sun Nov 10 20:20:57 2013 @@ -376,6 +376,7 @@ NTSTATUS NTAPI ConDrvGetConsoleInput(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, + IN BOOLEAN KeepEvents, IN BOOLEAN WaitForMoreEvents, IN BOOLEAN Unicode, OUT PINPUT_RECORD InputRecord, @@ -425,7 +426,8 @@ ++i; CurrentInput = CurrentInput->Flink; - if (WaitForMoreEvents) // TRUE --> Read, we remove inputs from the buffer ; FALSE --> Peek, we keep inputs. + /* Remove the events from the queue if needed */ + if (!KeepEvents) { RemoveEntryList(&Input->ListEntry); ConsoleFreeHeap(Input); Modified: trunk/reactos/win32ss/user/winsrv/consrv/coninput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Sun Nov 10 20:20:57 2013 @@ -45,7 +45,7 @@ WaitBeforeReading(IN PGET_INPUT_INFO InputInfo, IN PCSR_API_MESSAGE ApiMessage, IN CSR_WAIT_FUNCTION WaitFunction OPTIONAL, - IN BOOL CreateWaitBlock OPTIONAL) + IN BOOLEAN CreateWaitBlock OPTIONAL) { if (CreateWaitBlock) { @@ -74,7 +74,7 @@ static NTSTATUS ReadChars(IN PGET_INPUT_INFO InputInfo, IN PCSR_API_MESSAGE ApiMessage, - IN BOOL CreateWaitBlock OPTIONAL); + IN BOOLEAN CreateWaitBlock OPTIONAL); // Wait function CSR_WAIT_FUNCTION static BOOLEAN @@ -123,9 +123,7 @@ * If we go there, that means we are notified for some new input. * The console is therefore already locked. */ - Status = ReadChars(InputInfo, - WaitApiMessage, - FALSE); + Status = ReadChars(InputInfo, WaitApiMessage, FALSE); Quit: if (Status != STATUS_PENDING) @@ -148,7 +146,7 @@ static NTSTATUS ReadChars(IN PGET_INPUT_INFO InputInfo, IN PCSR_API_MESSAGE ApiMessage, - IN BOOL CreateWaitBlock OPTIONAL) + IN BOOLEAN CreateWaitBlock OPTIONAL) { NTSTATUS Status; PCONSOLE_READCONSOLE ReadConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ReadConsoleRequest; @@ -188,9 +186,8 @@ static NTSTATUS ReadInputBuffer(IN PGET_INPUT_INFO InputInfo, - IN BOOL Wait, IN PCSR_API_MESSAGE ApiMessage, - IN BOOL CreateWaitBlock OPTIONAL); + IN BOOLEAN CreateWaitBlock OPTIONAL); // Wait function CSR_WAIT_FUNCTION static BOOLEAN @@ -204,7 +201,6 @@ IN ULONG WaitFlags) { NTSTATUS Status; - PCONSOLE_GETINPUT GetInputRequest = &((PCONSOLE_API_MESSAGE)WaitApiMessage)->Data.GetInputRequest; PGET_INPUT_INFO InputInfo = (PGET_INPUT_INFO)WaitContext; PVOID InputHandle = WaitArgument2; @@ -240,10 +236,7 @@ * If we go there, that means we are notified for some new input. * The console is therefore already locked. */ - Status = ReadInputBuffer(InputInfo, - GetInputRequest->bRead, - WaitApiMessage, - FALSE); + Status = ReadInputBuffer(InputInfo, WaitApiMessage, FALSE); Quit: if (Status != STATUS_PENDING) @@ -258,16 +251,16 @@ NTSTATUS NTAPI ConDrvGetConsoleInput(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, + IN BOOLEAN KeepEvents, IN BOOLEAN WaitForMoreEvents, IN BOOLEAN Unicode, OUT PINPUT_RECORD InputRecord, IN ULONG NumEventsToRead, - OUT PULONG NumEventsRead); + OUT PULONG NumEventsRead OPTIONAL); static NTSTATUS ReadInputBuffer(IN PGET_INPUT_INFO InputInfo, - IN BOOL Wait, // TRUE --> Read ; FALSE --> Peek IN PCSR_API_MESSAGE ApiMessage, - IN BOOL CreateWaitBlock OPTIONAL) + IN BOOLEAN CreateWaitBlock OPTIONAL) { NTSTATUS Status; PCONSOLE_GETINPUT GetInputRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetInputRequest; @@ -277,7 +270,8 @@ Status = ConDrvGetConsoleInput(InputBuffer->Header.Console, InputBuffer, - Wait, + (GetInputRequest->wFlags & CONSOLE_READ_KEEPEVENT) != 0, + (GetInputRequest->wFlags & CONSOLE_READ_CONTINUE ) == 0, GetInputRequest->Unicode, GetInputRequest->InputRecord, GetInputRequest->Length, @@ -336,9 +330,7 @@ InputInfo.HandleEntry = HandleEntry; InputInfo.InputBuffer = InputBuffer; - Status = ReadChars(&InputInfo, - ApiMessage, - TRUE); + Status = ReadChars(&InputInfo, ApiMessage, TRUE); ConSrvReleaseInputBuffer(InputBuffer, TRUE); @@ -358,6 +350,9 @@ DPRINT("SrvGetConsoleInput\n"); + if (GetInputRequest->wFlags & ~(CONSOLE_READ_KEEPEVENT | CONSOLE_READ_CONTINUE)) + return STATUS_INVALID_PARAMETER; + if (!CsrValidateMessageBuffer(ApiMessage, (PVOID*)&GetInputRequest->InputRecord, GetInputRequest->Length, @@ -375,10 +370,7 @@ InputInfo.HandleEntry = HandleEntry; InputInfo.InputBuffer = InputBuffer; - Status = ReadInputBuffer(&InputInfo, - GetInputRequest->bRead, - ApiMessage, - TRUE); + Status = ReadInputBuffer(&InputInfo, ApiMessage, TRUE); ConSrvReleaseInputBuffer(InputBuffer, TRUE); Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Sun Nov 10 20:20:57 2013 @@ -323,7 +323,7 @@ static NTSTATUS DoWriteConsole(IN PCSR_API_MESSAGE ApiMessage, IN PCSR_THREAD ClientThread, - IN BOOL CreateWaitBlock OPTIONAL); + IN BOOLEAN CreateWaitBlock OPTIONAL); // Wait function CSR_WAIT_FUNCTION static BOOLEAN @@ -351,9 +351,7 @@ goto Quit; } - Status = DoWriteConsole(WaitApiMessage, - WaitThread, - FALSE); + Status = DoWriteConsole(WaitApiMessage, WaitThread, FALSE); Quit: if (Status != STATUS_PENDING) @@ -374,7 +372,7 @@ static NTSTATUS DoWriteConsole(IN PCSR_API_MESSAGE ApiMessage, IN PCSR_THREAD ClientThread, - IN BOOL CreateWaitBlock OPTIONAL) + IN BOOLEAN CreateWaitBlock OPTIONAL) { NTSTATUS Status; PCONSOLE_WRITECONSOLE WriteConsoleRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.WriteConsoleRequest; @@ -517,9 +515,7 @@ return STATUS_INVALID_PARAMETER; } - Status = DoWriteConsole(ApiMessage, - CsrGetClientThread(), - TRUE); + Status = DoWriteConsole(ApiMessage, CsrGetClientThread(), TRUE); if (Status == STATUS_PENDING) *ReplyCode = CsrReplyPending;
11 years, 1 month
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
35
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
Results per page:
10
25
50
100
200