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
April 2005
----- 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
26 participants
477 discussions
Start a n
N
ew thread
[mbosma] 14592: Package Manager: fixed HotKeys (thanks to w3seek) *shamed*
by mbosma@svn.reactos.com
Package Manager: fixed HotKeys (thanks to w3seek) *shamed* Modified: trunk/rosapps/packmgr/gui/generic.rc Modified: trunk/rosapps/packmgr/gui/main.cpp Modified: trunk/rosapps/packmgr/gui/main.h Modified: trunk/rosapps/packmgr/gui/resource.h _____ Modified: trunk/rosapps/packmgr/gui/generic.rc --- trunk/rosapps/packmgr/gui/generic.rc 2005-04-11 18:45:48 UTC (rev 14591) +++ trunk/rosapps/packmgr/gui/generic.rc 2005-04-11 20:27:20 UTC (rev 14592) @@ -22,3 +22,13 @@ 13 ICON DISCARDABLE "res/update.ico" 14 ICON DISCARDABLE "res/uninstall.ico" +/* HotKeys */ + +IDR_HOTKEYS ACCELERATORS DISCARDABLE +BEGIN + "1", 2, VIRTKEY, CONTROL + "2", 3, VIRTKEY, CONTROL + "3", 4, VIRTKEY, CONTROL + "4", 5, VIRTKEY, CONTROL + "0", 1, VIRTKEY, CONTROL +END _____ Modified: trunk/rosapps/packmgr/gui/main.cpp --- trunk/rosapps/packmgr/gui/main.cpp 2005-04-11 18:45:48 UTC (rev 14591) +++ trunk/rosapps/packmgr/gui/main.cpp 2005-04-11 20:27:20 UTC (rev 14592) @@ -67,8 +67,11 @@ // Start getting messages while(GetMessage(&msg,NULL,0,0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); + if(!TranslateAccelerator(hwnd, hHotKeys, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } // Close our handle @@ -152,11 +155,7 @@ ImageList_AddIcon(hIcon, LoadIcon(hinst, MAKEINTRESOURCE(10))); // Setup Hotkeys - RegisterHotKey(hwnd, 1, MOD_CONTROL, VK_1); - RegisterHotKey(hwnd, 2, MOD_CONTROL, VK_2); - RegisterHotKey(hwnd, 3, MOD_CONTROL, VK_3); - RegisterHotKey(hwnd, 4, MOD_CONTROL, VK_4); - RegisterHotKey(hwnd, 0, MOD_CONTROL, VK_0); + hHotKeys = LoadAccelerators (hinst, MAKEINTRESOURCE(IDR_HOTKEYS)); } // Set the Icons _____ Modified: trunk/rosapps/packmgr/gui/main.h --- trunk/rosapps/packmgr/gui/main.h 2005-04-11 18:45:48 UTC (rev 14591) +++ trunk/rosapps/packmgr/gui/main.h 2005-04-11 20:27:20 UTC (rev 14592) @@ -19,6 +19,7 @@ pTree tree; HMENU hPopup; +HACCEL hHotKeys; HWND hTBar, hTree, hEdit, hStatus; HTREEITEM nodes [MAXNODES]; _____ Modified: trunk/rosapps/packmgr/gui/resource.h --- trunk/rosapps/packmgr/gui/resource.h 2005-04-11 18:45:48 UTC (rev 14591) +++ trunk/rosapps/packmgr/gui/resource.h 2005-04-11 20:27:20 UTC (rev 14592) @@ -12,3 +12,4 @@ #define IDC_STATUS2 0x111 #define IDC_CANCEL 0x112 #define IDC_TSTATUS 0x113 +#define IDR_HOTKEYS 0x114
19 years, 8 months
1
0
0
0
[chorns] 14591: Have the object files of a module depend on the build file that contain the module
by chorns@svn.reactos.com
Have the object files of a module depend on the build file that contain the module Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-04-11 17:59:52 UTC (rev 14590) +++ branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-04-11 18:45:48 UTC (rev 14591) @@ -339,9 +339,11 @@ return *this; } -XMLElement::XMLElement ( const string& location_ ) - : location(location_), - parentElement(NULL) +XMLElement::XMLElement ( XMLFile* xmlFile, + const string& location ) + : xmlFile ( xmlFile ), + location ( location ), + parentElement ( NULL ) { } @@ -517,7 +519,8 @@ return NULL; } - XMLElement* e = new XMLElement ( f.Location () ); + XMLElement* e = new XMLElement ( &f, + f.Location () ); bool bNeedEnd = e->Parse ( token, end_tag ); if ( e->name == "xi:include" && includes ) @@ -634,8 +637,8 @@ string file ( include.path.Fixup(att->value, true) ); string top_file ( Path::RelativeFromWorkingDirectory ( file ) ); include.e->attributes.push_back ( new XMLAttribute ( "top_href", top_file ) ); - XMLFile fInc; - if ( !fInc.open ( file ) ) + XMLFile* fInc = new XMLFile(); + if ( !fInc->open ( file ) ) { include.fileExists = false; // look for xi:fallback element @@ -669,10 +672,11 @@ else { include.fileExists = true; - XMLElement* new_e = new XMLElement ( include.e->location ); + XMLElement* new_e = new XMLElement ( fInc, + include.e->location ); new_e->name = "xi:included"; Path path2 ( include.path, att->value ); - XMLReadFile ( fInc, *new_e, includes, path2 ); + XMLReadFile ( *fInc, *new_e, includes, path2 ); return new_e; } } @@ -682,14 +686,15 @@ const Path& path, XMLIncludes& includes ) { - XMLFile f; + XMLFile* f = new XMLFile(); - if ( !f.open ( filename ) ) + if ( !f->open ( filename ) ) throw FileNotFoundException ( filename ); - XMLElement* head = new XMLElement ( "(virtual)" ); + XMLElement* head = new XMLElement ( f, + "(virtual)" ); - XMLReadFile ( f, *head, includes, path ); + XMLReadFile ( *f, *head, includes, path ); for ( size_t i = 0; i < includes.size (); i++ ) { @@ -700,7 +705,7 @@ throw FileNotFoundException ( ssprintf ( "%s (referenced from %s)", e->GetAttribute ( "top_href", true )->value.c_str (), - f.Location ().c_str () ) ); + f->Location ().c_str () ) ); } XMLElement* parent = e->parentElement; XMLElement** parent_container = NULL; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.h --- branches/xmlbuildsystem/reactos/tools/rbuild/XML.h 2005-04-11 17:59:52 UTC (rev 14590) +++ branches/xmlbuildsystem/reactos/tools/rbuild/XML.h 2005-04-11 18:45:48 UTC (rev 14591) @@ -88,6 +88,7 @@ class XMLElement { public: + XMLFile* xmlFile; std::string location; std::string name; std::vector<XMLAttribute*> attributes; @@ -95,7 +96,8 @@ std::vector<XMLElement*> subElements; std::string value; - XMLElement ( const std::string& location_ ); + XMLElement ( XMLFile* xmlFile, + const std::string& location ); ~XMLElement(); bool Parse(const std::string& token, bool& end_tag); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-04-11 17:59:52 UTC (rev 14590) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-04-11 18:45:48 UTC (rev 14591) @@ -786,19 +786,20 @@ const string& cc, const string& cflagsMacro ) { - string deps = sourceFilename; + string dependencies = sourceFilename; if ( module.pch && use_pch ) - deps += " " + module.pch->header + ".gch"; + dependencies += " " + module.pch->header + ".gch"; /* WIDL generated headers may be used */ - deps += " " + GetLinkingDependenciesMacro (); + dependencies += " " + GetLinkingDependenciesMacro (); + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); string objectFilename = GetObjectFilename ( sourceFilename, &clean_files ); fprintf ( fMakefile, "%s: %s | %s\n", objectFilename.c_str (), - deps.c_str (), + dependencies.c_str (), GetDirectory ( objectFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_CC)\n" ); fprintf ( fMakefile, @@ -813,12 +814,14 @@ const string& cc, const string& cflagsMacro ) { + string dependencies = sourceFilename; + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); string objectFilename = GetObjectFilename ( sourceFilename, &clean_files ); fprintf ( fMakefile, "%s: %s | %s\n", objectFilename.c_str (), - sourceFilename.c_str (), + dependencies.c_str (), GetDirectory ( objectFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_GAS)\n" ); fprintf ( fMakefile, @@ -832,12 +835,14 @@ const string& sourceFilename, const string& nasmflagsMacro ) { + string dependencies = sourceFilename; + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); string objectFilename = GetObjectFilename ( sourceFilename, &clean_files ); fprintf ( fMakefile, "%s: %s | %s\n", objectFilename.c_str (), - sourceFilename.c_str (), + dependencies.c_str (), GetDirectory ( objectFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_NASM)\n" ); fprintf ( fMakefile, @@ -851,6 +856,8 @@ const string& sourceFilename, const string& windresflagsMacro ) { + string dependencies = sourceFilename; + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); string objectFilename = GetObjectFilename ( sourceFilename, &clean_files ); string rciFilename = ros_temp + @@ -862,7 +869,7 @@ fprintf ( fMakefile, "%s: %s $(WRC_TARGET) | %s\n", objectFilename.c_str (), - sourceFilename.c_str (), + dependencies.c_str (), GetDirectory ( objectFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_WRC)\n" ); fprintf ( fMakefile, @@ -890,7 +897,7 @@ fprintf ( fMakefile, "%s: %s $(WRC_TARGET) | %s\n", objectFilename.c_str (), - sourceFilename.c_str (), + dependencies.c_str (), GetDirectory ( objectFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_WRC)\n" ); fprintf ( fMakefile, @@ -904,8 +911,10 @@ MingwModuleHandler::GenerateWinebuildCommands ( const string& sourceFilename ) { + string dependencies = sourceFilename; + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); + string basename = GetBasename ( sourceFilename ); - string def_file = PassThruCacheDirectory ( basename + ".spec.def", backend->intermediateDirectory ); @@ -919,7 +928,7 @@ fprintf ( fMakefile, "%s: %s $(WINEBUILD_TARGET)\n", def_file.c_str (), - sourceFilename.c_str () ); + dependencies.c_str () ); fprintf ( fMakefile, "\t$(ECHO_WINEBLD)\n" ); fprintf ( fMakefile, "\t%s --def=%s -o %s\n", @@ -944,6 +953,9 @@ const string& sourceFilename, const string& widlflagsMacro ) { + string dependencies = sourceFilename; + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); + string basename = GetBasename ( sourceFilename ); /*string generatedHeaderFilename = PassThruCacheDirectory ( @@ -963,7 +975,7 @@ "%s %s: %s $(WIDL_TARGET) | %s\n", generatedServerFilename.c_str (), generatedHeaderFilename.c_str (), - sourceFilename.c_str (), + dependencies.c_str (), GetDirectory ( generatedServerFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" ); fprintf ( fMakefile, @@ -980,6 +992,9 @@ const string& sourceFilename, const string& widlflagsMacro ) { + string dependencies = sourceFilename; + dependencies += " " + NormalizeFilename ( module.xmlbuildFile ); + string basename = GetBasename ( sourceFilename ); /*string generatedHeaderFilename = PassThruCacheDirectory ( @@ -999,7 +1014,7 @@ "%s %s: %s $(WIDL_TARGET) | %s\n", generatedClientFilename.c_str (), generatedHeaderFilename.c_str (), - sourceFilename.c_str (), + dependencies.c_str (), GetDirectory ( generatedClientFilename ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" ); fprintf ( fMakefile, _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-04-11 17:59:52 UTC (rev 14590) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-04-11 18:45:48 UTC (rev 14591) @@ -137,6 +137,8 @@ __LINE__, "Module created with non-<module> node" ); + xmlbuildFile = Path::RelativeFromWorkingDirectory ( moduleNode.xmlFile->filename() ); + path = FixSeparator ( modulePath ); const XMLAttribute* att = moduleNode.GetAttribute ( "name", true ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-04-11 17:59:52 UTC (rev 14590) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-04-11 18:45:48 UTC (rev 14591) @@ -154,6 +154,7 @@ public: const Project& project; const XMLElement& node; + std::string xmlbuildFile; std::string name; std::string extension; std::string entrypoint;
19 years, 8 months
1
0
0
0
[mbosma] 14590: PackageManager: Bug fix
by mbosma@svn.reactos.com
PackageManager: Bug fix Modified: trunk/rosapps/packmgr/lib/download.cpp Modified: trunk/rosapps/packmgr/lib/es.rc Modified: trunk/rosapps/packmgr/lib/functions.cpp Modified: trunk/rosapps/packmgr/lib/main.cpp Modified: trunk/rosapps/packmgr/lib/package.cpp Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml _____ Modified: trunk/rosapps/packmgr/lib/download.cpp --- trunk/rosapps/packmgr/lib/download.cpp 2005-04-11 17:28:14 UTC (rev 14589) +++ trunk/rosapps/packmgr/lib/download.cpp 2005-04-11 17:59:52 UTC (rev 14590) @@ -26,35 +26,48 @@ LPBINDSTATUSCALLBACK lpfnCB ); +int FindCount (string What, string Where, int start = 0, int end = -1); + // Download a file -char* PML_Download (const char* name, const char* local_name = "packmgr.txt", const char* server = tree_server, BOOL totemp = TRUE) +char* PML_Download (const char* url, const char* server = "tree", const char* filename = NULL) { - char url [MAX_PATH]; - static char path [MAX_PATH]; + char downl [MAX_PATH]; + static char path [MAX_PATH]; // get temp dir - if(totemp) + if(!filename) GetTempPathA (200, path); + + else if(!strstr(filename, "\\")) + GetTempPathA (200, path); // create the local file name - if(local_name) - strcat(path, local_name); + if(filename) + { + strcat(path, filename); + DeleteFileA (path); + } else - strcat(path, "tmp.tmp"); + GetTempFileNameA (path, "pml", 0, path); // get the url - if(server) strcpy(url, server); - strcat(url, name); - // make sure there is no old file - DeleteFileA (path); + if (!server); + else if(!strcmp(server, "tree")) + strcpy(downl, tree_server); + + else + strcpy(downl, server); + + strcat(downl, url); + // download the file - if(URLDownloadToFileA (NULL, url, path, 0, NULL) != S_OK) + if(URLDownloadToFileA (NULL, downl, path, 0, NULL) != S_OK) { Log("! ERROR: Unable to download "); - LogAdd(url); + LogAdd(downl); return NULL; } _____ Modified: trunk/rosapps/packmgr/lib/es.rc --- trunk/rosapps/packmgr/lib/es.rc 2005-04-11 17:28:14 UTC (rev 14589) +++ trunk/rosapps/packmgr/lib/es.rc 2005-04-11 17:59:52 UTC (rev 14590) @@ -14,6 +14,10 @@ ERR_SYNATX "Error durante la ejecuci¾n del Script.\nSintaxis err¾nea." ERR_CALL "Error durante la ejecuci¾n del Script.\nNo se pudo encontrar la funci¾n." ERR_PARAMETER "Error durante la ejecuci¾n del Script.\nParametro(s) err¾neo." + + ERR_DEP1 "To install this package you have to install the following package(s) as well:\n\n" + ERR_DEP2 "\nDo you want this ?" + ERR_READY "You choosen to install %d package(s). To install them you have to read and agree with each of thier licences.\n\n Do you want still want to ?" END /* EOF */ _____ Modified: trunk/rosapps/packmgr/lib/functions.cpp --- trunk/rosapps/packmgr/lib/functions.cpp 2005-04-11 17:28:14 UTC (rev 14589) +++ trunk/rosapps/packmgr/lib/functions.cpp 2005-04-11 17:59:52 UTC (rev 14590) @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////// // -// script.cpp +// functions.cpp // // Script Functions // @@ -15,7 +15,7 @@ #include "log.h" extern const char* tree_server; -char* PML_Download (const char* name, const char* local_name, const char* server, BOOL totemp = TRUE); +char* PML_Download (const char* url, const char* server, const char* filename); int debuglog (int argc, char* argv[]) @@ -31,10 +31,10 @@ char* result; if (argc==3) - result = PML_Download(argv[1], argv[2], argv[3]); + result = PML_Download(argv[1], argv[3], argv[2]); else if (argc==2) - result = PML_Download(argv[1], argv[2], NULL); + result = PML_Download(argv[1], NULL, argv[2]); else return ERR_GENERIC; _____ Modified: trunk/rosapps/packmgr/lib/main.cpp --- trunk/rosapps/packmgr/lib/main.cpp 2005-04-11 17:28:14 UTC (rev 14589) +++ trunk/rosapps/packmgr/lib/main.cpp 2005-04-11 17:59:52 UTC (rev 14590) @@ -19,8 +19,7 @@ HANDLE hThread = NULL; BOOL thread_abort = FALSE; -extern const char* tree_server; -char* PML_Download (const char* name, const char* local_name = "packmgr.txt", const char* server = tree_server, BOOL totemp = TRUE); +char* PML_Download (const char* url, const char* server = "tree", const char* filename = NULL); // Abort other thread _____ Modified: trunk/rosapps/packmgr/lib/package.cpp --- trunk/rosapps/packmgr/lib/package.cpp 2005-04-11 17:28:14 UTC (rev 14589) +++ trunk/rosapps/packmgr/lib/package.cpp 2005-04-11 17:59:52 UTC (rev 14590) @@ -169,7 +169,7 @@ UINT count = pack->depencies.size(); WCHAR buffer[2000], buffer2[200]; wcscpy(buffer, PML_TransError(ERR_DEP1)); - + for (i=0; i<pack->depencies.size(); i++) { int item = PML_FindItem(tree, pack->depencies[i]); @@ -190,16 +190,18 @@ wcscat(buffer, PML_TransError(ERR_DEP2)); if(count) + { if(!Ask(buffer)) return ERR_GENERIC; - for (i=0; i<pack->depencies.size(); i++) - { - int item = PML_FindItem(tree, pack->depencies[i]); + for (i=0; i<pack->depencies.size(); i++) + { + int item = PML_FindItem(tree, pack->depencies[i]); - tree->packages[item].neededBy.push_back(id); + tree->packages[item].neededBy.push_back(id); - PML_SetAction(tree, item, action, SetIcon, Ask); + PML_SetAction(tree, item, action, SetIcon, Ask); + } } } _____ Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml --- trunk/rosapps/packmgr/tree/mozcontrol.xml 2005-04-11 17:28:14 UTC (rev 14589) +++ trunk/rosapps/packmgr/tree/mozcontrol.xml 2005-04-11 17:59:52 UTC (rev 14590) @@ -2,6 +2,5 @@ <name>MozillaControl</name> <description>Provide the Gekko Engine for ReactOS.</description> <scripts inst="mozillacontrol.inst.rps" srcinst="mozillacontrol.inst.rps"/> - <depent>abiword</depent> </package>
19 years, 8 months
1
0
0
0
[hpoussin] 14589: Filip Navara <xnavara@volny.cz>: Use correct service name in IopInitializeDriverModule
by hpoussin@svn.reactos.com
Filip Navara <xnavara(a)volny.cz>: Use correct service name in IopInitializeDriverModule Modified: trunk/reactos/ntoskrnl/include/internal/io.h Modified: trunk/reactos/ntoskrnl/io/driver.c Modified: trunk/reactos/ntoskrnl/io/iomgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c _____ Modified: trunk/reactos/ntoskrnl/include/internal/io.h --- trunk/reactos/ntoskrnl/include/internal/io.h 2005-04-11 15:43:04 UTC (rev 14588) +++ trunk/reactos/ntoskrnl/include/internal/io.h 2005-04-11 17:28:14 UTC (rev 14589) @@ -491,6 +491,7 @@ IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, IN PMODULE_OBJECT ModuleObject, + IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject); _____ Modified: trunk/reactos/ntoskrnl/io/driver.c --- trunk/reactos/ntoskrnl/io/driver.c 2005-04-11 15:43:04 UTC (rev 14588) +++ trunk/reactos/ntoskrnl/io/driver.c 2005-04-11 17:28:14 UTC (rev 14589) @@ -511,6 +511,9 @@ * Module object representing the driver. It can be retrieve by * IopLoadServiceModule. * + * ServiceName + * Name of the service (as in registry). + * * FileSystemDriver * Set to TRUE for file system drivers. * @@ -523,6 +526,7 @@ IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, IN PMODULE_OBJECT ModuleObject, + IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject) { @@ -533,7 +537,7 @@ Status = IopCreateDriverObject( DriverObject, - &DeviceNode->ServiceName, + ServiceName, FileSystemDriver, ModuleObject->Base, ModuleObject->Length); @@ -544,14 +548,14 @@ return Status; } - if (DeviceNode->ServiceName.Buffer) + if (ServiceName->Buffer) { - RegistryKey.Length = DeviceNode->ServiceName.Length + + RegistryKey.Length = ServiceName->Length + sizeof(ServicesKeyName) - sizeof(UNICODE_NULL); RegistryKey.MaximumLength = RegistryKey.Length + sizeof(UNICODE_NULL); RegistryKey.Buffer = ExAllocatePool(PagedPool, RegistryKey.MaximumLength); wcscpy(RegistryKey.Buffer, ServicesKeyName); - wcscat(RegistryKey.Buffer, DeviceNode->ServiceName.Buffer); + wcscat(RegistryKey.Buffer, ServiceName->Buffer); } else { @@ -613,7 +617,8 @@ if (!NT_SUCCESS(Status)) continue; - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, FALSE, &DriverObject); + Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName, + FALSE, &DriverObject); if (!NT_SUCCESS(Status)) continue; @@ -1165,8 +1170,8 @@ * Initialize the driver */ - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, FALSE, - &DriverObject); + Status = IopInitializeDriverModule(DeviceNode, ModuleObject, + &DeviceNode->ServiceName, FALSE, &DriverObject); if (!NT_SUCCESS(Status)) { @@ -1873,6 +1878,7 @@ Status = IopInitializeDriverModule( DeviceNode, ModuleObject, + &DeviceNode->ServiceName, (Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ || Type == 8 /* SERVICE_RECOGNIZER_DRIVER */), &DriverObject); _____ Modified: trunk/reactos/ntoskrnl/io/iomgr.c --- trunk/reactos/ntoskrnl/io/iomgr.c 2005-04-11 15:43:04 UTC (rev 14588) +++ trunk/reactos/ntoskrnl/io/iomgr.c 2005-04-11 17:28:14 UTC (rev 14589) @@ -595,6 +595,7 @@ Status = IopInitializeDriverModule( DeviceNode, &ModuleObject, + &DeviceNode->ServiceName, TRUE, &DriverObject); if (!NT_SUCCESS(Status)) _____ Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c --- trunk/reactos/ntoskrnl/io/pnpmgr.c 2005-04-11 15:43:04 UTC (rev 14588) +++ trunk/reactos/ntoskrnl/io/pnpmgr.c 2005-04-11 17:28:14 UTC (rev 14589) @@ -1501,7 +1501,8 @@ Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject); if (NT_SUCCESS(Status)) { - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, FALSE, &DriverObject); + Status = IopInitializeDriverModule(DeviceNode, ModuleObject, + &DeviceNode->ServiceName, FALSE, &DriverObject); if (NT_SUCCESS(Status)) { /* Attach lower level filter drivers. */
19 years, 8 months
1
0
0
0
[arty] 14588: Commit for blight: fix stack alignment.
by arty@svn.reactos.com
Commit for blight: fix stack alignment. Modified: trunk/reactos/lib/crtdll/stdlib/alloca.c _____ Modified: trunk/reactos/lib/crtdll/stdlib/alloca.c --- trunk/reactos/lib/crtdll/stdlib/alloca.c 2005-04-11 12:49:25 UTC (rev 14587) +++ trunk/reactos/lib/crtdll/stdlib/alloca.c 2005-04-11 15:43:04 UTC (rev 14588) @@ -11,12 +11,8 @@ if ( s == 0 ) return NULL; - - if ( (s & 0xfffffffc) != 0 ) - as += 4; - - as &= 0xfffffffc; - + as = (as + 3) & (~3); + __asm__ __volatile__( "mov %0, %%edx \n" // "popl %%ebp \n"
19 years, 8 months
1
0
0
0
[fireball] 14587: Initial version of uhci driver import from Linux 2.5 kernel. Currently compiles and links, but not usable (most probably will bugcheck when loaded).
by fireball@svn.reactos.com
Initial version of uhci driver import from Linux 2.5 kernel. Currently compiles and links, but not usable (most probably will bugcheck when loaded). Also a lot of compile warnings exist. I will update UsbStack wiki page sometime soon to reflect direction of my work. Modified: trunk/reactos/drivers/usb/cromwell/Makefile Modified: trunk/reactos/drivers/usb/cromwell/core/usb.c Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.def Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h Modified: trunk/reactos/drivers/usb/cromwell/linux/usb.h Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c Added: trunk/reactos/drivers/usb/cromwell/uhci/ Added: trunk/reactos/drivers/usb/cromwell/uhci/makefile Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci-debug.c Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci-hcd.c Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci-hcd.h Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci-hub.c Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci.def Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci.rc Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci_config.h Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci_main.c _____ Modified: trunk/reactos/drivers/usb/cromwell/Makefile --- trunk/reactos/drivers/usb/cromwell/Makefile 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/Makefile 2005-04-11 12:49:25 UTC (rev 14587) @@ -6,7 +6,7 @@ include $(PATH_TO_TOP)/rules.mak -DRIVERS = core host +DRIVERS = core host uhci all: $(DRIVERS) _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usb.c --- trunk/reactos/drivers/usb/cromwell/core/usb.c 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/core/usb.c 2005-04-11 12:49:25 UTC (rev 14587) @@ -688,7 +688,7 @@ * * A pointer to the device with the incremented reference counter is returned. */ -struct usb_device *usb_get_dev (struct usb_device *dev) +struct usb_device STDCALL *usb_get_dev (struct usb_device *dev) { struct device *tmp; _____ Modified: trunk/reactos/drivers/usb/cromwell/core/usbcore.def --- trunk/reactos/drivers/usb/cromwell/core/usbcore.def 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/core/usbcore.def 2005-04-11 12:49:25 UTC (rev 14587) @@ -8,6 +8,7 @@ usb_alloc_urb@8 usb_free_urb@4 usb_get_urb@4 +usb_get_dev@4 usb_submit_urb@8 usb_unlink_urb@4 usb_bus_init@4 _____ Modified: trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h --- trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/linux/linux_wrapper.h 2005-04-11 12:49:25 UTC (rev 14587) @@ -443,6 +443,8 @@ #define pci_unregister_driver(a) do {} while(0) +#define pci_write_config_word(a,b,c) my_pci_write_config_word(a,b,c) + #define bus_register(a) do {} while(0) #define bus_unregister(a) do {} while(0) _____ Modified: trunk/reactos/drivers/usb/cromwell/linux/usb.h --- trunk/reactos/drivers/usb/cromwell/linux/usb.h 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/linux/usb.h 2005-04-11 12:49:25 UTC (rev 14587) @@ -272,7 +272,7 @@ #define to_usb_device(d) container_of(d, struct usb_device, dev) extern struct usb_device STDCALL *usb_alloc_dev(struct usb_device *parent, struct usb_bus *); -extern struct usb_device *usb_get_dev(struct usb_device *dev); +extern struct usb_device STDCALL *usb_get_dev(struct usb_device *dev); extern void STDCALL usb_put_dev(struct usb_device *dev); /* mostly for devices emulating SCSI over USB */ _____ Modified: trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c --- trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/sys/linuxwrapper.c 2005-04-11 12:49:25 UTC (rev 14587) @@ -290,6 +290,16 @@ return NULL; } /*---------------------------------------------------------------------- --*/ +int my_pci_write_config_word(struct pci_dev *dev, int where, u16 val) +{ + //dev->bus, dev->devfn, where, val + OHCI_DEVICE_EXTENSION *dev_ext = (OHCI_DEVICE_EXTENSION *)dev->dev_ext; + + //FIXME: Is returning this value correct? + //FIXME: Mixing pci_dev and win structs isn't a good thing at all + return HalSetBusDataByOffset(PCIConfiguration, dev->bus->number, dev_ext->SystemIoSlotNumber, &val, where, sizeof(val)); +} +/*--------------------------------------------------------------------- ---*/ int my_request_irq(unsigned int irq, int (*handler)(int,void *, struct pt_regs *), unsigned long mode, const char *desc, void *data) _____ Added: trunk/reactos/drivers/usb/cromwell/uhci/makefile --- trunk/reactos/drivers/usb/cromwell/uhci/makefile 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/uhci/makefile 2005-04-11 12:49:25 UTC (rev 14587) @@ -0,0 +1,16 @@ +PATH_TO_TOP = ../../../.. + +TARGET_TYPE = export_driver + +TARGET_NAME = uhci + +TARGET_DDKLIBS = ntoskrnl.a usbcore.a + +TARGET_CFLAGS = -Wall -I$(PATH_TO_TOP)/ntoskrnl/include -DDEBUG_MODE + +TARGET_OBJECTS = \ + uhci-hcd.o uhci_main.o ../sys/ros_wrapper.o ../sys/linuxwrapper.o + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk _____ Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci-debug.c --- trunk/reactos/drivers/usb/cromwell/uhci/uhci-debug.c 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/uhci/uhci-debug.c 2005-04-11 12:49:25 UTC (rev 14587) @@ -0,0 +1,616 @@ +/* + * UHCI-specific debugging code. Invaluable when something + * goes wrong, but don't get in my face. + * + * Kernel visible pointers are surrounded in []'s and bus + * visible pointers are surrounded in ()'s + * + * (C) Copyright 1999 Linus Torvalds + * (C) Copyright 1999-2001 Johannes Erdfelt + */ + +#if 0 +#include <linux/config.h> +#include <linux/kernel.h> +#include <linux/proc_fs.h> +#include <linux/smp_lock.h> +#include <asm/io.h> +#endif + +#include "uhci-hcd.h" + +/* Handle REALLY large printk's so we don't overflow buffers */ +static inline void lprintk(char *buf) +{ + char *p; + + /* Just write one line at a time */ + while (buf) { + p = strchr(buf, '\n'); + if (p) + *p = 0; + printk(KERN_DEBUG "%s\n", buf); + buf = p; + if (buf) + buf++; + } +} + +static inline int uhci_is_skeleton_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) +{ + int i; + + for (i = 0; i < UHCI_NUM_SKELQH; i++) + if (qh == uhci->skelqh[i]) + return 1; + + return 0; +} + +static int uhci_show_td(struct uhci_td *td, char *buf, int len, int space) +{ + char *out = buf; + char *spid; + u32 status, token; + + /* Try to make sure there's enough memory */ + if (len < 160) + return 0; + + status = td_status(td); + out += sprintf(out, "%*s[%p] link (%08x) ", space, "", td, le32_to_cpu(td->link)); + out += sprintf(out, "e%d %s%s%s%s%s%s%s%s%s%sLength=%x ", + ((status >> 27) & 3), + (status & TD_CTRL_SPD) ? "SPD " : "", + (status & TD_CTRL_LS) ? "LS " : "", + (status & TD_CTRL_IOC) ? "IOC " : "", + (status & TD_CTRL_ACTIVE) ? "Active " : "", + (status & TD_CTRL_STALLED) ? "Stalled " : "", + (status & TD_CTRL_DBUFERR) ? "DataBufErr " : "", + (status & TD_CTRL_BABBLE) ? "Babble " : "", + (status & TD_CTRL_NAK) ? "NAK " : "", + (status & TD_CTRL_CRCTIMEO) ? "CRC/Timeo " : "", + (status & TD_CTRL_BITSTUFF) ? "BitStuff " : "", + status & 0x7ff); + + token = td_token(td); + switch (uhci_packetid(token)) { + case USB_PID_SETUP: + spid = "SETUP"; + break; + case USB_PID_OUT: + spid = "OUT"; + break; + case USB_PID_IN: + spid = "IN"; + break; + default: + spid = "?"; + break; + } + + out += sprintf(out, "MaxLen=%x DT%d EndPt=%x Dev=%x, PID=%x(%s) ", + token >> 21, + ((token >> 19) & 1), + (token >> 15) & 15, + (token >> 8) & 127, + (token & 0xff), + spid); + out += sprintf(out, "(buf=%08x)\n", le32_to_cpu(td->buffer)); + + return out - buf; +} + +static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) +{ + char *out = buf; + struct urb_priv *urbp; + struct list_head *head, *tmp; + struct uhci_td *td; + int i = 0, checked = 0, prevactive = 0; + + /* Try to make sure there's enough memory */ + if (len < 80 * 6) + return 0; + + out += sprintf(out, "%*s[%p] link (%08x) element (%08x)\n", space, "", + qh, le32_to_cpu(qh->link), le32_to_cpu(qh->element)); + + if (qh->element & UHCI_PTR_QH) + out += sprintf(out, "%*s Element points to QH (bug?)\n", space, ""); + + if (qh->element & UHCI_PTR_DEPTH) + out += sprintf(out, "%*s Depth traverse\n", space, ""); + + if (qh->element & cpu_to_le32(8)) + out += sprintf(out, "%*s Bit 3 set (bug?)\n", space, ""); + + if (!(qh->element & ~(UHCI_PTR_QH | UHCI_PTR_DEPTH))) + out += sprintf(out, "%*s Element is NULL (bug?)\n", space, ""); + + if (!qh->urbp) { + out += sprintf(out, "%*s urbp == NULL\n", space, ""); + goto out; + } + + urbp = qh->urbp; + + head = &urbp->td_list; + tmp = head->next; + + td = list_entry(tmp, struct uhci_td, list); + + if (cpu_to_le32(td->dma_handle) != (qh->element & ~UHCI_PTR_BITS)) + out += sprintf(out, "%*s Element != First TD\n", space, ""); + + while (tmp != head) { + struct uhci_td *td = list_entry(tmp, struct uhci_td, list); + + tmp = tmp->next; + + out += sprintf(out, "%*s%d: ", space + 2, "", i++); + out += uhci_show_td(td, out, len - (out - buf), 0); + + if (i > 10 && !checked && prevactive && tmp != head && + debug <= 2) { + struct list_head *ntmp = tmp; + struct uhci_td *ntd = td; + int active = 1, ni = i; + + checked = 1; + + while (ntmp != head && ntmp->next != head && active) { + ntd = list_entry(ntmp, struct uhci_td, list); + + ntmp = ntmp->next; + + active = td_status(ntd) & TD_CTRL_ACTIVE; + + ni++; + } + + if (active && ni > i) { + out += sprintf(out, "%*s[skipped %d active TD's]\n", space, "", ni - i); + tmp = ntmp; + td = ntd; + i = ni; + } + } + + prevactive = td_status(td) & TD_CTRL_ACTIVE; + } + + if (list_empty(&urbp->queue_list) || urbp->queued) + goto out; + + out += sprintf(out, "%*sQueued QH's:\n", -space, "--"); + + head = &urbp->queue_list; + tmp = head->next; + + while (tmp != head) { + struct urb_priv *nurbp = list_entry(tmp, struct urb_priv, + queue_list); + tmp = tmp->next; + + out += uhci_show_qh(nurbp->qh, out, len - (out - buf), space); + } + +out: + return out - buf; +} + +#define show_frame_num() \ + if (!shown) { \ + shown = 1; \ + out += sprintf(out, "- Frame %d\n", i); \ + } + +#ifdef CONFIG_PROC_FS +static const char *qh_names[] = { + "skel_int128_qh", "skel_int64_qh", + "skel_int32_qh", "skel_int16_qh", + "skel_int8_qh", "skel_int4_qh", + "skel_int2_qh", "skel_int1_qh", + "skel_ls_control_qh", "skel_fs_control_qh", + "skel_bulk_qh", "skel_term_qh" +}; + +#define show_qh_name() \ + if (!shown) { \ + shown = 1; \ + out += sprintf(out, "- %s\n", qh_names[i]); \ + } + +static int uhci_show_sc(int port, unsigned short status, char *buf, int len) +{ + char *out = buf; + + /* Try to make sure there's enough memory */ + if (len < 160) + return 0; + + out += sprintf(out, " stat%d = %04x %s%s%s%s%s%s%s%s%s%s\n", + port, + status, + (status & USBPORTSC_SUSP) ? " Suspend" : "", + (status & USBPORTSC_OCC) ? " OverCurrentChange" : "", + (status & USBPORTSC_OC) ? " OverCurrent" : "", + (status & USBPORTSC_PR) ? " Reset" : "", + (status & USBPORTSC_LSDA) ? " LowSpeed" : "", + (status & USBPORTSC_RD) ? " ResumeDetect" : "", + (status & USBPORTSC_PEC) ? " EnableChange" : "", + (status & USBPORTSC_PE) ? " Enabled" : "", + (status & USBPORTSC_CSC) ? " ConnectChange" : "", + (status & USBPORTSC_CCS) ? " Connected" : ""); + + return out - buf; +} + +static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) +{ + char *out = buf; + unsigned int io_addr = uhci->io_addr; + unsigned short usbcmd, usbstat, usbint, usbfrnum; + unsigned int flbaseadd; + unsigned char sof; + unsigned short portsc1, portsc2; + + /* Try to make sure there's enough memory */ + if (len < 80 * 6) + return 0; + + usbcmd = inw(io_addr + 0); + usbstat = inw(io_addr + 2); + usbint = inw(io_addr + 4); + usbfrnum = inw(io_addr + 6); + flbaseadd = inl(io_addr + 8); + sof = inb(io_addr + 12); + portsc1 = inw(io_addr + 16); + portsc2 = inw(io_addr + 18); + + out += sprintf(out, " usbcmd = %04x %s%s%s%s%s%s%s%s\n", + usbcmd, + (usbcmd & USBCMD_MAXP) ? "Maxp64 " : "Maxp32 ", + (usbcmd & USBCMD_CF) ? "CF " : "", + (usbcmd & USBCMD_SWDBG) ? "SWDBG " : "", + (usbcmd & USBCMD_FGR) ? "FGR " : "", + (usbcmd & USBCMD_EGSM) ? "EGSM " : "", + (usbcmd & USBCMD_GRESET) ? "GRESET " : "", + (usbcmd & USBCMD_HCRESET) ? "HCRESET " : "", + (usbcmd & USBCMD_RS) ? "RS " : ""); + + out += sprintf(out, " usbstat = %04x %s%s%s%s%s%s\n", + usbstat, + (usbstat & USBSTS_HCH) ? "HCHalted " : "", + (usbstat & USBSTS_HCPE) ? "HostControllerProcessError " : "", + (usbstat & USBSTS_HSE) ? "HostSystemError " : "", + (usbstat & USBSTS_RD) ? "ResumeDetect " : "", + (usbstat & USBSTS_ERROR) ? "USBError " : "", + (usbstat & USBSTS_USBINT) ? "USBINT " : ""); + + out += sprintf(out, " usbint = %04x\n", usbint); + out += sprintf(out, " usbfrnum = (%d)%03x\n", (usbfrnum >> 10) & 1, + 0xfff & (4*(unsigned int)usbfrnum)); + out += sprintf(out, " flbaseadd = %08x\n", flbaseadd); + out += sprintf(out, " sof = %02x\n", sof); + out += uhci_show_sc(1, portsc1, out, len - (out - buf)); + out += uhci_show_sc(2, portsc2, out, len - (out - buf)); + + return out - buf; +} + +static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, char *buf, int len) +{ + struct list_head *tmp; + char *out = buf; + int count = 0; + + if (len < 200) + return 0; + + out += sprintf(out, "urb_priv [%p] ", urbp); + out += sprintf(out, "urb [%p] ", urbp->urb); + out += sprintf(out, "qh [%p] ", urbp->qh); + out += sprintf(out, "Dev=%d ", usb_pipedevice(urbp->urb->pipe)); + out += sprintf(out, "EP=%x(%s) ", usb_pipeendpoint(urbp->urb->pipe), (usb_pipein(urbp->urb->pipe) ? "IN" : "OUT")); + + switch (usb_pipetype(urbp->urb->pipe)) { + case PIPE_ISOCHRONOUS: out += sprintf(out, "ISO "); break; + case PIPE_INTERRUPT: out += sprintf(out, "INT "); break; + case PIPE_BULK: out += sprintf(out, "BLK "); break; + case PIPE_CONTROL: out += sprintf(out, "CTL "); break; + } + + out += sprintf(out, "%s", (urbp->fsbr ? "FSBR " : "")); + out += sprintf(out, "%s", (urbp->fsbr_timeout ? "FSBR_TO " : "")); + + if (urbp->urb->status != -EINPROGRESS) + out += sprintf(out, "Status=%d ", urbp->urb->status); + //out += sprintf(out, "Inserttime=%lx ",urbp->inserttime); + //out += sprintf(out, "FSBRtime=%lx ",urbp->fsbrtime); + + count = 0; + list_for_each(tmp, &urbp->td_list) + count++; + out += sprintf(out, "TDs=%d ",count); + + if (urbp->queued) + out += sprintf(out, "queued\n"); + else { + count = 0; + list_for_each(tmp, &urbp->queue_list) + count++; + out += sprintf(out, "queued URBs=%d\n", count); + } + + return out - buf; +} + +static int uhci_show_lists(struct uhci_hcd *uhci, char *buf, int len) +{ + char *out = buf; + struct list_head *head, *tmp; + int count; + + out += sprintf(out, "Main list URBs:"); + if (list_empty(&uhci->urb_list)) + out += sprintf(out, " Empty\n"); + else { + out += sprintf(out, "\n"); + count = 0; + head = &uhci->urb_list; + tmp = head->next; + while (tmp != head) { + struct urb_priv *urbp = list_entry(tmp, struct urb_priv, urb_list); + + out += sprintf(out, " %d: ", ++count); + out += uhci_show_urbp(uhci, urbp, out, len - (out - buf)); + tmp = tmp->next; + } + } + + out += sprintf(out, "Remove list URBs:"); + if (list_empty(&uhci->urb_remove_list)) + out += sprintf(out, " Empty\n"); + else { + out += sprintf(out, "\n"); + count = 0; + head = &uhci->urb_remove_list; + tmp = head->next; + while (tmp != head) { + struct urb_priv *urbp = list_entry(tmp, struct urb_priv, urb_list); + + out += sprintf(out, " %d: ", ++count); + out += uhci_show_urbp(uhci, urbp, out, len - (out - buf)); + tmp = tmp->next; + } + } + + out += sprintf(out, "Complete list URBs:"); + if (list_empty(&uhci->complete_list)) + out += sprintf(out, " Empty\n"); + else { + out += sprintf(out, "\n"); + count = 0; + head = &uhci->complete_list; + tmp = head->next; + while (tmp != head) { + struct urb_priv *urbp = list_entry(tmp, struct urb_priv, urb_list); + + out += sprintf(out, " %d: ", ++count); + out += uhci_show_urbp(uhci, urbp, out, len - (out - buf)); + tmp = tmp->next; + } + } + + return out - buf; +} + +static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) +{ + unsigned long flags; + char *out = buf; + int i, j; + struct uhci_qh *qh; + struct uhci_td *td; + struct list_head *tmp, *head; + + spin_lock_irqsave(&uhci->schedule_lock, flags); + + out += sprintf(out, "HC status\n"); + out += uhci_show_status(uhci, out, len - (out - buf)); + + out += sprintf(out, "Frame List\n"); + for (i = 0; i < UHCI_NUMFRAMES; ++i) { + int shown = 0; + td = uhci->fl->frame_cpu[i]; + if (!td) + continue; + + if (td->dma_handle != (dma_addr_t)uhci->fl->frame[i]) { + show_frame_num(); + out += sprintf(out, " frame list does not match td->dma_handle!\n"); + } + show_frame_num(); + + head = &td->fl_list; + tmp = head; + do { + td = list_entry(tmp, struct uhci_td, fl_list); + tmp = tmp->next; + out += uhci_show_td(td, out, len - (out - buf), 4); + } while (tmp != head); + } + + out += sprintf(out, "Skeleton QH's\n"); + + for (i = 0; i < UHCI_NUM_SKELQH; ++i) { + int shown = 0; + + qh = uhci->skelqh[i]; + + if (debug > 1) { + show_qh_name(); + out += uhci_show_qh(qh, out, len - (out - buf), 4); + } + + /* Last QH is the Terminating QH, it's different */ + if (i == UHCI_NUM_SKELQH - 1) { + if (qh->link != UHCI_PTR_TERM) + out += sprintf(out, " bandwidth reclamation on!\n"); + + if (qh->element != cpu_to_le32(uhci->term_td->dma_handle)) + out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); + + continue; + } + + j = (i < 7) ? 7 : i+1; /* Next skeleton */ + if (list_empty(&qh->list)) { + if (i < UHCI_NUM_SKELQH - 1) { + if (qh->link != + (cpu_to_le32(uhci->skelqh[j]->dma_handle) | UHCI_PTR_QH)) { + show_qh_name(); + out += sprintf(out, " skeleton QH not linked to next skeleton QH!\n"); + } + } + + continue; + } + + show_qh_name(); + + head = &qh->list; + tmp = head->next; + + while (tmp != head) { + qh = list_entry(tmp, struct uhci_qh, list); + + tmp = tmp->next; + + out += uhci_show_qh(qh, out, len - (out - buf), 4); + } + + if (i < UHCI_NUM_SKELQH - 1) { + if (qh->link != + (cpu_to_le32(uhci->skelqh[j]->dma_handle) | UHCI_PTR_QH)) + out += sprintf(out, " last QH not linked to next skeleton!\n"); + } + } + + if (debug > 2) + out += uhci_show_lists(uhci, out, len - (out - buf)); + + spin_unlock_irqrestore(&uhci->schedule_lock, flags); + + return out - buf; +} + +#define MAX_OUTPUT (64 * 1024) + +static struct proc_dir_entry *uhci_proc_root = NULL; + +struct uhci_proc { + int size; + char *data; + struct uhci_hcd *uhci; +}; + +static int uhci_proc_open(struct inode *inode, struct file *file) +{ + const struct proc_dir_entry *dp = PDE(inode); + struct uhci_hcd *uhci = dp->data; + struct uhci_proc *up; + int ret = -ENOMEM; + + lock_kernel(); + up = kmalloc(sizeof(*up), GFP_KERNEL); + if (!up) + goto out; + + up->data = kmalloc(MAX_OUTPUT, GFP_KERNEL); + if (!up->data) { + kfree(up); + goto out; + } + + up->size = uhci_sprint_schedule(uhci, up->data, MAX_OUTPUT); + + file->private_data = up; + + ret = 0; +out: + unlock_kernel(); + return ret; +} + +static loff_t uhci_proc_lseek(struct file *file, loff_t off, int whence) +{ + struct uhci_proc *up; + loff_t new = -1; + + lock_kernel(); + up = file->private_data; + + switch (whence) { + case 0: + new = off; + break; + case 1: + new = file->f_pos + off; + break; + } + if (new < 0 || new > up->size) { + unlock_kernel(); + return -EINVAL; + } + unlock_kernel(); + return (file->f_pos = new); +} + +static ssize_t uhci_proc_read(struct file *file, char *buf, size_t nbytes, + loff_t *ppos) +{ + struct uhci_proc *up = file->private_data; + unsigned int pos; + unsigned int size; + + pos = *ppos; + size = up->size; + if (pos >= size) + return 0; + if (nbytes >= size) + nbytes = size; + if (pos + nbytes > size) + nbytes = size - pos; + + if (!access_ok(VERIFY_WRITE, buf, nbytes)) + return -EINVAL; + + if (copy_to_user(buf, up->data + pos, nbytes)) + return -EFAULT; + + *ppos += nbytes; + + return nbytes; +} + +static int uhci_proc_release(struct inode *inode, struct file *file) +{ + struct uhci_proc *up = file->private_data; + + kfree(up->data); + kfree(up); + + return 0; +} + +static struct file_operations uhci_proc_operations = { + .open = uhci_proc_open, + .llseek = uhci_proc_lseek, + .read = uhci_proc_read, +// write: uhci_proc_write, + .release = uhci_proc_release, +}; +#endif _____ Added: trunk/reactos/drivers/usb/cromwell/uhci/uhci-hcd.c --- trunk/reactos/drivers/usb/cromwell/uhci/uhci-hcd.c 2005-04-11 08:41:58 UTC (rev 14586) +++ trunk/reactos/drivers/usb/cromwell/uhci/uhci-hcd.c 2005-04-11 12:49:25 UTC (rev 14587) @@ -0,0 +1,2617 @@ +/* + * Universal Host Controller Interface driver for USB. + * + * Maintainer: Johannes Erdfelt <johannes(a)erdfelt.com> + * + * (C) Copyright 1999 Linus Torvalds + * (C) Copyright 1999-2002 Johannes Erdfelt, johannes(a)erdfelt.com + * (C) Copyright 1999 Randy Dunlap + * (C) Copyright 1999 Georg Acher, acher(a)in.tum.de + * (C) Copyright 1999 Deti Fliegl, deti(a)fliegl.de + * (C) Copyright 1999 Thomas Sailer, sailer(a)ife.ee.ethz.ch + * (C) Copyright 1999 Roman Weissgaerber, weissg(a)vienna.at + * (C) Copyright 2000 Yggdrasil Computing, Inc. (port of new PCI interface + * support from usb-ohci.c by Adam Richter, adam(a)yggdrasil.com). + * (C) Copyright 1999 Gregory P. Smith (from usb-ohci.c) + * + * Intel documents this fairly well, and as far as I know there + * are no royalties or anything like that, but even so there are + * people who decided that they want to do the same thing in a + * completely different way. + * + * WARNING! The USB documentation is downright evil. Most of it + * is just crap, written by a committee. You're better off ignoring + * most of it, the important stuff is: + * - the low-level protocol (fairly simple but lots of small details) + * - working around the horridness of the rest + */ + +#if 0 +#include <linux/config.h> +#include <linux/module.h> +#include <linux/pci.h> +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/delay.h> +#include <linux/ioport.h> +#include <linux/sched.h> +#include <linux/slab.h> +#include <linux/smp_lock.h> +#include <linux/errno.h> +#include <linux/unistd.h> +#include <linux/interrupt.h> +#include <linux/spinlock.h> +#include <linux/proc_fs.h> +#ifdef CONFIG_USB_DEBUG +#define DEBUG +#else +#undef DEBUG +#endif +#include <linux/usb.h> + +#include <asm/uaccess.h> +#include <asm/io.h> +#include <asm/irq.h> +#include <asm/system.h> +#endif + +#include "uhci_config.h" +#include "../usb_wrapper.h" +#include "../core/hcd.h" +#include "uhci-hcd.h" + +#if 0 +#include <linux/pm.h> +#endif + +/* + * Version Information + */ +#define DRIVER_VERSION "v2.1" +#define DRIVER_AUTHOR "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, Randy Dunlap, Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber" +#define DRIVER_DESC "USB Universal Host Controller Interface driver" + +/* + * debug = 0, no debugging messages + * debug = 1, dump failed URB's except for stalls + * debug = 2, dump all failed URB's (including stalls) + * show all queues in /proc/driver/uhci/[pci_addr] + * debug = 3, show all TD's in URB's when dumping + */ +#ifdef DEBUG +static int debug = 1; +#else +static int debug = 0; +#endif +MODULE_PARM(debug, "i"); +MODULE_PARM_DESC(debug, "Debug level"); +static char *errbuf; +#define ERRBUF_LEN (PAGE_SIZE * 8) + +#include "uhci-hub.c" +#include "uhci-debug.c" + +static kmem_cache_t *uhci_up_cachep; /* urb_priv */ + +static int uhci_get_current_frame_number(struct uhci_hcd *uhci); +static int uhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb); +static void uhci_unlink_generic(struct uhci_hcd *uhci, struct urb *urb); + +static void hc_state_transitions(struct uhci_hcd *uhci); + +/* If a transfer is still active after this much time, turn off FSBR */ +#define IDLE_TIMEOUT (HZ / 20) /* 50 ms */ +#define FSBR_DELAY (HZ / 20) /* 50 ms */ + +/* When we timeout an idle transfer for FSBR, we'll switch it over to */ +/* depth first traversal. We'll do it in groups of this number of TD's */ +/* to make sure it doesn't hog all of the bandwidth */ +#define DEPTH_INTERVAL 5 + +/* + * Technically, updating td->status here is a race, but it's not really a + * problem. The worst that can happen is that we set the IOC bit again + * generating a spurious interrupt. We could fix this by creating another + * QH and leaving the IOC bit always set, but then we would have to play + * games with the FSBR code to make sure we get the correct order in all + * the cases. I don't think it's worth the effort + */ +static inline void uhci_set_next_interrupt(struct uhci_hcd *uhci) +{ + unsigned long flags; + + spin_lock_irqsave(&uhci->frame_list_lock, flags); + uhci->term_td->status |= cpu_to_le32(TD_CTRL_IOC); + spin_unlock_irqrestore(&uhci->frame_list_lock, flags); +} + +static inline void uhci_clear_next_interrupt(struct uhci_hcd *uhci) +{ + unsigned long flags; + + spin_lock_irqsave(&uhci->frame_list_lock, flags); + uhci->term_td->status &= ~cpu_to_le32(TD_CTRL_IOC); + spin_unlock_irqrestore(&uhci->frame_list_lock, flags); +} + +static inline void uhci_add_complete(struct uhci_hcd *uhci, struct urb *urb) +{ + struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv; + unsigned long flags; + + spin_lock_irqsave(&uhci->complete_list_lock, flags); + list_add_tail(&urbp->complete_list, &uhci->complete_list); + spin_unlock_irqrestore(&uhci->complete_list_lock, flags); +} + +static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci, struct usb_device *dev) +{ + dma_addr_t dma_handle; + struct uhci_td *td; + + td = pci_pool_alloc(uhci->td_pool, GFP_ATOMIC, &dma_handle); + if (!td) + return NULL; + + td->dma_handle = dma_handle; + + td->link = UHCI_PTR_TERM; + td->buffer = 0; + + td->frame = -1; + td->dev = dev; + + INIT_LIST_HEAD(&td->list); + INIT_LIST_HEAD(&td->fl_list); + + usb_get_dev(dev); + + return td; +} + +static inline void uhci_fill_td(struct uhci_td *td, __u32 status, + __u32 token, __u32 buffer) +{ + td->status = cpu_to_le32(status); + td->token = cpu_to_le32(token); + td->buffer = cpu_to_le32(buffer); +} + +/* + * We insert Isochronous URB's directly into the frame list at the beginning + */ +static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td, unsigned framenum) +{ + unsigned long flags; + + framenum %= UHCI_NUMFRAMES; + + spin_lock_irqsave(&uhci->frame_list_lock, flags); + + td->frame = framenum; + + /* Is there a TD already mapped there? */ + if (uhci->fl->frame_cpu[framenum]) { + struct uhci_td *ftd, *ltd; + + ftd = uhci->fl->frame_cpu[framenum]; + ltd = list_entry(ftd->fl_list.prev, struct uhci_td, fl_list); + + list_add_tail(&td->fl_list, &ftd->fl_list); + + td->link = ltd->link; + mb(); + ltd->link = cpu_to_le32(td->dma_handle); + } else { + td->link = uhci->fl->frame[framenum]; + mb(); + uhci->fl->frame[framenum] = cpu_to_le32(td->dma_handle); + uhci->fl->frame_cpu[framenum] = td; + } + + spin_unlock_irqrestore(&uhci->frame_list_lock, flags); +} + +static void uhci_remove_td(struct uhci_hcd *uhci, struct uhci_td *td) +{ + unsigned long flags; + + /* If it's not inserted, don't remove it */ + spin_lock_irqsave(&uhci->frame_list_lock, flags); + if (td->frame == -1 && list_empty(&td->fl_list)) + goto out; + + if (td->frame != -1 && uhci->fl->frame_cpu[td->frame] == td) { + if (list_empty(&td->fl_list)) { + uhci->fl->frame[td->frame] = td->link; + uhci->fl->frame_cpu[td->frame] = NULL; + } else { + struct uhci_td *ntd; + + ntd = list_entry(td->fl_list.next, struct uhci_td, fl_list); + uhci->fl->frame[td->frame] = cpu_to_le32(ntd->dma_handle); + uhci->fl->frame_cpu[td->frame] = ntd; + } + } else { + struct uhci_td *ptd; + + ptd = list_entry(td->fl_list.prev, struct uhci_td, fl_list); + ptd->link = td->link; + } + + mb(); + td->link = UHCI_PTR_TERM; + + list_del_init(&td->fl_list); + td->frame = -1; + +out: + spin_unlock_irqrestore(&uhci->frame_list_lock, flags); +} + +/* + * Inserts a td into qh list at the top. + */ +static void uhci_insert_tds_in_qh(struct uhci_qh *qh, struct urb *urb, u32 breadth) +{ + struct list_head *tmp, *head; + struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv; + struct uhci_td *td, *ptd; + + if (list_empty(&urbp->td_list)) + return; + + head = &urbp->td_list; + tmp = head->next; + + /* Ordering isn't important here yet since the QH hasn't been */ + /* inserted into the schedule yet */ [truncated at 1000 lines; 3303 more skipped]
19 years, 8 months
1
0
0
0
[arty] 14586: Use the right set (the referenced file objects) to compare when killing
by arty@svn.reactos.com
Use the right set (the referenced file objects) to compare when killing exclusive select objects. This fixes the select leakage observed when running Xircon. Modified: trunk/reactos/drivers/net/afd/afd/select.c _____ Modified: trunk/reactos/drivers/net/afd/afd/select.c --- trunk/reactos/drivers/net/afd/afd/select.c 2005-04-11 08:07:41 UTC (rev 14585) +++ trunk/reactos/drivers/net/afd/afd/select.c 2005-04-11 08:41:58 UTC (rev 14586) @@ -120,6 +120,7 @@ PAFD_ACTIVE_POLL Poll; PIRP Irp; PAFD_POLL_INFO PollReq; + PAFD_HANDLE HandleArray; int i; AFD_DbgPrint(MID_TRACE,("Killing selects that refer to %x\n", FileObject)); @@ -132,11 +133,12 @@ ListEntry = ListEntry->Flink; Irp = Poll->Irp; PollReq = Irp->AssociatedIrp.SystemBuffer; - + HandleArray = AFD_HANDLES(PollReq); + for( i = 0; i < PollReq->HandleCount; i++ ) { AFD_DbgPrint(MAX_TRACE,("Req: %x, This %x\n", - PollReq->Handles[i].Handle, FileObject)); - if( (PVOID)PollReq->Handles[i].Handle == FileObject && + HandleArray[i].Handle, FileObject)); + if( (PVOID)HandleArray[i].Handle == FileObject && (!OnlyExclusive || (OnlyExclusive && Poll->Exclusive)) ) { ZeroEvents( PollReq->Handles, PollReq->HandleCount ); SignalSocket( Poll, PollReq, STATUS_SUCCESS );
19 years, 8 months
1
0
0
0
[arty] 14585: Fixed warning, uninitialized length. Sorry, I did this in a different way
by arty@svn.reactos.com
Fixed warning, uninitialized length. Sorry, I did this in a different way and missed one use of NewBufferLen. Not sure why I don't see the 'might be used uninitialized' warning. Modified: trunk/reactos/drivers/net/afd/afd/lock.c _____ Modified: trunk/reactos/drivers/net/afd/afd/lock.c --- trunk/reactos/drivers/net/afd/afd/lock.c 2005-04-11 06:03:20 UTC (rev 14584) +++ trunk/reactos/drivers/net/afd/afd/lock.c 2005-04-11 08:07:41 UTC (rev 14585) @@ -50,7 +50,6 @@ UINT Size = sizeof(AFD_WSABUF) * (Count + Lock); PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 ); PMDL NewMdl; - INT NewBufferLen; AFD_DbgPrint(MID_TRACE,("Called\n")); @@ -61,7 +60,7 @@ RtlCopyMemory( NewBuf, Buf, sizeof(AFD_WSABUF) * Count ); if( LockAddress ) { NewBuf[Count].buf = AddressBuf; - NewBuf[Count].len = NewBufferLen; + NewBuf[Count].len = *AddressLen; Count++; NewBuf[Count].buf = (PVOID)AddressLen; NewBuf[Count].len = sizeof(*AddressLen);
19 years, 8 months
1
0
0
0
[arty] 14584: lock: Fixes suggested by w3seek:
by arty@svn.reactos.com
lock: Fixes suggested by w3seek: protect the remaining MmProbeAndLockPages don't return from the exception handler read: Hopefully the last indecision in here: Avoid using AFD_EVENT_CLOSE until the socket is really toast. Use AFD_EVENT_DISCONNECT instead when we've got an EOF, but still have buffered data. I was doing this socket fiddling without a callout block. Fixed. Modified: trunk/reactos/drivers/net/afd/afd/lock.c Modified: trunk/reactos/drivers/net/afd/afd/read.c _____ Modified: trunk/reactos/drivers/net/afd/afd/lock.c --- trunk/reactos/drivers/net/afd/afd/lock.c 2005-04-10 21:01:13 UTC (rev 14583) +++ trunk/reactos/drivers/net/afd/afd/lock.c 2005-04-11 06:03:20 UTC (rev 14584) @@ -59,7 +59,14 @@ _SEH_TRY { RtlCopyMemory( NewBuf, Buf, sizeof(AFD_WSABUF) * Count ); - NewBufferLen = *AddressLen; + if( LockAddress ) { + NewBuf[Count].buf = AddressBuf; + NewBuf[Count].len = NewBufferLen; + Count++; + NewBuf[Count].buf = (PVOID)AddressLen; + NewBuf[Count].len = sizeof(*AddressLen); + Count++; + } } _SEH_HANDLE { AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info " "from userland (%x %x)\n", @@ -68,15 +75,6 @@ return NULL; } _SEH_END; - if( LockAddress ) { - NewBuf[Count].buf = AddressBuf; - NewBuf[Count].len = NewBufferLen; - Count++; - NewBuf[Count].buf = (PVOID)AddressLen; - NewBuf[Count].len = sizeof(*AddressLen); - Count++; - } - for( i = 0; i < Count; i++ ) { AFD_DbgPrint(MID_TRACE,("Locking buffer %d (%x:%d)\n", i, NewBuf[i].buf, NewBuf[i].len)); _____ Modified: trunk/reactos/drivers/net/afd/afd/read.c --- trunk/reactos/drivers/net/afd/afd/read.c 2005-04-10 21:01:13 UTC (rev 14583) +++ trunk/reactos/drivers/net/afd/afd/read.c 2005-04-11 06:03:20 UTC (rev 14584) @@ -36,7 +36,7 @@ VOID HandleEOFOnIrp( PAFD_FCB FCB, NTSTATUS Status, UINT Information ) { if( Status == STATUS_SUCCESS && Information == 0 ) { AFD_DbgPrint(MID_TRACE,("Looks like an EOF\n")); - FCB->PollState |= AFD_EVENT_CLOSE /*| AFD_EVENT_DISCONNECT */; + FCB->PollState |= AFD_EVENT_DISCONNECT; PollReeval( FCB->DeviceExt, FCB->FileObject ); } } @@ -109,10 +109,11 @@ ReceiveComplete, FCB ); - if( Status == STATUS_SUCCESS ) + SocketCalloutLeave( FCB ); + + if( Status == STATUS_SUCCESS ) FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information; - HandleEOFOnIrp( FCB, Status, FCB->Recv.Content ); - SocketCalloutLeave( FCB ); + HandleEOFOnIrp( FCB, Status, FCB->ReceiveIrp.Iosb.Information ); } }
19 years, 8 months
1
0
0
0
[fireball] 14583: Started implementing Locale property page of intl.cpl appltet. It already provides choices for locale, the only thing it doesn't do - actually set chosen locale. Also it doesn't work under ReactOS.
by fireball@svn.reactos.com
Started implementing Locale property page of intl.cpl appltet. It already provides choices for locale, the only thing it doesn't do - actually set chosen locale. Also it doesn't work under ReactOS. Modified: trunk/reactos/lib/cpl/intl/de.rc Modified: trunk/reactos/lib/cpl/intl/en.rc Modified: trunk/reactos/lib/cpl/intl/locale.c _____ Modified: trunk/reactos/lib/cpl/intl/de.rc --- trunk/reactos/lib/cpl/intl/de.rc 2005-04-10 19:44:11 UTC (rev 14582) +++ trunk/reactos/lib/cpl/intl/de.rc 2005-04-10 21:01:13 UTC (rev 14583) @@ -55,7 +55,7 @@ GROUPBOX "Standardsprache", -1, 8, 11, 228, 74 ICON IDC_FLAGS, IDC_ICON1, 12, 26, 21, 20, SS_ICON LTEXT "Wõhlen Sie eine Sprache und Region aus welche Sie benutzen wollen:", -1, 38, 25, 193, 22 - COMBOBOX IDC_LANGUAGELIST, 39, 49, 191, 83, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP + COMBOBOX IDC_LANGUAGELIST, 39, 49, 191, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP END _____ Modified: trunk/reactos/lib/cpl/intl/en.rc --- trunk/reactos/lib/cpl/intl/en.rc 2005-04-10 19:44:11 UTC (rev 14582) +++ trunk/reactos/lib/cpl/intl/en.rc 2005-04-10 21:01:13 UTC (rev 14583) @@ -55,7 +55,7 @@ GROUPBOX "Primary language", -1, 8, 11, 228, 74 ICON IDC_FLAGS, IDC_ICON1, 12, 26, 21, 20, SS_ICON LTEXT "Select the primary language and region you want to use:", -1, 38, 25, 193, 22 - COMBOBOX IDC_LANGUAGELIST, 39, 49, 191, 83, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP + COMBOBOX IDC_LANGUAGELIST, 39, 49, 191, 83, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP END _____ Modified: trunk/reactos/lib/cpl/intl/locale.c --- trunk/reactos/lib/cpl/intl/locale.c 2005-04-10 19:44:11 UTC (rev 14582) +++ trunk/reactos/lib/cpl/intl/locale.c 2005-04-10 21:01:13 UTC (rev 14583) @@ -23,234 +23,68 @@ * PURPOSE: Locale property page * PROGRAMMER: Eric Kohl * Klemens Friedl + * Aleksey Bragin */ +#define WINVER 0x0501 + #include <windows.h> #include <commctrl.h> #include <cpl.h> +#include <stdio.h> + #include "intl.h" #include "resource.h" +HWND hList; -// FIXME: -// * change registry function (-> "HKCR\MIME\Database\Rfc1766") - - - -typedef struct _TZ_INFO +BOOL CALLBACK LocalesEnumProc( + LPTSTR lpLocale // locale id +) { - LONG Bias; - LONG StandardBias; - LONG DaylightBias; - SYSTEMTIME StandardDate; - SYSTEMTIME DaylightDate; -} TZ_INFO, *PTZ_INFO; + LCID lcid; + TCHAR lang[255]; + int index; -typedef struct _TIMEZONE_ENTRY -{ - struct _TIMEZONE_ENTRY *Prev; - struct _TIMEZONE_ENTRY *Next; - WCHAR Description[64]; /* 'Display' */ - WCHAR StandardName[32]; /* 'Std' */ - WCHAR DaylightName[32]; /* 'Dlt' */ - TZ_INFO TimezoneInfo; /* 'TZI' */ - ULONG Index; /* 'Index' */ -} TIMEZONE_ENTRY, *PTIMEZONE_ENTRY; + swscanf(lpLocale, L"%lx", &lcid); // maybe use wcstoul? + GetLocaleInfo(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang)); + index = SendMessageW(hList, + CB_ADDSTRING, + 0, + (LPARAM)lang); -PTIMEZONE_ENTRY TimeZoneListHead = NULL; -PTIMEZONE_ENTRY TimeZoneListTail = NULL; + SendMessageW(hList, + CB_SETITEMDATA, + index, + (LPARAM)lcid); - - - -static PTIMEZONE_ENTRY -GetLargerTimeZoneEntry(DWORD Index) -{ - PTIMEZONE_ENTRY Entry; - - Entry = TimeZoneListHead; - while (Entry != NULL) - { - if (Entry->Index >= Index) - return Entry; - - Entry = Entry->Next; - } - - return NULL; + return TRUE; } static VOID -CreateTimeZoneList(VOID) +CreateLanguagesList(HWND hwnd) { + TCHAR langSel[255]; - WCHAR szKeyName[256]; - DWORD dwIndex; - DWORD dwNameSize; - DWORD dwValueSize; - LONG lError; - HKEY hZonesKey; - HKEY hZoneKey; + hList = hwnd; + EnumSystemLocalesW(LocalesEnumProc, LCID_SUPPORTED); - PTIMEZONE_ENTRY Entry; - PTIMEZONE_ENTRY Current; - - - - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones", - 0, - KEY_ALL_ACCESS, - &hZonesKey)) - return; - - dwIndex = 0; - while (TRUE) - { - dwNameSize = 256; - lError = RegEnumKeyExW(hZonesKey, - dwIndex, - szKeyName, - &dwNameSize, - NULL, - NULL, - NULL, - NULL); - if (lError != ERROR_SUCCESS && lError != ERROR_MORE_DATA) - break; - - - if (RegOpenKeyExW(hZonesKey, - szKeyName, - 0, - KEY_ALL_ACCESS, - &hZoneKey)) - break; - - - Entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TIMEZONE_ENTRY)); - if (Entry == NULL) - { - RegCloseKey(hZonesKey); - break; - } - - dwValueSize = 64 * sizeof(WCHAR); - if (RegQueryValueExW(hZonesKey, - L"Display", - NULL, - NULL, - (LPBYTE)&Entry->Description, - &dwValueSize)) - { - RegCloseKey(hZonesKey); - break; - } - - dwValueSize = 32 * sizeof(WCHAR); - if (RegQueryValueExW(hZonesKey, - L"Std", - NULL, - NULL, - (LPBYTE)&Entry->StandardName, - &dwValueSize)) - { - RegCloseKey(hZonesKey); - break; - } - - dwValueSize = 32 * sizeof(WCHAR); - if (RegQueryValueExW(hZonesKey, - L"Dlt", - NULL, - NULL, - (LPBYTE)&Entry->DaylightName, - &dwValueSize)) - { - RegCloseKey(hZonesKey); - break; - } - - dwValueSize = sizeof(DWORD); - if (RegQueryValueExW(hZonesKey, - L"Index", - NULL, - NULL, - (LPBYTE)&Entry->Index, - &dwValueSize)) - { - RegCloseKey(hZonesKey); - break; - } - - dwValueSize = sizeof(TZ_INFO); - if (RegQueryValueExW(hZonesKey, - L"TZI", - NULL, - NULL, - (LPBYTE)&Entry->TimezoneInfo, - &dwValueSize)) - { - RegCloseKey(hZonesKey); - break; - } - - RegCloseKey(hZoneKey); - - if (TimeZoneListHead == NULL && - TimeZoneListTail == NULL) - { - Entry->Prev = NULL; - Entry->Next = NULL; - TimeZoneListHead = Entry; - TimeZoneListTail = Entry; - } - else - { - Current = GetLargerTimeZoneEntry(Entry->Index); - if (Current != NULL) - { - if (Current == TimeZoneListHead) - { - /* Prepend to head */ - Entry->Prev = NULL; - Entry->Next = TimeZoneListHead; - TimeZoneListHead->Prev = Entry; - TimeZoneListHead = Entry; - } - else - { - /* Insert before current */ - Entry->Prev = Current->Prev; - Entry->Next = Current; - Current->Prev->Next = Entry; - Current->Prev = Entry; - } - } - else - { - /* Append to tail */ - Entry->Prev = TimeZoneListTail; - Entry->Next = NULL; - TimeZoneListTail->Next = Entry; - TimeZoneListTail = Entry; - } - } - - dwIndex++; - } - - RegCloseKey(hZonesKey); - + // Select current locale + GetLocaleInfo(GetUserDefaultLCID(), LOCALE_SLANGUAGE, langSel, sizeof(langSel)); // or should it be System? + + SendMessageW(hList, + CB_SELECTSTRING, + -1, + (LPARAM)langSel); } - +/* static VOID -ShowTimeZoneList(HWND hwnd) +ShowLanguagesList(HWND hwnd) { TIME_ZONE_INFORMATION TimeZoneInfo; PTIMEZONE_ENTRY Entry; @@ -281,10 +115,8 @@ (WPARAM)dwIndex, 0); } +*/ - - - /* Property page dialog callback */ INT_PTR CALLBACK LocalePageProc(HWND hwndDlg, @@ -292,16 +124,59 @@ WPARAM wParam, LPARAM lParam) { - switch(uMsg) - { - case WM_INITDIALOG: + switch(uMsg) + { + case WM_INITDIALOG: + CreateLanguagesList(GetDlgItem(hwndDlg, IDC_LANGUAGELIST)); + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_LANGUAGELIST: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + break; - CreateTimeZoneList(); - ShowTimeZoneList(GetDlgItem(hwndDlg, IDC_LANGUAGELIST)); + case WM_NOTIFY: + { + LPNMHDR lpnm = (LPNMHDR)lParam; + if (lpnm->code == PSN_APPLY) + { + // Apply changes + LCID NewLcid; + int iCurSel; + char tmp[100]; - break; - } - return FALSE; + // Acquire new value + iCurSel = SendMessageW(hList, + CB_GETCURSEL, + 0, + 0); + if (iCurSel == CB_ERR) + break; + + NewLcid = SendMessageW(hList, + CB_GETITEMDATA, + iCurSel, + 0); + + if (NewLcid == CB_ERR) + break; + + + //TOOD: Actually set new locale + + sprintf(tmp, "%x, cursel=%d", NewLcid, iCurSel); + MessageBoxA(hwndDlg, tmp, "debug", MB_OK); + } + } + break; + } + return FALSE; }
19 years, 8 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
48
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Results per page:
10
25
50
100
200