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
[gvg] 14823: Sync to Wine-20050419:
by gvg@svn.reactos.com
Sync to Wine-20050419: Mike McCormack <mike(a)codeweavers.com> - Load and display bitmaps in the dialogs. - Make sure there's only one place we allocate dialog controls. - Rename dupstrW to strdupW, and remove duplicate definition. - Move definition of string manipulation functions to msipriv.h. - Split out database functions, remove dependence on wine/unicode.h. - Fix loading of the summary information. - test cases for summary information - fix memory leaks - Implement summary information loading and saving. - Declare MsiExportDatabase* in the spec file, and fix a typo. - Replace instances of HeapAlloc/MultiByteToWideChar with the internally defined strdupAtoW. - Use strdup, implement MsiDatabaseImportA. Francois Gouget <fgouget(a)free.fr> - Assorted spelling fixes. Peter Berg Larsen <pebl(a)math.ku.dk> - Janitorial: Get rid of strncpy/strncpyW. - Remove 2 identicals calls to strlenW. Jose Manuel Ferrer Ortiz <jmfo1982(a)yahoo.es> - Spanish translations updated. Aric Stewart <aric(a)codeweavers.com> - Implement Publish Components in order for MsiGetQualifiedComponent apis to work. Also implement MsiGetQualifiedComponent, or at least some of the functionality as it is supposed to install stuff if it is absent, which it does not do yet. - Make sure the GUID of the typelib we are registering matches the guid requested from MSI. If not search the given typelib file to find the typelib requested to register. - If running in UI mode, then display the UI mode dialogs at the end of the installs. Steven Edwards <steven_ed4153(a)yahoo.com> - Avoid using ver.h in favor of winver.h. Jakob Eriksson <jakov(a)vmlinux.org> - Get rid of HeapAlloc casts. Hans Leidekker <hans(a)it.vu.nl> - Dutch resource translation. Marcus Meissner <meissner(a)suse.de> - Fixed MsiDatabaseImportA, MsiDatabaseImportW, and MsiCreateAndVerifyInstallerDirectory stub parameter counts. Juan Lang <juan_lang(a)yahoo.com> - Log missing environment vars for easier debugging. Modified: trunk/reactos/include/wine/msidefs.h Modified: trunk/reactos/lib/msi/Makefile.in Modified: trunk/reactos/lib/msi/action.c Modified: trunk/reactos/lib/msi/action.h Modified: trunk/reactos/lib/msi/appsearch.c Modified: trunk/reactos/lib/msi/cond.tab.c Modified: trunk/reactos/lib/msi/cond.tab.h Modified: trunk/reactos/lib/msi/cond.y Modified: trunk/reactos/lib/msi/custom.c Added: trunk/reactos/lib/msi/database.c Modified: trunk/reactos/lib/msi/dialog.c Modified: trunk/reactos/lib/msi/format.c Modified: trunk/reactos/lib/msi/msi.c Modified: trunk/reactos/lib/msi/msi.rc Modified: trunk/reactos/lib/msi/msi.spec Modified: trunk/reactos/lib/msi/msi_Es.rc Added: trunk/reactos/lib/msi/msi_Nl.rc Modified: trunk/reactos/lib/msi/msipriv.h Modified: trunk/reactos/lib/msi/msiquery.c Modified: trunk/reactos/lib/msi/package.c Modified: trunk/reactos/lib/msi/preview.c Modified: trunk/reactos/lib/msi/record.c Modified: trunk/reactos/lib/msi/registry.c Modified: trunk/reactos/lib/msi/suminfo.c Modified: trunk/reactos/lib/msi/table.c _____ Modified: trunk/reactos/include/wine/msidefs.h --- trunk/reactos/include/wine/msidefs.h 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/include/wine/msidefs.h 2005-04-26 20:39:02 UTC (rev 14823) @@ -103,6 +103,49 @@ msidbComponentAttributes64bit = 0x00000100 }; +/* + * Windows SDK braindamage alert + * + * PID_DICTIONARY and PID_CODEPAGE are defined by propidl.h too + * PID_SECURITY is defined in propidl.h with a different value! + * So these need to be undefined first. + */ +#ifdef PID_DICTIONARY +#undef PID_DICTIONARY +#endif + +#ifdef PID_CODEPAGE +#undef PID_CODEPAGE +#endif + +#ifdef PID_SECURITY +#undef PID_SECURITY +#endif + +#define PID_DICTIONARY 0 +#define PID_CODEPAGE 1 +#define PID_TITLE 2 +#define PID_SUBJECT 3 +#define PID_AUTHOR 4 +#define PID_KEYWORDS 5 +#define PID_COMMENTS 6 +#define PID_TEMPLATE 7 +#define PID_LASTAUTHOR 8 +#define PID_REVNUMBER 9 +#define PID_EDITTINE 10 +#define PID_LASTPRINTED 11 +#define PID_CREATE_DTM 12 +#define PID_LASTSAVE_DTM 13 +#define PID_PAGECOUNT 14 +#define PID_WORDCOUNT 15 +#define PID_CHARCOUNT 16 +#define PID_THUMBNAIL 17 +#define PID_APPNAME 18 +#define PID_SECURITY 19 +#define PID_MSIVERSION PID_PAGECOUNT +#define PID_MSISOURCE PID_WORDCOUNT +#define PID_MSIRESTRICT PID_CHARCOUNT + #ifdef __cplusplus } #endif _____ Modified: trunk/reactos/lib/msi/Makefile.in --- trunk/reactos/lib/msi/Makefile.in 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/Makefile.in 2005-04-26 20:39:02 UTC (rev 14823) @@ -11,6 +11,7 @@ appsearch.c \ create.c \ custom.c \ + database.c \ delete.c \ dialog.c \ distinct.c \ _____ Modified: trunk/reactos/lib/msi/action.c --- trunk/reactos/lib/msi/action.c 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/action.c 2005-04-26 20:39:02 UTC (rev 14823) @@ -61,7 +61,7 @@ */ static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran); static UINT ACTION_ProcessUISequence(MSIPACKAGE *package); -static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq); +static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI); static UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, LPWSTR *FilePath); @@ -508,8 +508,8 @@ memset(&package->files[index],0,sizeof(MSIFILE)); - package->files[index].File = dupstrW(name); - package->files[index].TargetPath = dupstrW(path); + package->files[index].File = strdupW(name); + package->files[index].TargetPath = strdupW(path); package->files[index].Temporary = TRUE; TRACE("Tracking tempfile (%s)\n",debugstr_w(package->files[index].File)); @@ -677,7 +677,7 @@ package->ActionFormat = load_dynamic_stringW(row,3); HeapFree(GetProcessHeap(),0,package->LastAction); - package->LastAction = dupstrW(action); + package->LastAction = strdupW(action); msiobj_release(&row->hdr); MSI_ViewClose(view); @@ -864,6 +864,7 @@ DWORD sz; WCHAR buffer[10]; UINT rc; + BOOL ui = FALSE; static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0}; static const WCHAR szAction[] = {'A','C','T','I','O','N',0}; static const WCHAR szInstall[] = {'I','N','S','T','A','L','L',0}; @@ -875,8 +876,8 @@ { LPWSTR p, check, path; - package->PackagePath = dupstrW(szPackagePath); - path = dupstrW(szPackagePath); + package->PackagePath = strdupW(szPackagePath); + path = strdupW(szPackagePath); p = strrchrW(path,'\\'); if (p) { @@ -921,7 +922,7 @@ while (*ptr == ' ') ptr++; len = ptr2-ptr; prop = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - strncpyW(prop,ptr,len); + memcpy(prop,ptr,len*sizeof(WCHAR)); prop[len]=0; ptr2++; @@ -941,7 +942,7 @@ len -= 2; } val = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - strncpyW(val,ptr2,len); + memcpy(val,ptr2,len*sizeof(WCHAR)); val[len] = 0; if (strlenW(prop) > 0) @@ -963,6 +964,7 @@ if (atoiW(buffer) >= INSTALLUILEVEL_REDUCED) { rc = ACTION_ProcessUISequence(package); + ui = TRUE; if (rc == ERROR_SUCCESS) rc = ACTION_ProcessExecSequence(package,TRUE); } @@ -980,13 +982,13 @@ /* process the ending type action */ if (rc == ERROR_SUCCESS) - ACTION_PerformActionSequence(package,-1); + ACTION_PerformActionSequence(package,-1,ui); else if (rc == ERROR_INSTALL_USEREXIT) - ACTION_PerformActionSequence(package,-2); + ACTION_PerformActionSequence(package,-2,ui); else if (rc == ERROR_FUNCTION_FAILED) - ACTION_PerformActionSequence(package,-3); + ACTION_PerformActionSequence(package,-3,ui); else if (rc == ERROR_INSTALL_SUSPEND) - ACTION_PerformActionSequence(package,-4); + ACTION_PerformActionSequence(package,-4,ui); /* finish up running custom actions */ ACTION_FinishCustomActions(package); @@ -994,7 +996,7 @@ return rc; } -static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq) +static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI) { MSIQUERY * view; UINT rc; @@ -1007,8 +1009,17 @@ 'S','e','q','u','e','n','c','e',' ', 'W','H','E','R','E',' ', 'S','e','q','u','e','n','c','e',' ', '=',' ','%','i',0}; - rc = MSI_OpenQuery(package->db, &view, ExecSeqQuery, seq); + static const WCHAR UISeqQuery[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + 'I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e', + ' ', 'W','H','E','R','E',' ', 'S','e','q','u','e','n','c','e', + ' ', '=',' ','%','i',0}; + if (UI) + rc = MSI_OpenQuery(package->db, &view, UISeqQuery, seq); + else + rc = MSI_OpenQuery(package->db, &view, ExecSeqQuery, seq); + if (rc == ERROR_SUCCESS) { rc = MSI_ViewExecute(view, 0); @@ -1058,7 +1069,10 @@ goto end; } - rc = ACTION_PerformAction(package,buffer); + if (UI) + rc = ACTION_PerformUIAction(package,buffer); + else + rc = ACTION_PerformAction(package,buffer); msiobj_release(&row->hdr); end: MSI_ViewClose(view); @@ -1921,7 +1935,7 @@ memset(&package->folders[index],0,sizeof(MSIFOLDER)); - package->folders[index].Directory = dupstrW(dir); + package->folders[index].Directory = strdupW(dir); rc = MSI_OpenQuery(package->db, &view, Query, dir); if (rc != ERROR_SUCCESS) @@ -1980,13 +1994,13 @@ { TRACE(" TargetDefault = %s\n",debugstr_w(targetdir)); HeapFree(GetProcessHeap(),0, package->folders[index].TargetDefault); - package->folders[index].TargetDefault = dupstrW(targetdir); + package->folders[index].TargetDefault = strdupW(targetdir); } if (srcdir) - package->folders[index].SourceDefault = dupstrW(srcdir); + package->folders[index].SourceDefault = strdupW(srcdir); else if (targetdir) - package->folders[index].SourceDefault = dupstrW(targetdir); + package->folders[index].SourceDefault = strdupW(targetdir); HeapFree(GetProcessHeap(), 0, ptargetdir); parent = load_dynamic_stringW(row,2); @@ -2084,13 +2098,13 @@ if (!source && package->folders[i].ResolvedTarget) { - path = dupstrW(package->folders[i].ResolvedTarget); + path = strdupW(package->folders[i].ResolvedTarget); TRACE(" already resolved to %s\n",debugstr_w(path)); return path; } else if (source && package->folders[i].ResolvedSource) { - path = dupstrW(package->folders[i].ResolvedSource); + path = strdupW(package->folders[i].ResolvedSource); return path; } else if (!source && package->folders[i].Property) @@ -2114,7 +2128,7 @@ { TRACE(" TargetDefault = %s\n",debugstr_w(package->folders[i].TargetDefault)); path = build_directory_name(3, p, package->folders[i].TargetDefault, NULL); - package->folders[i].ResolvedTarget = dupstrW(path); + package->folders[i].ResolvedTarget = strdupW(path); TRACE(" resolved into %s\n",debugstr_w(path)); if (set_prop) MSI_SetPropertyW(package,name,path); @@ -2122,7 +2136,7 @@ else { path = build_directory_name(3, p, package->folders[i].SourceDefault, NULL); - package->folders[i].ResolvedSource = dupstrW(path); + package->folders[i].ResolvedSource = strdupW(path); } HeapFree(GetProcessHeap(),0,p); } @@ -3119,7 +3133,7 @@ { if (package->files[index].State >= 2) { - *file_source = dupstrW(package->files[index].TargetPath); + *file_source = strdupW(package->files[index].TargetPath); return ERROR_SUCCESS; } else @@ -3231,7 +3245,7 @@ if (MSI_RecordIsNull(row,5)) { LPWSTR p; - dest_path = dupstrW(file_source); + dest_path = strdupW(file_source); p = strrchrW(dest_path,'\\'); if (p) *p=0; @@ -3523,7 +3537,8 @@ value_data = parse_value(package, value, &type, &size); else { - value_data = NULL; + static const WCHAR szEmpty[] = {0}; + value_data = (LPSTR)strdupW(szEmpty); size = 0; type = REG_SZ; } @@ -3759,7 +3774,7 @@ if (j>=0) { - LPWSTR p = dupstrW(package->files[j].TargetPath); + LPWSTR p = strdupW(package->files[j].TargetPath); return p; } } @@ -4005,6 +4020,61 @@ return rc; } +typedef struct { + CLSID clsid; + LPWSTR source; + + LPWSTR path; + ITypeLib *ptLib; +} typelib_struct; + +BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType, + LPWSTR lpszName, LONG_PTR lParam) +{ + TLIBATTR *attr; + typelib_struct *tl_struct = (typelib_struct*) lParam; + static const WCHAR fmt[] = {'%','s','\\','%','i',0}; + int sz; + HRESULT res; + + if (!IS_INTRESOURCE(lpszName)) + { + ERR("Not Int Resource Name %s\n",debugstr_w(lpszName)); + return TRUE; + } + + sz = strlenW(tl_struct->source)+4; + sz *= sizeof(WCHAR); + + tl_struct->path = HeapAlloc(GetProcessHeap(),0,sz); + sprintfW(tl_struct->path,fmt,tl_struct->source, lpszName); + + TRACE("trying %s\n", debugstr_w(tl_struct->path)); + res = LoadTypeLib(tl_struct->path,&tl_struct->ptLib); + if (!SUCCEEDED(res)) + { + HeapFree(GetProcessHeap(),0,tl_struct->path); + tl_struct->path = NULL; + + return TRUE; + } + + ITypeLib_GetLibAttr(tl_struct->ptLib, &attr); + if (IsEqualGUID(&(tl_struct->clsid),&(attr->guid))) + { + ITypeLib_ReleaseTLibAttr(tl_struct->ptLib, attr); + return FALSE; + } + + HeapFree(GetProcessHeap(),0,tl_struct->path); + tl_struct->path = NULL; + + ITypeLib_ReleaseTLibAttr(tl_struct->ptLib, attr); + ITypeLib_Release(tl_struct->ptLib); + + return TRUE; +} + static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package) { /* @@ -4019,8 +4089,6 @@ static const WCHAR Query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', 'T','y','p','e','L','i','b',0}; - ITypeLib *ptLib; - HRESULT res; if (!package) return ERROR_INVALID_HANDLE; @@ -4042,6 +4110,10 @@ WCHAR component[0x100]; DWORD sz; INT index; + LPWSTR guid; + typelib_struct tl_struct; + HMODULE module; + static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0}; rc = MSI_ViewFetch(view,&row); if (rc != ERROR_SUCCESS) @@ -4082,46 +4154,59 @@ continue; } - res = LoadTypeLib(package->files[index].TargetPath,&ptLib); - if (SUCCEEDED(res)) + guid = load_dynamic_stringW(row,1); + module = LoadLibraryExW(package->files[index].TargetPath, NULL, + LOAD_LIBRARY_AS_DATAFILE); + if (module != NULL) { - LPWSTR help; - WCHAR helpid[0x100]; + CLSIDFromString(guid, &tl_struct.clsid); + tl_struct.source = strdupW(package->files[index].TargetPath); + tl_struct.path = NULL; - sz = 0x100; - MSI_RecordGetStringW(row,6,helpid,&sz); + EnumResourceNamesW(module, szTYPELIB, Typelib_EnumResNameProc, + (LONG_PTR)&tl_struct); - help = resolve_folder(package,helpid,FALSE,FALSE,NULL); - res = RegisterTypeLib(ptLib,package->files[index].TargetPath,help); - HeapFree(GetProcessHeap(),0,help); - - if (!SUCCEEDED(res)) - ERR("Failed to register type library %s\n", - debugstr_w(package->files[index].TargetPath)); - else + if (tl_struct.path != NULL) { - /* Yes the row has more fields than I need, but #1 is - correct and the only one I need. Why make a new row? */ + LPWSTR help; + WCHAR helpid[0x100]; + HRESULT res; - ui_actiondata(package,szRegisterTypeLibraries,row); + sz = 0x100; + MSI_RecordGetStringW(row,6,helpid,&sz); + + help = resolve_folder(package,helpid,FALSE,FALSE,NULL); + res = RegisterTypeLib(tl_struct.ptLib,tl_struct.path,help); + HeapFree(GetProcessHeap(),0,help); + + if (!SUCCEEDED(res)) + ERR("Failed to register type library %s\n", + debugstr_w(tl_struct.path)); + else + { + ui_actiondata(package,szRegisterTypeLibraries,row); - TRACE("Registered %s\n", - debugstr_w(package->files[index].TargetPath)); + TRACE("Registered %s\n", debugstr_w(tl_struct.path)); + } + + ITypeLib_Release(tl_struct.ptLib); + HeapFree(GetProcessHeap(),0,tl_struct.path); } - - if (ptLib) - ITypeLib_Release(ptLib); + else + ERR("Failed to load type library %s\n", + debugstr_w(tl_struct.source)); + + FreeLibrary(module); + HeapFree(GetProcessHeap(),0,tl_struct.source); } else - ERR("Failed to load type library %s\n", - debugstr_w(package->files[index].TargetPath)); - + ERR("Could not load file! %s\n", + debugstr_w(package->files[index].TargetPath)); msiobj_release(&row->hdr); } MSI_ViewClose(view); msiobj_release(&view->hdr); return rc; - } static UINT register_appid(MSIPACKAGE *package, LPCWSTR clsid, LPCWSTR app ) @@ -4362,7 +4447,7 @@ HeapFree(GetProcessHeap(),0,argument); size += (strlenW(package->files[index].TargetPath))*sizeof(WCHAR); - argument = (LPWSTR)HeapAlloc(GetProcessHeap(),0,size+sizeof(WCHAR)); + argument = HeapAlloc(GetProcessHeap(),0,size+sizeof(WCHAR)); strcpyW(argument,package->files[index].TargetPath); if (deformated) { @@ -4882,7 +4967,7 @@ { LPWSTR keypath; FIXME("poorly handled shortcut format, advertised shortcut\n"); - keypath = dupstrW(package->components[index].FullKeypath); + keypath = strdupW(package->components[index].FullKeypath); IShellLinkW_SetPath(sl,keypath); HeapFree(GetProcessHeap(),0,keypath); } _____ Modified: trunk/reactos/lib/msi/action.h --- trunk/reactos/lib/msi/action.h 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/action.h 2005-04-26 20:39:02 UTC (rev 14823) @@ -116,39 +116,3 @@ int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ); int get_loaded_file(MSIPACKAGE* package, LPCWSTR file); int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path); - - - -inline static char *strdupWtoA( const WCHAR *str ) -{ - char *ret = NULL; - if (str) - { - DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL -); - if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) - WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); - } - return ret; -} - -inline static WCHAR *strdupAtoW( const char *str ) -{ - WCHAR *ret = NULL; - if (str) - { - DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); - if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) - MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len ); - } - return ret; -} - -inline static LPWSTR dupstrW(LPCWSTR src) -{ - LPWSTR dest; - if (!src) return NULL; - dest = HeapAlloc(GetProcessHeap(), 0, (strlenW(src)+1)*sizeof(WCHAR)); - strcpyW(dest, src); - return dest; -} _____ Modified: trunk/reactos/lib/msi/appsearch.c --- trunk/reactos/lib/msi/appsearch.c 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/appsearch.c 2005-04-26 20:39:02 UTC (rev 14823) @@ -406,7 +406,7 @@ /* Sets *matches to whether the file (whose path is filePath) matches the * versions set in sig. * Return ERROR_SUCCESS in case of success (whether or not the file matches), - * something else if a install-halting error occurs. + * something else if an install-halting error occurs. */ static UINT ACTION_FileVersionMatches(MSISIGNATURE *sig, LPCWSTR filePath, BOOL *matches) @@ -481,7 +481,7 @@ * fullFilePath is assumed to be the full path of the file specified in * findData, which may be necessary to compare the version. * Return ERROR_SUCCESS in case of success (whether or not the file matches), - * something else if a install-halting error occurs. + * something else if an install-halting error occurs. */ static UINT ACTION_FileMatchesSig(MSISIGNATURE *sig, LPWIN32_FIND_DATAW findData, LPCWSTR fullFilePath, BOOL *matches) @@ -672,8 +672,8 @@ pathWithDrive[0] = 'A' + i; if (GetDriveTypeW(pathWithDrive) == DRIVE_FIXED) { - strncpyW(pathWithDrive + 3, expanded, - sizeof(pathWithDrive) / sizeof(pathWithDrive[0]) - 3); + lstrcpynW(pathWithDrive + 3, expanded, + sizeof(pathWithDrive) / sizeof(pathWithDrive[0]) - 3); if (sig->File) rc = ACTION_RecurseSearchDirectory(package, &found, sig, pathWithDrive, depth); _____ Modified: trunk/reactos/lib/msi/cond.tab.c --- trunk/reactos/lib/msi/cond.tab.c 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/cond.tab.c 2005-04-26 20:39:02 UTC (rev 14823) @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 1.875b. */ +/* A Bison parser, made by GNU Bison 1.875c. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -253,18 +253,25 @@ #if ! defined (yyoverflow) || YYERROR_VERBOSE +# ifndef YYFREE +# define YYFREE free +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# endif + /* The parser invokes alloca or malloc; define the necessary symbols. */ -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# endif # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif @@ -277,15 +284,15 @@ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -306,7 +313,7 @@ /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if 1 < __GNUC__ +# if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else @@ -454,14 +461,14 @@ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "COND_SPACE", "COND_EOF", "COND_OR", - "COND_AND", "COND_NOT", "COND_LT", "COND_GT", "COND_EQ", "COND_LPAR", - "COND_RPAR", "COND_TILDA", "COND_PERCENT", "COND_DOLLARS", - "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT", - "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition", - "expression", "boolean_term", "boolean_factor", "term", "comp_op_i", - "comp_op_s", "comp_op_m1", "comp_op_m2", "value_i", "value_s", - "literal", "symbol_i", "symbol_s", "identifier", "integer", 0 + "$end", "error", "$undefined", "COND_SPACE", "COND_EOF", "COND_OR", + "COND_AND", "COND_NOT", "COND_LT", "COND_GT", "COND_EQ", "COND_LPAR", + "COND_RPAR", "COND_TILDA", "COND_PERCENT", "COND_DOLLARS", + "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT", + "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition", + "expression", "boolean_term", "boolean_factor", "term", "comp_op_i", + "comp_op_s", "comp_op_m1", "comp_op_m2", "value_i", "value_s", "literal", + "symbol_i", "symbol_s", "identifier", "integer", 0 }; #endif @@ -624,7 +631,7 @@ #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily @@ -659,11 +666,11 @@ are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + ((Current).first_line = (Rhs)[1].first_line, \ + (Current).first_column = (Rhs)[1].first_column, \ + (Current).last_line = (Rhs)[N].last_line, \ + (Current).last_column = (Rhs)[N].last_column) #endif /* YYLEX -- calling `yylex' with the right arguments. */ @@ -707,7 +714,7 @@ /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) @@ -786,7 +793,7 @@ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 +#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif @@ -1714,8 +1721,8 @@ } -/* Line 999 of yacc.c. */ -#line 1719 "cond.tab.c" +/* Line 1000 of yacc.c. */ +#line 1726 "cond.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -1818,25 +1825,27 @@ /* If just tried and failed to reuse lookahead token after an error, discard it. */ - /* Return failure if at end of input. */ - if (yychar == YYEOF) + if (yychar <= YYEOF) { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) - { - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; + /* If at end of input, pop the error token, + then the rest of the stack, then return failure. */ + if (yychar == YYEOF) + for (;;) + { + YYPOPSTACK; + if (yyssp == yyss) + YYABORT; + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + } } + else + { + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); + yychar = YYEMPTY; - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - + } } /* Else will try to reuse lookahead token after shifting the error @@ -1844,9 +1853,27 @@ goto yyerrlab1; -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + +#ifdef __GNUC__ + /* Pacify GCC when the user code never invokes YYERROR and the label + yyerrorlab therefore never appears in user code. */ + if (0) + goto yyerrorlab; +#endif + + yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ @@ -1870,9 +1897,8 @@ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; - + YYPOPSTACK; + yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -2123,7 +2149,7 @@ ret = HeapAlloc( GetProcessHeap(), 0, (str->len+1) * sizeof (WCHAR) ); if( ret ) { - strncpyW( ret, str->data, str->len ); + memcpy( ret, str->data, str->len * sizeof(WCHAR)); ret[str->len]=0; } TRACE("Got identifier %s\n",debugstr_w(ret)); _____ Modified: trunk/reactos/lib/msi/cond.tab.h --- trunk/reactos/lib/msi/cond.tab.h 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/cond.tab.h 2005-04-26 20:39:02 UTC (rev 14823) @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 1.875b. */ +/* A Bison parser, made by GNU Bison 1.875c. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -86,7 +86,7 @@ comp_m1 fn_comp_m1; comp_m2 fn_comp_m2; } YYSTYPE; -/* Line 1252 of yacc.c. */ +/* Line 1275 of yacc.c. */ #line 91 "cond.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 _____ Modified: trunk/reactos/lib/msi/cond.y --- trunk/reactos/lib/msi/cond.y 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/cond.y 2005-04-26 20:39:02 UTC (rev 14823) @@ -701,7 +701,7 @@ ret = HeapAlloc( GetProcessHeap(), 0, (str->len+1) * sizeof (WCHAR) ); if( ret ) { - strncpyW( ret, str->data, str->len ); + memcpy( ret, str->data, str->len * sizeof(WCHAR)); ret[str->len]=0; } TRACE("Got identifier %s\n",debugstr_w(ret)); _____ Modified: trunk/reactos/lib/msi/custom.c --- trunk/reactos/lib/msi/custom.c 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/custom.c 2005-04-26 20:39:02 UTC (rev 14823) @@ -145,7 +145,7 @@ else newbuf = HeapAlloc(GetProcessHeap(),0, sizeof(LPWSTR)); - newbuf[count] = dupstrW(action); + newbuf[count] = strdupW(action); package->CommitAction = newbuf; } else @@ -160,7 +160,7 @@ else newbuf = HeapAlloc(GetProcessHeap(),0, sizeof(LPWSTR)); - newbuf[count] = dupstrW(action); + newbuf[count] = strdupW(action); package->DeferredAction = newbuf; } @@ -326,7 +326,7 @@ newbuf[count].handle = Handle; newbuf[count].process = process; - newbuf[count].name = dupstrW(name); + newbuf[count].name = strdupW(name); package->RunningAction = newbuf; } @@ -508,8 +508,8 @@ info = HeapAlloc( GetProcessHeap(), 0, sizeof(*info) ); msiobj_addref( &package->hdr ); info->package = package; - info->target = dupstrW(target); - info->source = dupstrW(tmp_file); + info->target = strdupW(target); + info->source = strdupW(tmp_file); ThreadHandle = CreateThread(NULL,0,DllThread,(LPVOID)info,0,&ThreadId); @@ -542,7 +542,7 @@ if (deformated) len += strlenW(deformated); - cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len); + cmd = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len); strcpyW(cmd,tmp_file); if (deformated) @@ -595,7 +595,7 @@ len += strlenW(deformated); len += 2; - cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR)); + cmd = HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR)); strcpyW(cmd, package->files[index].TargetPath); if (deformated) @@ -692,7 +692,7 @@ if (deformated) len += strlenW(deformated); - cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len); + cmd = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len); strcpyW(cmd,prop); if (deformated) _____ Copied: trunk/reactos/lib/msi/database.c (from rev 14822, vendor/wine/dlls/msi/current/database.c) Property changes on: trunk/reactos/lib/msi/database.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/msi/dialog.c --- trunk/reactos/lib/msi/dialog.c 2005-04-26 20:05:25 UTC (rev 14822) +++ trunk/reactos/lib/msi/dialog.c 2005-04-26 20:39:02 UTC (rev 14823) @@ -18,6 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define COBJMACROS + #include <stdarg.h> #include "windef.h" @@ -28,6 +30,8 @@ #include "msi.h" #include "msipriv.h" #include "msidefs.h" +#include "ocidl.h" +#include "olectl.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -55,6 +59,7 @@ HWND hwnd; msi_handler handler; LPWSTR property; + IPicture *pic; WCHAR name[1]; }; @@ -131,7 +136,7 @@ ret = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); if( !ret ) return ret; - strncpyW( ret, p, len ); + memcpy( ret, p, len*sizeof(WCHAR) ); ret[len-1] = 0; return ret; } @@ -226,17 +231,16 @@ return r; } -static msi_control *msi_dialog_add_control( msi_dialog *dialog, - MSIRECORD *rec, LPCWSTR szCls, DWORD style ) +static msi_control *msi_dialog_create_window( msi_dialog *dialog, + MSIRECORD *rec, LPCWSTR szCls, LPCWSTR name, LPCWSTR text, + DWORD style, HWND parent ) { - DWORD x, y, width, height, attributes; - LPCWSTR text, name; + DWORD x, y, width, height; LPWSTR font = NULL, title = NULL; - msi_control *control = NULL; + msi_control *control; style |= WS_CHILD | WS_GROUP; - name = MSI_RecordGetString( rec, 2 ); control = HeapAlloc( GetProcessHeap(), 0, sizeof *control + strlenW(name)*sizeof(WCHAR) ); strcpyW( control->name, name ); @@ -244,39 +248,57 @@ dialog->control_list = control; control->handler = NULL; control->property = NULL; + control->pic = NULL; x = MSI_RecordGetInteger( rec, 4 ); y = MSI_RecordGetInteger( rec, 5 ); width = MSI_RecordGetInteger( rec, 6 ); height = MSI_RecordGetInteger( rec, 7 ); - attributes = MSI_RecordGetInteger( rec, 8 ); - text = MSI_RecordGetString( rec, 10 ); - TRACE("Dialog %s control %s\n", debugstr_w(dialog->name), debugstr_w(text)); - x = msi_dialog_scale_unit( dialog, x ); y = msi_dialog_scale_unit( dialog, y ); width = msi_dialog_scale_unit( dialog, width ); height = msi_dialog_scale_unit( dialog, height ); - if( attributes & 1 ) [truncated at 1000 lines; 2820 more skipped]
19 years, 8 months
1
0
0
0
[gvg] 14822: Sync to Wine-20050419:
by gvg@svn.reactos.com
Sync to Wine-20050419: Jose Manuel Ferrer Ortiz <jmfo1982(a)yahoo.es> - Spanish translations updated. Jakob Eriksson <jakov(a)vmlinux.org> - Get rid of HeapAlloc casts. Modified: trunk/reactos/lib/mpr/mpr_Es.rc Modified: trunk/reactos/lib/mpr/wnet.c _____ Modified: trunk/reactos/lib/mpr/mpr_Es.rc --- trunk/reactos/lib/mpr/mpr_Es.rc 2005-04-26 19:18:13 UTC (rev 14821) +++ trunk/reactos/lib/mpr/mpr_Es.rc 2005-04-26 20:05:25 UTC (rev 14822) @@ -1,7 +1,7 @@ /* * MPR dll Spanish resources * - * Copyright (C) 2004 JosÚ Manuel Ferrer Ortiz + * Copyright (C) 2004, 2005 JosÚ Manuel Ferrer Ortiz * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,3 +24,23 @@ { IDS_ENTIRENETWORK "Toda la red" } + +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Introduzca contrase±a de red" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Por favor, introduzca su nombre de usuario y contrase±a:", IDC_EXPLAIN, 40, 6, 150, 15 + LTEXT "Proxy", -1, 40, 26, 50, 10 +/* LTEXT "Realm", -1, 40, 46, 50, 10 */ + LTEXT "Usuario", -1, 40, 66, 50, 10 + LTEXT "Contrase±a", -1, 40, 86, 50, 10 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Guardar esta contrase±a (Inseguro)", IDC_SAVEPASSWORD, + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Aceptar", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} _____ Modified: trunk/reactos/lib/mpr/wnet.c --- trunk/reactos/lib/mpr/wnet.c 2005-04-26 19:18:13 UTC (rev 14821) +++ trunk/reactos/lib/mpr/wnet.c 2005-04-26 20:05:25 UTC (rev 14822) @@ -138,7 +138,7 @@ RegQueryValueExW(hKey, szProviderName, NULL, NULL, NULL, &size); if (size) { - name = (PWSTR)HeapAlloc(GetProcessHeap(), 0, size); + name = HeapAlloc(GetProcessHeap(), 0, size); if (RegQueryValueExW(hKey, szProviderName, NULL, &type, (LPBYTE)name, &size) != ERROR_SUCCESS || type != REG_SZ) { @@ -243,7 +243,7 @@ RegQueryValueExW(hKey, providerOrder, NULL, NULL, NULL, &size); if (size) { - PWSTR providers = (PWSTR)HeapAlloc(GetProcessHeap(), 0, size); + PWSTR providers = HeapAlloc(GetProcessHeap(), 0, size); if (providers) { @@ -264,7 +264,7 @@ if (ptr) numToAllocate++; } - providerTable = (PWNetProviderTable) + providerTable = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetProviderTable) + (numToAllocate - 1) * sizeof(WNetProvider)); @@ -275,7 +275,7 @@ entireNetworkLen = LoadStringW(hInstDll, IDS_ENTIRENETWORK, NULL, 0); - providerTable->entireNetwork = (LPWSTR)HeapAlloc( + providerTable->entireNetwork = HeapAlloc( GetProcessHeap(), 0, (entireNetworkLen + 1) * sizeof(WCHAR)); if (providerTable->entireNetwork) @@ -343,8 +343,7 @@ if (lpNet) { - ret = (LPNETRESOURCEW)HeapAlloc(GetProcessHeap(), 0, - sizeof(NETRESOURCEW)); + ret = HeapAlloc(GetProcessHeap(), 0, sizeof(NETRESOURCEW)); if (ret) { size_t len; @@ -354,8 +353,7 @@ if (lpNet->lpRemoteName) { len = strlenW(lpNet->lpRemoteName) + 1; - ret->lpRemoteName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, - len * sizeof(WCHAR)); + ret->lpRemoteName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (ret->lpRemoteName) strcpyW(ret->lpRemoteName, lpNet->lpRemoteName); } @@ -377,7 +375,7 @@ static PWNetEnumerator _createNullEnumerator(void) { - PWNetEnumerator ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(), + PWNetEnumerator ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetEnumerator)); if (ret) @@ -388,7 +386,7 @@ static PWNetEnumerator _createGlobalEnumeratorW(DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNet) { - PWNetEnumerator ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(), + PWNetEnumerator ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetEnumerator)); if (ret) @@ -411,8 +409,7 @@ ret = NULL; else { - ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, sizeof(WNetEnumerator)); + ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetEnumerator)); if (ret) { ret->enumType = WNET_ENUMERATOR_TYPE_PROVIDER; @@ -429,7 +426,7 @@ static PWNetEnumerator _createContextEnumerator(DWORD dwScope, DWORD dwType, DWORD dwUsage) { - PWNetEnumerator ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(), + PWNetEnumerator ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetEnumerator)); if (ret) @@ -641,7 +638,7 @@ ret = _thunkNetResourceArrayAToW(lpNet, &count, buf, &size); if (ret == WN_MORE_DATA) { - lpNetWide = (LPNETRESOURCEW)HeapAlloc(GetProcessHeap(), 0, + lpNetWide = HeapAlloc(GetProcessHeap(), 0, size); if (lpNetWide) { @@ -1538,7 +1535,7 @@ if (len) { - PWSTR wideLocalName = (PWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + PWSTR wideLocalName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (wideLocalName) { @@ -1569,7 +1566,7 @@ } else if (ret == WN_MORE_DATA) { - PWSTR wideRemote = (PWSTR)HeapAlloc(GetProcessHeap(), 0, + PWSTR wideRemote = HeapAlloc(GetProcessHeap(), 0, wideRemoteSize * sizeof(WCHAR)); if (wideRemote) @@ -1863,8 +1860,7 @@ len = MultiByteToWideChar(CP_ACP, 0, lpProvider, -1, NULL, 0); if (len) { - LPWSTR wideProvider = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, - len * sizeof(WCHAR)); + LPWSTR wideProvider = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (wideProvider) {
19 years, 8 months
1
0
0
0
[gvg] 14821: Sync to Wine-20050419:
by gvg@svn.reactos.com
Sync to Wine-20050419: Francois Gouget <fgouget(a)free.fr> - Assorted spelling fixes. - SBSP_ABSOLUTE is 0 so we cannot do (wFlags & SBSP_ABSOLUTE). - Add COMDLG32_DumpSBSPFlags(). Eric Pouech <pouech-eric(a)wanadoo.fr> - Added proper definition for PRINTDLGEX[AW] structures. Jakob Eriksson <jakov(a)vmlinux.org> - Get rid of HeapAlloc casts. Juan Lang <juan_lang(a)yahoo.com> - Change a fixme to a warn, and use W version of call. Peter Berg Larsen <pebl(a)math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. - Janitorial: Get rid of strncpy/strncpyW. Modified: trunk/reactos/lib/comdlg32/colordlg.c Modified: trunk/reactos/lib/comdlg32/colordlg16.c Modified: trunk/reactos/lib/comdlg32/filedlg.c Modified: trunk/reactos/lib/comdlg32/filedlgbrowser.c Modified: trunk/reactos/lib/comdlg32/printdlg.c Modified: trunk/reactos/lib/comdlg32/printdlg16.c Modified: trunk/reactos/w32api/include/shlobj.h _____ Modified: trunk/reactos/lib/comdlg32/colordlg.c --- trunk/reactos/lib/comdlg32/colordlg.c 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/lib/comdlg32/colordlg.c 2005-04-26 19:18:13 UTC (rev 14821) @@ -65,7 +65,7 @@ /* Chose Color PRIVATE Structure: * * This structure is duplicated in the 16 bit code with - * a extra member + * an extra member */ typedef struct CCPRIVATE _____ Modified: trunk/reactos/lib/comdlg32/colordlg16.c --- trunk/reactos/lib/comdlg32/colordlg16.c 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/lib/comdlg32/colordlg16.c 2005-04-26 19:18:13 UTC (rev 14821) @@ -46,7 +46,7 @@ /* Chose Color PRIVATE Structure: * * This is a duplicate of the 32bit code with - * a extra member + * an extra member */ typedef struct CCPRIVATE { _____ Modified: trunk/reactos/lib/comdlg32/filedlg.c --- trunk/reactos/lib/comdlg32/filedlg.c 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/lib/comdlg32/filedlg.c 2005-04-26 19:18:13 UTC (rev 14821) @@ -462,16 +462,17 @@ if(ofn->lpstrFile) { fodInfos.filename = MemAlloc(ofn->nMaxFile*sizeof(WCHAR)); - strncpyW(fodInfos.filename,ofn->lpstrFile,ofn->nMaxFile); + lstrcpynW(fodInfos.filename,ofn->lpstrFile,ofn->nMaxFile); } else fodInfos.filename = NULL; if(ofn->lpstrInitialDir) { - DWORD len = strlenW(ofn->lpstrInitialDir); - fodInfos.initdir = MemAlloc((len+1)*sizeof(WCHAR)); - strcpyW(fodInfos.initdir,ofn->lpstrInitialDir); + /* fodInfos.initdir = strdupW(ofn->lpstrInitialDir); */ + DWORD len = strlenW(ofn->lpstrInitialDir)+1; + fodInfos.initdir = MemAlloc(len*sizeof(WCHAR)); + memcpy(fodInfos.initdir,ofn->lpstrInitialDir,len*sizeof(WCHAR)); } else fodInfos.initdir = NULL; @@ -853,7 +854,7 @@ /* Prepend the current path */ n = strlenW(lpstrCurrentDir) + 1; - strncpyW( bufW, lpstrCurrentDir, size ); + memcpy( bufW, lpstrCurrentDir, min(n,size) * sizeof(WCHAR)); if(n<size) { /* 'n' includes trailing \0 */ @@ -2034,7 +2035,7 @@ { LPOPENFILENAMEW ofn = fodInfos->ofnInfos; - strncpyW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile); + lstrcpynW(ofn->lpstrFile, lpstrPathAndFile, ofn->nMaxFile); if (ofn->Flags & OFN_ALLOWMULTISELECT) ofn->lpstrFile[lstrlenW(ofn->lpstrFile) + 1] = '\0'; } @@ -2064,7 +2065,7 @@ if(fodInfos->unicode) { LPOPENFILENAMEW ofn = fodInfos->ofnInfos; - strncpyW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle); + lstrcpynW(ofn->lpstrFileTitle, lpstrFileTitle, ofn->nMaxFileTitle); } else { @@ -2406,7 +2407,7 @@ /*********************************************************************** * FILEDLG95_FILETYPE_SearchExt * - * searches for a extension in the filetype box + * searches for an extension in the filetype box */ static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPCWSTR lpstrExt) { @@ -2958,7 +2959,7 @@ /* allocate the buffer */ if (nFiles <= 1) nLength = MAX_PATH; - lpstrAllFile = (LPSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength); + lpstrAllFile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength); lpstrAllFile[0] = '\0'; /* Generate the string for the edit control */ _____ Modified: trunk/reactos/lib/comdlg32/filedlgbrowser.c --- trunk/reactos/lib/comdlg32/filedlgbrowser.c 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/lib/comdlg32/filedlgbrowser.c 2005-04-26 19:18:13 UTC (rev 14821) @@ -95,6 +95,49 @@ * Helper functions */ +#define add_flag(a) if (flags & a) {strcat(str, #a );strcat(str," ");} +static void COMDLG32_DumpSBSPFlags(UINT uflags) +{ + if (TRACE_ON(commdlg)) + { + unsigned int i; + static const struct { + DWORD mask; + const char *name; + } flags[] = { +#define FE(x) { x, #x} + /* SBSP_DEFBROWSER == 0 */ + FE(SBSP_SAMEBROWSER), + FE(SBSP_NEWBROWSER), + + /* SBSP_DEFMODE == 0 */ + FE(SBSP_OPENMODE), + FE(SBSP_EXPLOREMODE), + FE(SBSP_HELPMODE), + FE(SBSP_NOTRANSFERHIST), + + /* SBSP_ABSOLUTE == 0 */ + FE(SBSP_RELATIVE), + FE(SBSP_PARENT), + FE(SBSP_NAVIGATEBACK), + FE(SBSP_NAVIGATEFORWARD), + FE(SBSP_ALLOW_AUTONAVIGATE), + + FE(SBSP_NOAUTOSELECT), + FE(SBSP_WRITENOHISTORY), + + FE(SBSP_REDIRECT), + FE(SBSP_INITIATEDBYHLINKFRAME), + }; +#undef FE + DPRINTF("SBSP Flags: %08x =", uflags); + for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) + if (flags[i].mask & uflags) + DPRINTF("%s ", flags[i].name); + DPRINTF("\n"); + } +} + static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos) { char lpstrPath[MAX_PATH]; @@ -314,10 +357,8 @@ IShellBrowserImpl *This = (IShellBrowserImpl *)iface; - TRACE("(%p)(pidl=%p,flags=0x%08x(%s))\n", This, pidl, wFlags, - (wFlags & SBSP_RELATIVE) ? "SBSP_RELATIVE" : - (wFlags & SBSP_PARENT) ? "SBSP_PARENT" : - (wFlags & SBSP_ABSOLUTE) ? "SBSP_ABSOLUTE" : "SBPS_????"); + TRACE("(%p)(pidl=%p,flags=0x%08x)\n", This, pidl, wFlags); + COMDLG32_DumpSBSPFlags(wFlags); fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); @@ -720,7 +761,7 @@ fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); - /* If the selected object is not a folder, send a IDOK command to parent window */ + /* If the selected object is not a folder, send an IDOK command to parent window */ if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1))) { HRESULT hRes; _____ Modified: trunk/reactos/lib/comdlg32/printdlg.c --- trunk/reactos/lib/comdlg32/printdlg.c 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/lib/comdlg32/printdlg.c 2005-04-26 19:18:13 UTC (rev 14821) @@ -86,14 +86,14 @@ */ BOOL PRINTDLG_OpenDefaultPrinter(HANDLE *hprn) { - char buf[260]; - DWORD dwBufLen = sizeof(buf); + WCHAR buf[260]; + DWORD dwBufLen = sizeof(buf) / sizeof(buf[0]); BOOL res; - if(!GetDefaultPrinterA(buf, &dwBufLen)) + if(!GetDefaultPrinterW(buf, &dwBufLen)) return FALSE; - res = OpenPrinterA(buf, hprn, NULL); + res = OpenPrinterW(buf, hprn, NULL); if (!res) - FIXME("Could not open printer %s?!\n",buf); + WARN("Could not open printer %s\n", debugstr_w(buf)); return res; } @@ -459,7 +459,7 @@ goto out; } - Names = (char*)HeapAlloc(GetProcessHeap(),0,NrOfEntries*64); + Names = HeapAlloc(GetProcessHeap(),0,NrOfEntries*64); if (NrOfEntries != (ret=DeviceCapabilitiesA(devname,portname,DC_PAPERNAMES,Names,dm))) { FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret); goto out; @@ -517,7 +517,7 @@ goto out; } - Names = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64); + Names = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64); if (NrOfEntries != (ret=DeviceCapabilitiesW(devname,portname,DC_PAPERNAMES,Names,dm))) { FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret); goto out; @@ -3026,6 +3026,7 @@ FIXME("stub\n"); return E_NOTIMPL; } + /*********************************************************************** * PrintDlgExW (COMDLG32.@) */ _____ Modified: trunk/reactos/lib/comdlg32/printdlg16.c --- trunk/reactos/lib/comdlg32/printdlg16.c 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/lib/comdlg32/printdlg16.c 2005-04-26 19:18:13 UTC (rev 14821) @@ -427,7 +427,7 @@ ptr16 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PRINT_PTRA16)); ptr16->lpPrintDlg16 = lppd; PrintStructures = &ptr16->print32; - PrintStructures->lpPrintDlg = (LPPRINTDLGA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLG A)); + PrintStructures->lpPrintDlg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA)); #define CVAL(x) PrintStructures->lpPrintDlg->x = lppd->x; #define MVAL(x) PrintStructures->lpPrintDlg->x = MapSL(lppd->x); CVAL(Flags); _____ Modified: trunk/reactos/w32api/include/shlobj.h --- trunk/reactos/w32api/include/shlobj.h 2005-04-26 19:06:19 UTC (rev 14820) +++ trunk/reactos/w32api/include/shlobj.h 2005-04-26 19:18:13 UTC (rev 14821) @@ -315,8 +315,15 @@ #define SBSP_OPENMODE 16 #define SBSP_EXPLOREMODE 32 #define SBSP_ABSOLUTE 0 +#define SBSP_HELPMODE 0x40 +#define SBSP_NOTRANSFERHIST 0x80 #define SBSP_RELATIVE 0x1000 #define SBSP_PARENT 0x2000 +#define SBSP_NAVIGATEBACK 0x4000 +#define SBSP_NAVIGATEFORWARD 0x8000 +#define SBSP_ALLOW_AUTONAVIGATE 0x10000 +#define SBSP_NOAUTOSELECT 0x4000000 +#define SBSP_WRITENOHISTORY 0x8000000 #define SBSP_INITIATEDBYHLINKFRAME 0x80000000 #define SBSP_REDIRECT 0x40000000 #define FCW_STATUS 1
19 years, 8 months
1
0
0
0
[hbirr] 14820: - Preinitialise the com port infos with default values.
by hbirr@svn.reactos.com
- Preinitialise the com port infos with default values. - Set the baud rate also in SerialPortInfo. Modified: trunk/reactos/ntoskrnl/kd/kdinit.c Modified: trunk/reactos/ntoskrnl/kd/kdio.c _____ Modified: trunk/reactos/ntoskrnl/kd/kdinit.c --- trunk/reactos/ntoskrnl/kd/kdinit.c 2005-04-26 18:18:36 UTC (rev 14819) +++ trunk/reactos/ntoskrnl/kd/kdinit.c 2005-04-26 19:06:19 UTC (rev 14820) @@ -13,7 +13,7 @@ /* VARIABLES ***************************************************************/ -KD_PORT_INFORMATION PortInfo; +KD_PORT_INFORMATION PortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0}; ULONG KdpPortIrq; KDP_DEBUG_MODE KdpDebugMode; LIST_ENTRY KdProviders; @@ -54,11 +54,6 @@ /* Enable Debugging */ KdDebuggerEnabled = TRUE; WrapperInitRoutine = KdpGdbStubInit; - - /* Reset port information to defaults */ - RtlMoveMemory(&GdbPortInfo, &PortInfo, sizeof(KD_PORT_INFORMATION)); - PortInfo.ComPort = DEFAULT_DEBUG_PORT; - PortInfo.BaudRate = DEFAULT_DEBUG_BAUD_RATE; } /* Check for PICE Debugging */ @@ -108,7 +103,7 @@ KdpDebugMode.Serial = TRUE; /* Set the port to use */ - SerialPortInfo.ComPort = Value; + SerialPortInfo.ComPort = Value; KdpPort = Value; } } @@ -210,7 +205,7 @@ Value = (ULONG)atol(p2); /* Check if it's valid and Set it */ - if (0 < Value) PortInfo.BaudRate = Value; + if (0 < Value) PortInfo.BaudRate = SerialPortInfo.BaudRate = Value; } /* Check Serial Port Settings [IRQ] */ else if (!_strnicmp(p2, "IRQ=", 4)) _____ Modified: trunk/reactos/ntoskrnl/kd/kdio.c --- trunk/reactos/ntoskrnl/kd/kdio.c 2005-04-26 18:18:36 UTC (rev 14819) +++ trunk/reactos/ntoskrnl/kd/kdio.c 2005-04-26 19:06:19 UTC (rev 14820) @@ -22,7 +22,7 @@ ULONG CurrentPosition; WORK_QUEUE_ITEM KdpDebugLogQueue; BOOLEAN ItemQueued; -KD_PORT_INFORMATION SerialPortInfo; +KD_PORT_INFORMATION SerialPortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0}; /* Current Port in use. FIXME: Do we support more then one? */ ULONG KdpPort;
19 years, 8 months
1
0
0
0
[gvg] 14819: Re-apply 14698 - 14762 and fix resulting problem
by gvg@svn.reactos.com
Re-apply 14698 - 14762 and fix resulting problem Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/archmach.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.h Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c Modified: trunk/reactos/boot/freeldr/freeldr/disk/partition.c Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.c Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c Deleted: trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h Modified: trunk/reactos/boot/freeldr/freeldr/include/fs.h Added: trunk/reactos/boot/freeldr/freeldr/include/fsrec.h Modified: trunk/reactos/boot/freeldr/freeldr/include/machine.h Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini.h Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c Modified: trunk/reactos/boot/freeldr/freeldr/linuxboot.c Modified: trunk/reactos/boot/freeldr/freeldr/machine.c Modified: trunk/reactos/boot/freeldr/freeldr/miscboot.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/arcname.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S --- trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-26 18:18:36 UTC (rev 14819) @@ -47,10 +47,10 @@ .code32 /* Store the boot drive */ - movb %dl,(_BootDrive) + movb %dl,(_i386BootDrive) /* Store the boot partition */ - movb %dh,(_BootPartition) + movb %dh,(_i386BootPartition) /* GO! */ xorl %eax,%eax @@ -275,9 +275,11 @@ * other boot loaders like Grub */ +#define MB_INFO_SIZE 90 #define MB_INFO_FLAGS_OFFSET 0 #define MB_INFO_BOOT_DEVICE_OFFSET 12 #define MB_INFO_COMMAND_LINE_OFFSET 16 +#define CMDLINE_SIZE 256 /* * We want to execute at 0x8000 (to be compatible with bootsector @@ -285,7 +287,6 @@ * above 1MB. So we let Grub load us there and then relocate * ourself to 0x8000 */ -#define CMDLINE_BASE 0x7000 #define FREELDR_BASE 0x8000 #define INITIAL_BASE 0x200000 @@ -328,6 +329,31 @@ movw %dx,%ds movw %dx,%es + /* Check for valid multiboot signature */ + cmpl $MULTIBOOT_BOOTLOADER_MAGIC,%eax + jne mbfail + + /* Store multiboot info in a safe place */ + movl %ebx,%esi + movl $(mb_info + INITIAL_BASE - FREELDR_BASE),%edi + movl $MB_INFO_SIZE,%ecx + rep movsb + + /* Save commandline */ + movl MB_INFO_FLAGS_OFFSET(%ebx),%edx + testl $MB_INFO_FLAG_COMMAND_LINE,MB_INFO_FLAGS_OFFSET(%ebx) + jz mb3 + movl MB_INFO_COMMAND_LINE_OFFSET(%ebx),%esi + movl $(cmdline + INITIAL_BASE - FREELDR_BASE),%edi + movl $CMDLINE_SIZE,%ecx +mb2: lodsb + stosb + testb %al,%al + jz mb3 + dec %ecx + jnz mb2 +mb3: + /* Copy to low mem */ movl $INITIAL_BASE,%esi movl $FREELDR_BASE,%edi @@ -342,8 +368,8 @@ /* Clear prefetch queue & correct CS, * jump to low mem */ - ljmp $PMODE_CS, $mb2 -mb2: + ljmp $PMODE_CS, $mb4 +mb4: /* Reload segment selectors */ movw $PMODE_DS,%dx movw %dx,%ds @@ -353,39 +379,28 @@ movw %dx,%ss movl $STACK32ADDR,%esp - /* Check for valid multiboot signature */ - cmpl $MULTIBOOT_BOOTLOADER_MAGIC,%eax - jne mbfail - + movl $mb_info,%ebx /* See if the boot device was passed in */ movl MB_INFO_FLAGS_OFFSET(%ebx),%edx testl $MB_INFO_FLAG_BOOT_DEVICE,%edx - jz mb3 + jz mb5 /* Retrieve boot device info */ movl MB_INFO_BOOT_DEVICE_OFFSET(%ebx),%eax shrl $16,%eax incb %al - movb %al,_BootPartition - movb %ah,_BootDrive - jmp mb4 -mb3: /* No boot device known, assume first partition of first harddisk */ - movb $0x80,_BootDrive - movb $1,_BootPartition -mb4: - - /* Check for a command line */ + movb %al,_i386BootPartition + movb %ah,_i386BootDrive + jmp mb6 +mb5: /* No boot device known, assume first partition of first harddisk */ + movb $0x80,_i386BootDrive + movb $1,_i386BootPartition +mb6: + /* Check for command line */ + mov $cmdline,%eax + testl $MB_INFO_FLAG_COMMAND_LINE,MB_INFO_FLAGS_OFFSET(%ebx) + jnz mb7 xorl %eax,%eax - testl $MB_INFO_FLAG_COMMAND_LINE,%edx - jz mb6 - /* Copy command line to low mem*/ - movl MB_INFO_COMMAND_LINE_OFFSET(%ebx),%esi - movl $CMDLINE_BASE,%edi -mb5: lodsb - stosb - testb %al,%al - jnz mb5 - movl $CMDLINE_BASE,%eax -mb6: +mb7: /* GO! */ pushl %eax @@ -462,8 +477,14 @@ .word 0x3ff /* Limit */ .long 0 /* Base Address */ -EXTERN(_BootDrive) +EXTERN(_i386BootDrive) .long 0 -EXTERN(_BootPartition) +EXTERN(_i386BootPartition) .long 0 + +mb_info: + .fill MB_INFO_SIZE, 1, 0 + +cmdline: + .fill CMDLINE_SIZE, 1, 0 _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/archmach.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/archmach.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/archmach.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -27,7 +27,7 @@ #include "rtl.h" VOID -MachInit(VOID) +MachInit(char *CmdLine) { ULONG PciId; @@ -39,11 +39,11 @@ PciId = READ_PORT_ULONG((ULONG*) 0xcfc); if (0x02a510de == PciId) { - XboxMachInit(); + XboxMachInit(CmdLine); } else { - PcMachInit(); + PcMachInit(CmdLine); } HalpCalibrateStallExecution(); _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S --- trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S 2005-04-26 18:18:36 UTC (rev 14819) @@ -31,7 +31,7 @@ .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_i386BootDrive),%dl /* Load segment registers */ cli _____ Copied: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h (from rev 14763, trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h) Property changes on: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -19,6 +19,8 @@ #include "freeldr.h" #include "debug.h" +#include "i386.h" +#include "fsrec.h" //////////////////////////////////////////////////////////////////////// ///////////////////// // FUNCTIONS @@ -166,4 +168,244 @@ return TRUE; } -#endif // defined __i386__ +BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) +{ + PARTITION_TABLE_ENTRY PartitionTableEntry; + UCHAR VolumeType; + + DbgPrint((DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", i386BootDrive, i386BootPartition)); + + // Check and see if it is a floppy drive + // If so then just assume FAT12 file system type + if (DiskIsDriveRemovable(i386BootDrive)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n")); + + *DriveNumber = i386BootDrive; + *StartSector = 0; + *SectorCount = 2 * 80 * 18; /* FIXME hardcoded for 1.44 Mb */ + *FsType = FS_FAT; + return TRUE; + } + + // Check for ISO9660 file system type + if (i386BootDrive >= 0x80 && FsRecIsIso9660(i386BootDrive)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); + + *DriveNumber = i386BootDrive; + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_ISO9660; + return TRUE; + } + + // Get the requested partition entry + if (i386BootPartition == 0) + { + // Partition requested was zero which means the boot partition + if (! DiskGetActivePartitionEntry(i386BootDrive, &PartitionTableEntry)) + { + return FALSE; + } + } + else + { + // Get requested partition + if (! MachDiskGetPartitionEntry(i386BootDrive, i386BootPartition, &PartitionTableEntry)) + { + return FALSE; + } + } + + // Check for valid partition + if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) + { + return FALSE; + } + + // Try to recognize the file system + if (!FsRecognizeVolume(i386BootDrive, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + { + return FALSE; + } + + *DriveNumber = i386BootDrive; + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + + //switch (PartitionTableEntry.SystemIndicator) + switch (VolumeType) + { + case PARTITION_FAT_12: + case PARTITION_FAT_16: + case PARTITION_HUGE: + case PARTITION_XINT13: + case PARTITION_FAT32: + case PARTITION_FAT32_XINT13: + *FsType = FS_FAT; + return TRUE; + case PARTITION_EXT2: + *FsType = FS_EXT2; + return TRUE; + case PARTITION_NTFS: + *FsType = FS_NTFS; + return TRUE; + default: + *FsType = 0; + return FALSE; + } + + return TRUE; +} + +VOID +i386DiskGetBootDevice(PULONG BootDevice) +{ + ((char *)BootDevice)[0] = (char)i386BootDrive; + ((char *)BootDevice)[1] = (char)i386BootPartition; +} + +BOOL +i386DiskBootingFromFloppy(VOID) +{ + return i386BootDrive < 0x80; +} + +#define IsRecognizedPartition(P) \ + ((P) == PARTITION_FAT_12 || \ + (P) == PARTITION_FAT_16 || \ + (P) == PARTITION_HUGE || \ + (P) == PARTITION_IFS || \ + (P) == PARTITION_EXT2 || \ + (P) == PARTITION_FAT32 || \ + (P) == PARTITION_FAT32_XINT13 || \ + (P) == PARTITION_XINT13) + +BOOL i386DiskGetSystemVolume(char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType) +{ + ULONG PartitionNumber; + PARTITION_TABLE_ENTRY PartitionTableEntry; + UCHAR VolumeType; + CHAR BootPath[256]; + unsigned i, RosPartition; + + /* + * Verify system path + */ + if (!DissectArcPath(SystemPath, BootPath, DriveNumber, &PartitionNumber)) + { + return FALSE; + } + if (NULL != RemainingPath) + { + strcpy(RemainingPath, BootPath); + } + + /* 0xff -> no partition table present, use whole device */ + if (0xff == PartitionNumber) + { + PartitionTableEntry.SectorCountBeforePartition = 0; + i = 0xff; + } + else + { + /* recalculate the boot partition for freeldr */ + i = 0; + RosPartition = 0; + while (1) + { + if (!MachDiskGetPartitionEntry(*DriveNumber, ++i, &PartitionTableEntry)) + { + return FALSE; + } + if (IsRecognizedPartition(PartitionTableEntry.SystemIndicator)) + { + if (++RosPartition == PartitionNumber) + { + break; + } + } + } + } + + /* Check for ISO9660 file system type */ + if (*DriveNumber >= 0x80 && FsRecIsIso9660(*DriveNumber)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); + + if (NULL != Device) + { + ((char *)Device)[0] = (char)(*DriveNumber); + ((char *)Device)[1] = (char)i; + } + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_ISO9660; + return TRUE; + } + + if (!FsRecognizeVolume(*DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + { + return FALSE; + } + + if (NULL != Device) + { + ((char *)Device)[0] = (char)(*DriveNumber); + ((char *)Device)[1] = (char)i; + } + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + + switch (VolumeType) + { + case PARTITION_FAT_12: + case PARTITION_FAT_16: + case PARTITION_HUGE: + case PARTITION_XINT13: + case PARTITION_FAT32: + case PARTITION_FAT32_XINT13: + *FsType = FS_FAT; + return TRUE; + case PARTITION_EXT2: + *FsType = FS_EXT2; + return TRUE; + case PARTITION_NTFS: + *FsType = FS_NTFS; + return TRUE; + default: + *FsType = 0; + return FALSE; + } + + return FALSE; +} + +BOOL +i386DiskGetBootPath(char *BootPath, unsigned Size) +{ + static char Path[] = "multi(0)disk(0)"; + char Device[4]; + + itoa(i386BootDrive, Device, 10); + if (Size <= sizeof(Path) + 6 + strlen(Device)) + { + return FALSE; + } + strcpy(BootPath, Path); + strcat(BootPath, MachDiskBootingFromFloppy() ? "fdisk" : "cdrom"); + strcat(strcat(strcat(BootPath, "("), Device), ")"); + + return TRUE; +} + +#endif /* defined __i386__ */ + +/* EOF */ _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S --- trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S 2005-04-26 18:18:36 UTC (rev 14819) @@ -30,7 +30,7 @@ .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_i386BootDrive),%dl /* Load segment registers */ cli @@ -66,7 +66,7 @@ .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_i386BootDrive),%dl /* Load segment registers */ cli _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -23,9 +23,10 @@ #include "machine.h" #include "machpc.h" #include "rtl.h" +#include "i386.h" VOID -PcMachInit(VOID) +PcMachInit(char *CmdLine) { EnableA20(); @@ -48,6 +49,11 @@ MachVtbl.VideoSync = PcVideoSync; MachVtbl.VideoPrepareForReactOS = PcVideoPrepareForReactOS; MachVtbl.GetMemoryMap = PcMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = PcDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry; _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.h --- trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -26,7 +26,7 @@ #include "mm.h" #endif -VOID PcMachInit(VOID); +VOID PcMachInit(char *CmdLine); VOID PcConsPutChar(int Ch); BOOL PcConsKbHit(); _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -21,9 +21,10 @@ #include "mm.h" #include "machine.h" #include "machxbox.h" +#include "i386.h" VOID -XboxMachInit(VOID) +XboxMachInit(char *CmdLine) { /* Initialize our stuff */ XboxMemInit(); @@ -46,6 +47,11 @@ MachVtbl.VideoSync = XboxVideoSync; MachVtbl.VideoPrepareForReactOS = XboxVideoPrepareForReactOS; MachVtbl.GetMemoryMap = XboxMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = XboxDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry; _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h --- trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -26,7 +26,7 @@ UCHAR XboxFont8x16[256 * 16]; -VOID XboxMachInit(VOID); +VOID XboxMachInit(char *CmdLine); VOID XboxConsPutChar(int Ch); BOOL XboxConsKbHit(); _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -279,7 +279,7 @@ BootMain("freeldr-ppc"); } -void MachInit() { +void MachInit(char *CmdLine) { int len; printf( "Determining boot device:\n" ); len = ofw_getprop(chosen_package, "bootpath", _____ Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c --- trunk/reactos/boot/freeldr/freeldr/bootmgr.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/bootmgr.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -49,6 +49,13 @@ LONG TimeOut; ULONG SelectedOperatingSystem; + if (!FsOpenBootVolume()) + { + printf("Error opening boot partition for file access.\n"); + MachConsGetCh(); + return; + } + if (!IniFileInitialize()) { printf("Press any key to reboot.\n"); _____ Modified: trunk/reactos/boot/freeldr/freeldr/disk/partition.c --- trunk/reactos/boot/freeldr/freeldr/disk/partition.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/disk/partition.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -28,7 +28,8 @@ BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry) { - ULONG BootablePartitionCount = 0; + ULONG BootablePartitionCount = 0; + ULONG ActivePartition = 0; MASTER_BOOT_RECORD MasterBootRecord; // Read master boot record @@ -41,22 +42,22 @@ if (MasterBootRecord.PartitionTable[0].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 0; + ActivePartition = 0; } if (MasterBootRecord.PartitionTable[1].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 1; + ActivePartition = 1; } if (MasterBootRecord.PartitionTable[2].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 2; + ActivePartition = 2; } if (MasterBootRecord.PartitionTable[3].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 3; + ActivePartition = 3; } // Make sure there was only one bootable partition @@ -72,7 +73,7 @@ } // Copy the partition table entry - RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[BootPartition], sizeof(PARTITION_TABLE_ENTRY)); + RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[ActivePartition], sizeof(PARTITION_TABLE_ENTRY)); return TRUE; } _____ Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.c --- trunk/reactos/boot/freeldr/freeldr/freeldr.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/freeldr.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -31,7 +31,7 @@ { CmdLineParse(CmdLine); - MachInit(); + MachInit(CmdLine); DebugInit(); _____ Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c --- trunk/reactos/boot/freeldr/freeldr/fs/fs.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -51,110 +51,78 @@ /* * - * BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber); + * BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type); * * This function is called to open a disk volume for file access. * It must be called before any of the file functions will work. - * It takes two parameters: * - * Drive: The BIOS drive number of the disk to open - * Partition: This is zero for floppy drives. - * If the disk is a hard disk then this specifies - * The partition number to open (1 - 4) - * If it is zero then it opens the active (bootable) partition - * */ -BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber) +static BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type) { - PARTITION_TABLE_ENTRY PartitionTableEntry; - UCHAR ErrorText[80]; - UCHAR VolumeType; + UCHAR ErrorText[80]; - DbgPrint((DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", DriveNumber, PartitionNumber)); + FsType = Type; - // Check and see if it is a floppy drive - // If so then just assume FAT12 file system type - if (DiskIsDriveRemovable(DriveNumber)) + switch (FsType) { - DbgPrint((DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n")); - - FsType = FS_FAT; - return FatOpenVolume(DriveNumber, 0, 0); - } - - // Check for ISO9660 file system type - if (DriveNumber >= 0x80 && FsRecIsIso9660(DriveNumber)) - { - DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); - - FsType = FS_ISO9660; + case FS_FAT: + return FatOpenVolume(DriveNumber, StartSector, SectorCount); + case FS_EXT2: + return Ext2OpenVolume(DriveNumber, StartSector); + case FS_NTFS: + return NtfsOpenVolume(DriveNumber, StartSector); + case FS_ISO9660: return IsoOpenVolume(DriveNumber); + default: + FsType = 0; + sprintf(ErrorText, "Unsupported file system. Type: 0x%x", Type); + FileSystemError(ErrorText); } - // Set the boot partition - BootPartition = PartitionNumber; + return FALSE; +} +/* + * + * BOOL FsOpenBootVolume() + * + * This function is called to open the boot disk volume for file access. + * It must be called before any of the file functions will work. + */ +BOOL FsOpenBootVolume() +{ + ULONG DriveNumber; + ULONGLONG StartSector; + ULONGLONG SectorCount; + int Type; - // Get the requested partition entry - if (PartitionNumber == 0) + if (! MachDiskGetBootVolume(&DriveNumber, &StartSector, &SectorCount, &Type)) { - // Partition requested was zero which means the boot partition - if (DiskGetActivePartitionEntry(DriveNumber, &PartitionTableEntry) == FALSE) - { - FileSystemError("No active partition."); - return FALSE; - } - } - else - { - // Get requested partition - if (MachDiskGetPartitionEntry(DriveNumber, PartitionNumber, &PartitionTableEntry) == FALSE) - { - FileSystemError("Partition not found."); - return FALSE; - } - } - - // Check for valid partition - if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) - { - FileSystemError("Invalid partition."); + FileSystemError("Unable to locate boot partition\n"); return FALSE; } - // Try to recognize the file system - if (!FsRecognizeVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) - { - FileSystemError("Unrecognized file system."); - return FALSE; - } + return FsOpenVolume(DriveNumber, StartSector, SectorCount, Type); +} - //switch (PartitionTableEntry.SystemIndicator) - switch (VolumeType) +BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG Device) +{ + ULONG DriveNumber; + ULONGLONG StartSector; + ULONGLONG SectorCount; + int Type; + + if (! MachDiskGetSystemVolume(SystemPath, RemainingPath, Device, + &DriveNumber, &StartSector, &SectorCount, + &Type)) { - case PARTITION_FAT_12: - case PARTITION_FAT_16: - case PARTITION_HUGE: - case PARTITION_XINT13: - case PARTITION_FAT32: - case PARTITION_FAT32_XINT13: - FsType = FS_FAT; - return FatOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, PartitionTableEntry.PartitionSectorCount); - case PARTITION_EXT2: - FsType = FS_EXT2; - return Ext2OpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition); - case PARTITION_NTFS: - FsType = FS_NTFS; - return NtfsOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition); - default: - FsType = 0; - sprintf(ErrorText, "Unsupported file system. Type: 0x%x", VolumeType); - FileSystemError(ErrorText); + FileSystemError("Unable to locate system partition\n"); return FALSE; } - return TRUE; + return FsOpenVolume(DriveNumber, StartSector, SectorCount, Type); } + PFILE FsOpenFile(PUCHAR FileName) { PFILE FileHandle = NULL; _____ Deleted: trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h --- trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -1,29 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer <brianp(a)sginet.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __FSREC_H -#define __FSREC_H - -BOOL FsRecognizeVolume(ULONG DriveNumber, ULONG VolumeStartSector, UCHAR* VolumeType); -BOOL FsRecIsIso9660(ULONG DriveNumber); -BOOL FsRecIsExt2(ULONG DriveNumber, ULONG VolumeStartSector); -BOOL FsRecIsFat(ULONG DriveNumber, ULONG VolumeStartSector); -BOOL FsRecIsNtfs(ULONG DriveNumber, ULONG VolumeStartSector); - -#endif // #defined __FSREC_H _____ Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -38,8 +38,6 @@ #define ROUND_DOWN(N, S) ((N) & ~((S) - 1)) #define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n") -extern ULONG BootDrive; /* BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc. */ -extern ULONG BootPartition; /* Boot Partition, 1-4 */ extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */ VOID BootMain(LPSTR CmdLine); _____ Modified: trunk/reactos/boot/freeldr/freeldr/include/fs.h --- trunk/reactos/boot/freeldr/freeldr/include/fs.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/include/fs.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -33,7 +33,8 @@ #define PFILE FILE * VOID FileSystemError(PUCHAR ErrorString); -BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber); +BOOL FsOpenBootVolume(); +BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG BootDevice); PFILE FsOpenFile(PUCHAR FileName); VOID FsCloseFile(PFILE FileHandle); BOOL FsReadFile(PFILE FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer); _____ Copied: trunk/reactos/boot/freeldr/freeldr/include/fsrec.h (from rev 14763, trunk/reactos/boot/freeldr/freeldr/include/fsrec.h) Property changes on: trunk/reactos/boot/freeldr/freeldr/include/fsrec.h ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Modified: trunk/reactos/boot/freeldr/freeldr/include/machine.h --- trunk/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -56,6 +56,11 @@ ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); + BOOL (*DiskGetBootVolume)(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); + BOOL (*DiskGetSystemVolume)(char *SystemPath, char *RemainingPath, PULONG Device, PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); + BOOL (*DiskGetBootPath)(char *BootPath, unsigned Size); + VOID (*DiskGetBootDevice)(PULONG BootDevice); + BOOL (*DiskBootingFromFloppy)(VOID); BOOL (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOL (*DiskGetPartitionEntry)(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); BOOL (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry); @@ -66,7 +71,7 @@ VOID (*HwDetect)(VOID); } MACHVTBL, *PMACHVTBL; -VOID MachInit(VOID); +VOID MachInit(char *CmdLine); extern MACHVTBL MachVtbl; @@ -87,6 +92,11 @@ #define MachVideoSync() MachVtbl.VideoSync() #define MachVideoPrepareForReactOS() MachVtbl.VideoPrepareForReactOS() #define MachGetMemoryMap(MMap, Size) MachVtbl.GetMemoryMap((MMap), (Size)) +#define MachDiskGetBootVolume(Drv, Start, Cnt, FsType) MachVtbl.DiskGetBootVolume((Drv), (Start), (Cnt), (FsType)) +#define MachDiskGetSystemVolume(SysPath, RemPath, Dev, Drv, Start, Cnt, FsType) MachVtbl.DiskGetSystemVolume((SysPath), (RemPath), (Dev), (Drv), (Start), (Cnt), (FsType)) +#define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size)) +#define MachDiskGetBootDevice(BootDevice) MachVtbl.DiskGetBootDevice(BootDevice) +#define MachDiskBootingFromFloppy() MachVtbl.DiskBootingFromFloppy() #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf)) #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry)) #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom)) _____ Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini.h --- trunk/reactos/boot/freeldr/freeldr/inifile/ini.h 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/inifile/ini.h 2005-04-26 18:18:36 UTC (rev 14819) @@ -57,7 +57,7 @@ extern ULONG IniFileSectionCount; extern ULONG IniFileSettingCount; -PFILE IniOpenIniFile(UCHAR BootDriveNumber, UCHAR BootPartitionNumber); +PFILE IniOpenIniFile(); BOOL IniParseFile(PUCHAR IniFileData, ULONG IniFileSize); ULONG IniGetNextLineSize(PUCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset); _____ Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c --- trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -33,23 +33,8 @@ BOOL Success; // Open freeldr.ini - // BootDrive & BootPartition are passed - // in from the boot sector code in the - // DL & DH registers. - Freeldr_Ini = IniOpenIniFile(BootDrive, BootPartition); + Freeldr_Ini = IniOpenIniFile(); - // If we couldn't open freeldr.ini on the partition - // they specified in the boot sector then try - // opening the active (boot) partition. - if ((Freeldr_Ini == NULL) && (BootPartition != 0)) - { - BootPartition = 0; - - Freeldr_Ini = IniOpenIniFile(BootDrive, BootPartition); - - return FALSE; - } - if (Freeldr_Ini == NULL) { printf("Error opening freeldr.ini or file not found.\n"); @@ -87,24 +72,10 @@ return Success; } -PFILE IniOpenIniFile(UCHAR BootDriveNumber, UCHAR BootPartitionNumber) +PFILE IniOpenIniFile() { PFILE IniFileHandle; // File handle for freeldr.ini - if (!FsOpenVolume(BootDriveNumber, BootPartitionNumber)) - { - if (BootPartitionNumber == 0) - { - printf("Error opening active (bootable) partition on boot drive 0x%x for file access.\n", BootDriveNumber); - } - else - { - printf("Error opening partition %d on boot drive 0x%x for file access.\n", BootPartitionNumber, BootDriveNumber); - } - - return NULL; - } - // Try to open freeldr.ini IniFileHandle = FsOpenFile("freeldr.ini"); _____ Modified: trunk/reactos/boot/freeldr/freeldr/linuxboot.c --- trunk/reactos/boot/freeldr/freeldr/linuxboot.c 2005-04-26 17:19:06 UTC (rev 14818) +++ trunk/reactos/boot/freeldr/freeldr/linuxboot.c 2005-04-26 18:18:36 UTC (rev 14819) @@ -40,18 +40,19 @@ PLINUX_BOOTSECTOR LinuxBootSector = NULL; PLINUX_SETUPSECTOR LinuxSetupSector = NULL; -ULONG SetupSectorSize = 0; [truncated at 1000 lines; 505 more skipped]
19 years, 8 months
1
0
0
0
[greatlrd] 14818: Implement NtGdiDdCanCreateSurface
by greatlrd@svn.reactos.com
Implement NtGdiDdCanCreateSurface not tested Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c _____ Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c --- trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-04-26 16:28:38 UTC (rev 14817) +++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-04-26 17:19:06 UTC (rev 14818) @@ -319,5 +319,23 @@ } +DWORD STDCALL NtGdiDdCanCreateSurface( + HANDLE hDirectDrawLocal, + PDD_CANCREATESURFACEDATA puCanCreateSurfaceData +) +{ + DWORD ddRVal; + PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + + ddRVal = pDirectDraw->DdCanCreateSurface(puCanCreateSurfaceData); + + GDIOBJ_UnlockObj(hDirectDrawLocal); + + return ddRVal; +} + + + + /* EOF */ _____ Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c --- trunk/reactos/subsys/win32k/ntddraw/stubs.c 2005-04-26 16:28:38 UTC (rev 14817) +++ trunk/reactos/subsys/win32k/ntddraw/stubs.c 2005-04-26 17:19:06 UTC (rev 14818) @@ -139,15 +139,7 @@ return 0; } -DWORD STDCALL NtGdiDdCanCreateSurface( - HANDLE hDirectDraw, - PDD_CANCREATESURFACEDATA puCanCreateSurfaceData -) -{ - UNIMPLEMENTED - return 0; -} DWORD STDCALL NtGdiDdColorControl( HANDLE hSurface,
19 years, 8 months
1
0
0
0
[hbirr] 14817: - Used SysProcessorTimeInfo to calculate the idle time.
by hbirr@svn.reactos.com
- Used SysProcessorTimeInfo to calculate the idle time. - Fixed the allocation of SysProcessorTimeInfo. - Used the process creation time as second unique id. Modified: trunk/rosapps/sysutils/ctm/ctm.c Modified: trunk/rosapps/sysutils/ctm/ctm.h _____ Modified: trunk/rosapps/sysutils/ctm/ctm.c --- trunk/rosapps/sysutils/ctm/ctm.c 2005-04-26 14:51:18 UTC (rev 14816) +++ trunk/rosapps/sysutils/ctm/ctm.c 2005-04-26 16:28:38 UTC (rev 14817) @@ -78,7 +78,7 @@ double dbKernelTime; double dbSystemTime; LARGE_INTEGER liOldIdleTime = {{0,0}}; -double OldKernelTime = 0; +LARGE_INTEGER liOldKernelTime = {{0,0}}; LARGE_INTEGER liOldSystemTime = {{0,0}}; PPERFDATA pPerfDataOld = NULL; // Older perf data (saved to establish delta values) @@ -357,43 +357,47 @@ PPERFDATA pPDOld; TCHAR szTemp[MAX_PATH]; DWORD dwSize; - double CurrentKernelTime; +#ifdef TIMES + LARGE_INTEGER liCurrentKernelTime; + LARGE_INTEGER liCurrentIdleTime; + LARGE_INTEGER liCurrentTime; +#endif PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcessorTimeInfo; - SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo; - SYSTEM_TIMEOFDAY_INFORMATION SysTimeInfo; + SYSTEM_TIMEOFDAY_INFORMATION SysTimeInfo; #ifdef TIMES // Get new system time status = NtQuerySystemInformation(SystemTimeInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0); if (status != NO_ERROR) return; - - // Get new CPU's idle time - status = NtQuerySystemInformation(SystemPerformanceInformation, &SysPerfInfo, sizeof(SysPerfInfo), NULL); - if (status != NO_ERROR) - return; #endif // Get processor information - SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)malloc(sizeof(PSYSTEM_PROCESS OR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors); - status = NtQuerySystemInformation(SystemProcessorTimes, SysProcessorTimeInfo, sizeof(PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors, &ulSize); + SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)malloc(sizeof(SYSTEM_PROCESSO R_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors); + status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors, &ulSize); // Get process information PsaCaptureProcessesAndThreads((PSYSTEM_PROCESS_INFORMATION *)&pBuffer); #ifdef TIMES - for (CurrentKernelTime=0, Idx=0; Idx<SystemBasicInfo.NumberProcessors; Idx++) { - CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].KernelTime); - CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].DpcTime); - CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].InterruptTime); + liCurrentKernelTime.QuadPart = 0; + liCurrentIdleTime.QuadPart = 0; + for (Idx=0; Idx<SystemBasicInfo.NumberProcessors; Idx++) { + liCurrentKernelTime.QuadPart += SysProcessorTimeInfo[Idx].KernelTime.QuadPart; + liCurrentKernelTime.QuadPart += SysProcessorTimeInfo[Idx].DpcTime.QuadPart; + liCurrentKernelTime.QuadPart += SysProcessorTimeInfo[Idx].InterruptTime.QuadPart; + liCurrentIdleTime.QuadPart += SysProcessorTimeInfo[Idx].IdleTime.QuadPart; } // If it's a first call - skip idle time calcs if (liOldIdleTime.QuadPart != 0) { // CurrentValue = NewValue - OldValue - dbIdleTime = Li2Double(SysPerfInfo.IdleTime) - Li2Double(liOldIdleTime); - dbKernelTime = CurrentKernelTime - OldKernelTime; - dbSystemTime = Li2Double(SysTimeInfo.CurrentTime) - Li2Double(liOldSystemTime); + liCurrentTime.QuadPart = liCurrentIdleTime.QuadPart - liOldIdleTime.QuadPart; + dbIdleTime = Li2Double(liCurrentTime); + liCurrentTime.QuadPart = liCurrentKernelTime.QuadPart - liOldKernelTime.QuadPart; + dbKernelTime = Li2Double(liCurrentTime); + liCurrentTime.QuadPart = SysTimeInfo.CurrentTime.QuadPart - liOldSystemTime.QuadPart; + dbSystemTime = Li2Double(liCurrentTime); // CurrentCpuIdle = IdleTime / SystemTime dbIdleTime = dbIdleTime / dbSystemTime; @@ -405,9 +409,9 @@ } // Store new CPU's idle and system time - liOldIdleTime = SysPerfInfo.IdleTime; + liOldIdleTime = liCurrentIdleTime; liOldSystemTime = SysTimeInfo.CurrentTime; - OldKernelTime = CurrentKernelTime; + liOldKernelTime = liCurrentKernelTime; #endif // Determine the process count @@ -434,7 +438,9 @@ // so that we can establish delta values pPDOld = NULL; for (Idx2=0; Idx2<ProcessCountOld; Idx2++) { - if (pPerfDataOld[Idx2].ProcessId == pSPI->UniqueProcessId) { + if (pPerfDataOld[Idx2].ProcessId == (ULONG)(pSPI->UniqueProcessId) && + /* check also for the creation time, a new process may have an id of an old one */ + pPerfDataOld[Idx2].CreateTime.QuadPart == pSPI->CreateTime.QuadPart) { pPDOld = &pPerfDataOld[Idx2]; break; } @@ -456,7 +462,8 @@ #endif } - pPerfData[Idx].ProcessId = pSPI->UniqueProcessId; + pPerfData[Idx].ProcessId = (ULONG)(pSPI->UniqueProcessId); + pPerfData[Idx].CreateTime = pSPI->CreateTime; if (pPDOld) { #ifdef TIMES _____ Modified: trunk/rosapps/sysutils/ctm/ctm.h --- trunk/rosapps/sysutils/ctm/ctm.h 2005-04-26 14:51:18 UTC (rev 14816) +++ trunk/rosapps/sysutils/ctm/ctm.h 2005-04-26 16:28:38 UTC (rev 14817) @@ -51,6 +51,7 @@ TIME UserTime; TIME KernelTime; + LARGE_INTEGER CreateTime; } PERFDATA, *PPERFDATA; #define SystemTimeInformation 3
19 years, 8 months
1
0
0
0
[ion] 14816: Implement IoRaiseHardError, combine error stuff, fix hideously wrong implementatin of Controller Objects.
by ion@svn.reactos.com
Implement IoRaiseHardError, combine error stuff, fix hideously wrong implementatin of Controller Objects. Modified: trunk/reactos/include/ddk/iotypes.h Modified: trunk/reactos/include/ddk/ketypes.h Modified: trunk/reactos/ntoskrnl/Makefile Deleted: trunk/reactos/ntoskrnl/io/cntrller.c Added: trunk/reactos/ntoskrnl/io/controller.c Deleted: trunk/reactos/ntoskrnl/io/errlog.c Modified: trunk/reactos/ntoskrnl/io/error.c _____ Modified: trunk/reactos/include/ddk/iotypes.h --- trunk/reactos/include/ddk/iotypes.h 2005-04-26 13:17:44 UTC (rev 14815) +++ trunk/reactos/include/ddk/iotypes.h 2005-04-26 14:51:18 UTC (rev 14816) @@ -684,7 +684,35 @@ PIO_COMPLETION_CONTEXT CompletionContext; } FILE_OBJECT, *PFILE_OBJECT; +typedef IO_ALLOCATION_ACTION STDCALL_FUNC +(*PDRIVER_CONTROL)(struct _DEVICE_OBJECT *DeviceObject, + struct _IRP *Irp, + PVOID MapRegisterBase, + PVOID Context); +#if (_WIN32_WINNT >= 0x0400) +typedef VOID STDCALL_FUNC +(*PFSDNOTIFICATIONPROC)(IN struct _DEVICE_OBJECT *PtrTargetFileSystemDeviceObject, + IN BOOLEAN DriverActive); +#endif // (_WIN32_WINNT >= 0x0400) +typedef struct _KDEVICE_QUEUE_ENTRY +{ + LIST_ENTRY DeviceListEntry; + ULONG SortKey; + BOOLEAN Inserted; +} KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY; + +typedef struct _WAIT_CONTEXT_BLOCK +{ + KDEVICE_QUEUE_ENTRY WaitQueueEntry; + PDRIVER_CONTROL DeviceRoutine; + PVOID DeviceContext; + ULONG NumberOfMapRegisters; + PVOID DeviceObject; + PVOID CurrentIrp; + PKDPC BufferChainingDpc; +} WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK; + typedef struct _IRP { CSHORT Type; @@ -757,7 +785,6 @@ WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH]; } VPB, *PVPB; - typedef struct _DEVICE_OBJECT { CSHORT Type; @@ -1133,18 +1160,6 @@ } DRIVER_LAYOUT_INFORMATION, *PDRIVER_LAYOUT_INFORMATION; -typedef IO_ALLOCATION_ACTION STDCALL_FUNC -(*PDRIVER_CONTROL)(PDEVICE_OBJECT DeviceObject, - PIRP Irp, - PVOID MapRegisterBase, - PVOID Context); -#if (_WIN32_WINNT >= 0x0400) -typedef VOID STDCALL_FUNC -(*PFSDNOTIFICATIONPROC)(IN PDEVICE_OBJECT PtrTargetFileSystemDeviceObject, - IN BOOLEAN DriverActive); -#endif // (_WIN32_WINNT >= 0x0400) - - typedef struct _NAMED_PIPE_CREATE_PARAMETERS { ULONG NamedPipeType; _____ Modified: trunk/reactos/include/ddk/ketypes.h --- trunk/reactos/include/ddk/ketypes.h 2005-04-26 13:17:44 UTC (rev 14815) +++ trunk/reactos/include/ddk/ketypes.h 2005-04-26 14:51:18 UTC (rev 14816) @@ -285,37 +285,6 @@ ULONG DpcCount; } KDPC_DATA, *PKDPC_DATA; -typedef struct _KDEVICE_QUEUE_ENTRY -{ - LIST_ENTRY DeviceListEntry; - ULONG SortKey; - BOOLEAN Inserted; -} KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY; - -typedef struct _WAIT_CONTEXT_BLOCK -{ - KDEVICE_QUEUE_ENTRY WaitQueueEntry; - /* - * XXX THIS IS WRONG XXX - * - * Our headers have enough circular dependancies that - * I can't figure out, given 5 minutes of testing, what - * order to include them in to get PDRIVER_CONTROL to be - * defined here. The proper definition of the next item - * is: - * - * PDRIVER_CONTROL DeviceRoutine; - * - * but instead we use PVOID until headers are fixed. - */ - PVOID DeviceRoutine; - PVOID DeviceContext; - ULONG NumberOfMapRegisters; - PVOID DeviceObject; - PVOID CurrentIrp; - PKDPC BufferChainingDpc; -} WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK; - typedef enum _KBUGCHECK_CALLBACK_REASON { KbCallbackInvalid, KbCallbackReserved1, _____ Modified: trunk/reactos/ntoskrnl/Makefile --- trunk/reactos/ntoskrnl/Makefile 2005-04-26 13:17:44 UTC (rev 14815) +++ trunk/reactos/ntoskrnl/Makefile 2005-04-26 14:51:18 UTC (rev 14816) @@ -149,14 +149,13 @@ io/buildirp.o \ io/cancel.o \ io/cleanup.o \ - io/cntrller.o \ + io/controller.o \ io/create.o \ io/device.o \ io/deviface.o \ io/dir.o \ io/driver.o \ io/efi.o \ - io/errlog.o \ io/error.o \ io/event.o \ io/file.o \ _____ Deleted: trunk/reactos/ntoskrnl/io/cntrller.c --- trunk/reactos/ntoskrnl/io/cntrller.c 2005-04-26 13:17:44 UTC (rev 14815) +++ trunk/reactos/ntoskrnl/io/cntrller.c 2005-04-26 14:51:18 UTC (rev 14816) @@ -1,175 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/cntrller.c - * PURPOSE: Implements the controller object - * - * PROGRAMMERS: David Welch (welch(a)mcmail.com) - */ - -/* INCLUDES *****************************************************************/ - -#include <ntoskrnl.h> -#include <internal/debug.h> - -/* GLOBALS *******************************************************************/ - -#define TAG_CQE TAG('C', 'Q', 'E', ' ') -#define TAG_CONTROLLER TAG('C', 'N', 'T', 'R') -#define TAG_CONTROLLER_EXTENSION TAG('C', 'E', 'X', 'T') - -/* TYPES ********************************************************************/ - -typedef struct -/* - * PURPOSE: A entry in the queue waiting for a controller object - */ -{ - KDEVICE_QUEUE_ENTRY Entry; - PDEVICE_OBJECT DeviceObject; - PDRIVER_CONTROL ExecutionRoutine; - PVOID Context; -} CONTROLLER_QUEUE_ENTRY, *PCONTROLLER_QUEUE_ENTRY; - -/* FUNCTIONS *****************************************************************/ - -/* - * @implemented - */ -VOID -STDCALL -IoAllocateController(PCONTROLLER_OBJECT ControllerObject, - PDEVICE_OBJECT DeviceObject, - PDRIVER_CONTROL ExecutionRoutine, - PVOID Context) -/* - * FUNCTION: Sets up a call to a driver-supplied ControllerControl routine - * as soon as the device controller, represented by the given controller - * object, is available to carry out an I/O operation for the target device, - * represented by the given device object. - * ARGUMENTS: - * ControllerObject = Driver created controller object - * DeviceObject = Target device for the current irp - * ExecutionRoutine = Routine to be called when the device is available - * Context = Driver supplied context to be passed on to the above routine - * NOTE: Is the below implementation correct. - */ -{ - PCONTROLLER_QUEUE_ENTRY entry; - IO_ALLOCATION_ACTION Result; - - ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); - - entry = - ExAllocatePoolWithTag(NonPagedPool, sizeof(CONTROLLER_QUEUE_ENTRY), - TAG_CQE); - ASSERT(entry!=NULL); - - entry->DeviceObject = DeviceObject; - entry->ExecutionRoutine = ExecutionRoutine; - entry->Context = Context; - - if (KeInsertDeviceQueue(&ControllerObject->DeviceWaitQueue,&entry->Entry)) - { - return; - } - Result = ExecutionRoutine(DeviceObject,DeviceObject->CurrentIrp, - NULL,Context); - if (Result == DeallocateObject) - { - IoFreeController(ControllerObject); - } - ExFreePool(entry); -} - -/* - * @implemented - */ -PCONTROLLER_OBJECT -STDCALL -IoCreateController(ULONG Size) -/* - * FUNCTION: Allocates memory and initializes a controller object - * ARGUMENTS: - * Size = Size (in bytes) to be allocated for the controller extension - * RETURNS: A pointer to the created object - */ -{ - PCONTROLLER_OBJECT controller; - - ASSERT_IRQL(PASSIVE_LEVEL); - - controller = - ExAllocatePoolWithTag(NonPagedPool, sizeof(CONTROLLER_OBJECT), - TAG_CONTROLLER); - if (controller==NULL) - { - return(NULL); - } - - controller->ControllerExtension = - ExAllocatePoolWithTag(NonPagedPool, Size, TAG_CONTROLLER_EXTENSION); - if (controller->ControllerExtension==NULL) - { - ExFreePool(controller); - return(NULL); - } - - KeInitializeDeviceQueue(&controller->DeviceWaitQueue); - return(controller); -} - -/* - * @implemented - */ -VOID -STDCALL -IoDeleteController(PCONTROLLER_OBJECT ControllerObject) -/* - * FUNCTION: Removes a given controller object from the system - * ARGUMENTS: - * ControllerObject = Controller object to be released - */ -{ - ASSERT_IRQL(PASSIVE_LEVEL); - - ExFreePool(ControllerObject->ControllerExtension); - ExFreePool(ControllerObject); -} - -/* - * @implemented - */ -VOID -STDCALL -IoFreeController(PCONTROLLER_OBJECT ControllerObject) -/* - * FUNCTION: Releases a previously allocated controller object when a - * device has finished an I/O request - * ARGUMENTS: - * ControllerObject = Controller object to be released - */ -{ - PKDEVICE_QUEUE_ENTRY QEntry; - CONTROLLER_QUEUE_ENTRY* Entry; - IO_ALLOCATION_ACTION Result; - - do - { - QEntry = KeRemoveDeviceQueue(&ControllerObject->DeviceWaitQueue); - Entry = CONTAINING_RECORD(QEntry,CONTROLLER_QUEUE_ENTRY,Entry); - if (QEntry==NULL) - { - return; - } - Result = Entry->ExecutionRoutine(Entry->DeviceObject, - Entry->DeviceObject->CurrentIrp, - NULL, - Entry->Context); - ExFreePool(Entry); - } while (Result == DeallocateObject); -} - - -/* EOF */ _____ Copied: trunk/reactos/ntoskrnl/io/controller.c (from rev 14808, trunk/reactos/ntoskrnl/io/cntrller.c) --- trunk/reactos/ntoskrnl/io/cntrller.c 2005-04-25 20:35:37 UTC (rev 14808) +++ trunk/reactos/ntoskrnl/io/controller.c 2005-04-26 14:51:18 UTC (rev 14816) @@ -0,0 +1,178 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/io/contrller.c + * PURPOSE: Implements the controller object + * + * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) + */ + +/* INCLUDES *****************************************************************/ + +#include <ntoskrnl.h> +#include <internal/debug.h> + +/* GLOBALS *******************************************************************/ + +POBJECT_TYPE IoControllerObjectType; + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + * + * FUNCTION: Sets up a call to a driver-supplied ControllerControl routine + * as soon as the device controller, represented by the given controller + * object, is available to carry out an I/O operation for the target device, + * represented by the given device object. + * ARGUMENTS: + * ControllerObject = Driver created controller object + * DeviceObject = Target device for the current irp + * ExecutionRoutine = Routine to be called when the device is available + * Context = Driver supplied context to be passed on to the above routine + */ +VOID +STDCALL +IoAllocateController(PCONTROLLER_OBJECT ControllerObject, + PDEVICE_OBJECT DeviceObject, + PDRIVER_CONTROL ExecutionRoutine, + PVOID Context) +{ + IO_ALLOCATION_ACTION Result; + + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + + /* Initialize the Wait Context Block */ + DeviceObject->Queue.Wcb.DeviceContext = Context; + DeviceObject->Queue.Wcb.DeviceRoutine = ExecutionRoutine; + + /* Insert the Device Queue */ + if (!KeInsertDeviceQueue(&ControllerObject->DeviceWaitQueue, + &DeviceObject->Queue.Wcb.WaitQueueEntry)); + { + Result = ExecutionRoutine(DeviceObject, + DeviceObject->CurrentIrp, + NULL, + Context); + } + + if (Result == DeallocateObject) + { + IoFreeController(ControllerObject); + } +} + +/* + * @implemented + * + * FUNCTION: Allocates memory and initializes a controller object + * ARGUMENTS: + * Size = Size (in bytes) to be allocated for the controller extension + * RETURNS: A pointer to the created object + */ +PCONTROLLER_OBJECT +STDCALL +IoCreateController(ULONG Size) + +{ + PCONTROLLER_OBJECT Controller; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE Handle; + NTSTATUS Status; + ASSERT_IRQL(PASSIVE_LEVEL); + + /* Initialize an empty OBA */ + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); + + /* Create the Object */ + Status = ObCreateObject(KernelMode, + IoControllerObjectType, + &ObjectAttributes, + KernelMode, + NULL, + sizeof(CONTROLLER_OBJECT) + Size, + 0, + 0, + (PVOID*)&Controller); + if (!NT_SUCCESS(Status)) return NULL; + + /* Insert it */ + Status = ObInsertObject(Controller, + NULL, + FILE_READ_DATA | FILE_WRITE_DATA, + 0, + NULL, + &Handle); + if (!NT_SUCCESS(Status)) return NULL; + + /* Close the dummy handle */ + NtClose(Handle); + + /* Zero the Object and set its data */ + RtlZeroMemory(Controller, sizeof(CONTROLLER_OBJECT) + Size); + Controller->Type = IO_TYPE_CONTROLLER; + Controller->Size = sizeof(CONTROLLER_OBJECT) + Size; + Controller->ControllerExtension = (Controller + 1); + + /* Initialize its Queue */ + KeInitializeDeviceQueue(&Controller->DeviceWaitQueue); + + /* Return Controller */ + return Controller; +} + +/* + * @implemented + * + * FUNCTION: Removes a given controller object from the system + * ARGUMENTS: + * ControllerObject = Controller object to be released + */ +VOID +STDCALL +IoDeleteController(PCONTROLLER_OBJECT ControllerObject) + +{ + /* Just Dereference it */ + ObDereferenceObject(ControllerObject); +} + +/* + * @implemented + * + * FUNCTION: Releases a previously allocated controller object when a + * device has finished an I/O request + * ARGUMENTS: + * ControllerObject = Controller object to be released + */ +VOID +STDCALL +IoFreeController(PCONTROLLER_OBJECT ControllerObject) +{ + PKDEVICE_QUEUE_ENTRY QueueEntry; + PDEVICE_OBJECT DeviceObject; + IO_ALLOCATION_ACTION Result; + + /* Remove the Queue */ + if ((QueueEntry = KeRemoveDeviceQueue(&ControllerObject->DeviceWaitQueue))) + { + /* Get the Device Object */ + DeviceObject = CONTAINING_RECORD(QueueEntry, + DEVICE_OBJECT, + Queue.Wcb.WaitQueueEntry); + /* Call the routine */ + Result = DeviceObject->Queue.Wcb.DeviceRoutine(DeviceObject, + DeviceObject->CurrentIrp, + NULL, + DeviceObject->Queue.Wcb.DeviceContext); + /* Check the result */ + if (Result == DeallocateObject) + { + /* Free it again */ + IoFreeController(ControllerObject); + } + } +} + + +/* EOF */ _____ Deleted: trunk/reactos/ntoskrnl/io/errlog.c --- trunk/reactos/ntoskrnl/io/errlog.c 2005-04-26 13:17:44 UTC (rev 14815) +++ trunk/reactos/ntoskrnl/io/errlog.c 2005-04-26 14:51:18 UTC (rev 14816) @@ -1,450 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/errlog.c - * PURPOSE: Error logging - * - * PROGRAMMERS: David Welch (welch(a)cwcom.net) - */ - -/* INCLUDES *****************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <internal/debug.h> - -/* TYPES *********************************************************************/ - -typedef struct _ERROR_LOG_ENTRY -{ - LIST_ENTRY Entry; - LARGE_INTEGER TimeStamp; - PVOID IoObject; - ULONG PacketSize; -} ERROR_LOG_ENTRY, *PERROR_LOG_ENTRY; - -typedef struct _LOG_WORKER_DPC -{ - KDPC Dpc; - KTIMER Timer; -} LOG_WORKER_DPC, *PLOG_WORKER_DPC; - - -static VOID STDCALL -IopLogWorker (PVOID Parameter); - - -/* GLOBALS *******************************************************************/ - -static KSPIN_LOCK IopAllocationLock; -static ULONG IopTotalLogSize; - -static KSPIN_LOCK IopLogListLock; -static LIST_ENTRY IopLogListHead; - -static BOOLEAN IopLogWorkerRunning = FALSE; -static BOOLEAN IopLogPortConnected = FALSE; -static HANDLE IopLogPort; - - -/* FUNCTIONS *****************************************************************/ - -NTSTATUS -IopInitErrorLog (VOID) -{ - IopTotalLogSize = 0; - KeInitializeSpinLock (&IopAllocationLock); - - KeInitializeSpinLock (&IopLogListLock); - InitializeListHead (&IopLogListHead); - - return STATUS_SUCCESS; -} - - -static VOID STDCALL -IopLogDpcRoutine (PKDPC Dpc, - PVOID DeferredContext, - PVOID SystemArgument1, - PVOID SystemArgument2) -{ - PWORK_QUEUE_ITEM LogWorkItem; - - DPRINT ("\nIopLogDpcRoutine() called\n"); - - /* Release the WorkerDpc struct */ - ExFreePool (DeferredContext); - - /* Allocate, initialize and restart a work item */ - LogWorkItem = ExAllocatePool (NonPagedPool, - sizeof(WORK_QUEUE_ITEM)); - if (LogWorkItem == NULL) - { - IopLogWorkerRunning = FALSE; - return; - } - - ExInitializeWorkItem (LogWorkItem, - IopLogWorker, - LogWorkItem); - - ExQueueWorkItem (LogWorkItem, - DelayedWorkQueue); -} - - -static VOID -IopRestartLogWorker (VOID) -{ - PLOG_WORKER_DPC WorkerDpc; - LARGE_INTEGER Timeout; - - DPRINT ("IopRestartWorker() called\n"); - - WorkerDpc = ExAllocatePool (NonPagedPool, - sizeof(LOG_WORKER_DPC)); - if (WorkerDpc == NULL) - { - IopLogWorkerRunning = FALSE; - return; - } - - /* Initialize DPC and Timer */ - KeInitializeDpc (&WorkerDpc->Dpc, - IopLogDpcRoutine, - WorkerDpc); - KeInitializeTimer (&WorkerDpc->Timer); - - /* Restart after 30 seconds */ - Timeout.QuadPart = (LONGLONG)-300000000; - KeSetTimer (&WorkerDpc->Timer, - Timeout, - &WorkerDpc->Dpc); -} - - -static BOOLEAN -IopConnectLogPort (VOID) -{ - UNICODE_STRING PortName; - NTSTATUS Status; - - DPRINT ("IopConnectLogPort() called\n"); - - RtlInitUnicodeString (&PortName, - L"\\ErrorLogPort"); - - Status = ZwConnectPort (&IopLogPort, - &PortName, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT ("ZwConnectPort() failed (Status %lx)\n", Status); - return FALSE; - } - - DPRINT ("IopConnectLogPort() done\n"); - - return TRUE; -} - - -static VOID STDCALL -IopLogWorker (PVOID Parameter) -{ - PERROR_LOG_ENTRY LogEntry; - PLPC_MAX_MESSAGE Request; - PIO_ERROR_LOG_MESSAGE Message; - PIO_ERROR_LOG_PACKET Packet; - KIRQL Irql; - NTSTATUS Status; - - UCHAR Buffer[256]; - POBJECT_NAME_INFORMATION ObjectNameInfo; - ULONG ReturnedLength; - PWCHAR DriverName; - ULONG DriverNameLength; - - DPRINT ("IopLogWorker() called\n"); - - /* Release the work item */ - ExFreePool (Parameter); - - /* Connect to the error log port */ - if (IopLogPortConnected == FALSE) - { - if (IopConnectLogPort () == FALSE) - { - IopRestartLogWorker (); - return; - } - - IopLogPortConnected = TRUE; - } - - while (TRUE) - { - /* Remove last entry from the list */ - KeAcquireSpinLock (&IopLogListLock, - &Irql); - - if (!IsListEmpty (&IopLogListHead)) - { - LogEntry = CONTAINING_RECORD (IopLogListHead.Blink, - ERROR_LOG_ENTRY, - Entry); - RemoveEntryList (&LogEntry->Entry); - } - else - { - LogEntry = NULL; - } - - KeReleaseSpinLock (&IopLogListLock, - Irql); - - if (LogEntry == NULL) - { - DPRINT ("No message in log list\n"); - break; - } - - /* Get pointer to the log packet */ - Packet = (PIO_ERROR_LOG_PACKET)((ULONG_PTR)LogEntry + sizeof(ERROR_LOG_ENTRY)); - - - /* Get driver or device name */ - ObjectNameInfo = (POBJECT_NAME_INFORMATION)Buffer; - Status = ObQueryNameString (LogEntry->IoObject, - ObjectNameInfo, - 256, - &ReturnedLength); - if (NT_SUCCESS(Status)) - { - DPRINT ("ReturnedLength: %lu\n", ReturnedLength); - DPRINT ("Length: %hu\n", ObjectNameInfo->Name.Length); - DPRINT ("MaximumLength: %hu\n", ObjectNameInfo->Name.MaximumLength); - DPRINT ("Object: %wZ\n", &ObjectNameInfo->Name); - - DriverName = wcsrchr(ObjectNameInfo->Name.Buffer, L'\\'); - if (DriverName != NULL) - DriverName++; - else - DriverName = ObjectNameInfo->Name.Buffer; - - DriverNameLength = wcslen (DriverName) * sizeof(WCHAR); - DPRINT ("Driver name '%S'\n", DriverName); - } - else - { - DriverName = NULL; - DriverNameLength = 0; - } - - /* Allocate request buffer */ - Request = ExAllocatePool (NonPagedPool, - sizeof(LPC_MAX_MESSAGE)); - if (Request == NULL) - { - DPRINT ("Failed to allocate request buffer!\n"); - - /* Requeue log message and restart the worker */ - ExInterlockedInsertTailList (&IopLogListHead, - &LogEntry->Entry, - &IopLogListLock); - IopRestartLogWorker (); - - return; - } - - /* Initialize the log message */ - Message = (PIO_ERROR_LOG_MESSAGE)Request->Data; - Message->Type = 0xC; //IO_TYPE_ERROR_MESSAGE; - Message->Size = - sizeof(IO_ERROR_LOG_MESSAGE) - sizeof(IO_ERROR_LOG_PACKET) + - LogEntry->PacketSize + DriverNameLength; - Message->DriverNameLength = (USHORT)DriverNameLength; - Message->TimeStamp.QuadPart = LogEntry->TimeStamp.QuadPart; - Message->DriverNameOffset = (DriverName != NULL) ? LogEntry->PacketSize : 0; - - /* Copy error log packet */ - RtlCopyMemory (&Message->EntryData, - Packet, - LogEntry->PacketSize); - - /* Copy driver or device name */ - RtlCopyMemory ((PVOID)((ULONG_PTR)Message + Message->DriverNameOffset), - DriverName, - DriverNameLength); - - DPRINT ("SequenceNumber %lx\n", Packet->SequenceNumber); - - Request->Header.DataSize = Message->Size; - Request->Header.MessageSize = - Request->Header.DataSize + sizeof(LPC_MESSAGE); - - /* Send the error message to the log port */ - Status = ZwRequestPort (IopLogPort, - &Request->Header); - - /* Release request buffer */ - ExFreePool (Request); - - if (!NT_SUCCESS(Status)) - { - DPRINT ("ZwRequestPort() failed (Status %lx)\n", Status); - - /* Requeue log message and restart the worker */ - ExInterlockedInsertTailList (&IopLogListHead, - &LogEntry->Entry, - &IopLogListLock); - IopRestartLogWorker (); - - return; - } - - /* Release error log entry */ - KeAcquireSpinLock (&IopAllocationLock, - &Irql); - - IopTotalLogSize -= (LogEntry->PacketSize - sizeof(ERROR_LOG_ENTRY)); - ExFreePool (LogEntry); - - KeReleaseSpinLock (&IopAllocationLock, - Irql); - } - - IopLogWorkerRunning = FALSE; - - DPRINT ("IopLogWorker() done\n"); -} - - -/* - * @implemented - */ -PVOID STDCALL -IoAllocateErrorLogEntry (IN PVOID IoObject, - IN UCHAR EntrySize) -{ - PERROR_LOG_ENTRY LogEntry; - ULONG LogEntrySize; - KIRQL Irql; - - DPRINT("IoAllocateErrorLogEntry() called\n"); - - if (IoObject == NULL) - return NULL; - - KeAcquireSpinLock (&IopAllocationLock, - &Irql); - - if (IopTotalLogSize > PAGE_SIZE) - { - KeReleaseSpinLock (&IopAllocationLock, - Irql); - return NULL; - } - - LogEntrySize = sizeof(ERROR_LOG_ENTRY) + EntrySize; - LogEntry = ExAllocatePool (NonPagedPool, - LogEntrySize); - if (LogEntry == NULL) - { - KeReleaseSpinLock (&IopAllocationLock, - Irql); - return NULL; - } - - IopTotalLogSize += EntrySize; - - LogEntry->IoObject = IoObject; - LogEntry->PacketSize = LogEntrySize; - - KeReleaseSpinLock (&IopAllocationLock, - Irql); - - return (PVOID)((ULONG_PTR)LogEntry + sizeof(ERROR_LOG_ENTRY)); -} - - -/* - * @implemented - */ -VOID STDCALL -IoFreeErrorLogEntry(IN PVOID ElEntry) -{ - PERROR_LOG_ENTRY LogEntry; - KIRQL Irql; - - DPRINT("IoFreeErrorLogEntry() called\n"); - - if (ElEntry == NULL) - return; - - LogEntry = (PERROR_LOG_ENTRY)((ULONG_PTR)ElEntry - sizeof(ERROR_LOG_ENTRY)); - - KeAcquireSpinLock(&IopAllocationLock, - &Irql); - - IopTotalLogSize -= (LogEntry->PacketSize - sizeof(ERROR_LOG_ENTRY)); - ExFreePool(LogEntry); - - KeReleaseSpinLock(&IopAllocationLock, - Irql); -} - - -/* - * @implemented - */ -VOID STDCALL -IoWriteErrorLogEntry (IN PVOID ElEntry) -{ - PWORK_QUEUE_ITEM LogWorkItem; - PERROR_LOG_ENTRY LogEntry; - KIRQL Irql; - - DPRINT("IoWriteErrorLogEntry() called\n"); - - LogEntry = (PERROR_LOG_ENTRY)((ULONG_PTR)ElEntry - sizeof(ERROR_LOG_ENTRY)); - - /* Get time stamp */ - KeQuerySystemTime (&LogEntry->TimeStamp); - - KeAcquireSpinLock (&IopLogListLock, - &Irql); - - InsertHeadList (&IopLogListHead, - &LogEntry->Entry); - - if (IopLogWorkerRunning == FALSE) - { - LogWorkItem = ExAllocatePool (NonPagedPool, - sizeof(WORK_QUEUE_ITEM)); - if (LogWorkItem != NULL) - { - ExInitializeWorkItem (LogWorkItem, - IopLogWorker, - LogWorkItem); - - ExQueueWorkItem (LogWorkItem, - DelayedWorkQueue); - - IopLogWorkerRunning = TRUE; - } - } - - KeReleaseSpinLock (&IopLogListLock, - Irql); - - DPRINT("IoWriteErrorLogEntry() done\n"); -} - -/* EOF */ _____ Modified: trunk/reactos/ntoskrnl/io/error.c --- trunk/reactos/ntoskrnl/io/error.c 2005-04-26 13:17:44 UTC (rev 14815) +++ trunk/reactos/ntoskrnl/io/error.c 2005-04-26 14:51:18 UTC (rev 14816) @@ -2,49 +2,530 @@ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: ntoskrnl/io/error.c - * PURPOSE: Handle media errors - * - * PROGRAMMERS: David Welch (welch(a)mcmail.com) + * FILE: ntoskrnl/io/errlog.c + * PURPOSE: Error logging + * + * PROGRAMMERS: David Welch (welch(a)cwcom.net) */ /* INCLUDES *****************************************************************/ #include <ntoskrnl.h> +#define NDEBUG #include <internal/debug.h> +/* TYPES *********************************************************************/ + +typedef struct _ERROR_LOG_ENTRY +{ + LIST_ENTRY Entry; + LARGE_INTEGER TimeStamp; + PVOID IoObject; + ULONG PacketSize; +} ERROR_LOG_ENTRY, *PERROR_LOG_ENTRY; + +typedef struct _LOG_WORKER_DPC +{ + KDPC Dpc; + KTIMER Timer; +} LOG_WORKER_DPC, *PLOG_WORKER_DPC; + + +static VOID STDCALL +IopLogWorker (PVOID Parameter); + + +/* GLOBALS *******************************************************************/ + +static KSPIN_LOCK IopAllocationLock; +static ULONG IopTotalLogSize; + +static KSPIN_LOCK IopLogListLock; +static LIST_ENTRY IopLogListHead; + [truncated at 1000 lines; 502 more skipped]
19 years, 8 months
1
0
0
0
[ion] 14815: Fixedd CTM for sedwards. happy birthday to me
by ion@svn.reactos.com
Fixedd CTM for sedwards. happy birthday to me Modified: trunk/rosapps/sysutils/ctm/ctm.c _____ Modified: trunk/rosapps/sysutils/ctm/ctm.c --- trunk/rosapps/sysutils/ctm/ctm.c 2005-04-26 12:35:32 UTC (rev 14814) +++ trunk/rosapps/sysutils/ctm/ctm.c 2005-04-26 13:17:44 UTC (rev 14815) @@ -353,12 +353,12 @@ ULONG Idx, Idx2; HANDLE hProcess; HANDLE hProcessToken; - PSYSTEM_PROCESSES pSPI; + PSYSTEM_PROCESS_INFORMATION pSPI; PPERFDATA pPDOld; TCHAR szTemp[MAX_PATH]; DWORD dwSize; double CurrentKernelTime; - PSYSTEM_PROCESSORTIME_INFO SysProcessorTimeInfo; + PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcessorTimeInfo; SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo; SYSTEM_TIMEOFDAY_INFORMATION SysTimeInfo; @@ -374,18 +374,18 @@ return; #endif // Get processor information - SysProcessorTimeInfo = (PSYSTEM_PROCESSORTIME_INFO)malloc(sizeof(SYSTEM_PROCESSORTIME_INFO) * SystemBasicInfo.NumberProcessors); - status = NtQuerySystemInformation(SystemProcessorTimes, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSORTIME_INFO) * SystemBasicInfo.NumberProcessors, &ulSize); + SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)malloc(sizeof(PSYSTEM_PROCESS OR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors); + status = NtQuerySystemInformation(SystemProcessorTimes, SysProcessorTimeInfo, sizeof(PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors, &ulSize); // Get process information - PsaCaptureProcessesAndThreads((PSYSTEM_PROCESSES *)&pBuffer); + PsaCaptureProcessesAndThreads((PSYSTEM_PROCESS_INFORMATION *)&pBuffer); #ifdef TIMES for (CurrentKernelTime=0, Idx=0; Idx<SystemBasicInfo.NumberProcessors; Idx++) { - CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].TotalProcessorTime); - CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].TotalDPCTime); - CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].TotalInterruptTime); + CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].KernelTime); + CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].DpcTime); + CurrentKernelTime += Li2Double(SysProcessorTimeInfo[Idx].InterruptTime); } // If it's a first call - skip idle time calcs @@ -416,7 +416,7 @@ // returns NULL) ProcessCountOld = ProcessCount; ProcessCount = 0; - pSPI = PsaWalkFirstProcess((PSYSTEM_PROCESSES)pBuffer); + pSPI = PsaWalkFirstProcess((PSYSTEM_PROCESS_INFORMATION)pBuffer); while (pSPI) { ProcessCount++; pSPI = PsaWalkNextProcess(pSPI); @@ -428,13 +428,13 @@ } pPerfDataOld = pPerfData; pPerfData = (PPERFDATA)malloc(sizeof(PERFDATA) * ProcessCount); - pSPI = PsaWalkFirstProcess((PSYSTEM_PROCESSES)pBuffer); + pSPI = PsaWalkFirstProcess((PSYSTEM_PROCESS_INFORMATION)pBuffer); for (Idx=0; Idx<ProcessCount; Idx++) { // Get the old perf data for this process (if any) // so that we can establish delta values pPDOld = NULL; for (Idx2=0; Idx2<ProcessCountOld; Idx2++) { - if (pPerfDataOld[Idx2].ProcessId == pSPI->ProcessId) { + if (pPerfDataOld[Idx2].ProcessId == pSPI->UniqueProcessId) { pPDOld = &pPerfDataOld[Idx2]; break; } @@ -443,9 +443,9 @@ // Clear out process perf data structure memset(&pPerfData[Idx], 0, sizeof(PERFDATA)); - if (pSPI->ProcessName.Buffer) { - wcsncpy(pPerfData[Idx].ImageName, pSPI->ProcessName.Buffer, pSPI->ProcessName.Length / sizeof(WCHAR)); - pPerfData[Idx].ImageName[pSPI->ProcessName.Length / sizeof(WCHAR)] = 0; + if (pSPI->ImageName.Buffer) { + wcsncpy(pPerfData[Idx].ImageName, pSPI->ImageName.Buffer, pSPI->ImageName.Length / sizeof(WCHAR)); + pPerfData[Idx].ImageName[pSPI->ImageName.Length / sizeof(WCHAR)] = 0; } else { @@ -456,7 +456,7 @@ #endif } - pPerfData[Idx].ProcessId = pSPI->ProcessId; + pPerfData[Idx].ProcessId = pSPI->UniqueProcessId; if (pPDOld) { #ifdef TIMES @@ -472,27 +472,27 @@ } pPerfData[Idx].CPUTime.QuadPart = pSPI->UserTime.QuadPart + pSPI->KernelTime.QuadPart; - pPerfData[Idx].WorkingSetSizeBytes = pSPI->VmCounters.WorkingSetSize; - pPerfData[Idx].PeakWorkingSetSizeBytes = pSPI->VmCounters.PeakWorkingSetSize; + pPerfData[Idx].WorkingSetSizeBytes = pSPI->WorkingSetSize; + pPerfData[Idx].PeakWorkingSetSizeBytes = pSPI->PeakWorkingSetSize; if (pPDOld) - pPerfData[Idx].WorkingSetSizeDelta = labs((LONG)pSPI->VmCounters.WorkingSetSize - (LONG)pPDOld->WorkingSetSizeBytes); + pPerfData[Idx].WorkingSetSizeDelta = labs((LONG)pSPI->WorkingSetSize - (LONG)pPDOld->WorkingSetSizeBytes); else pPerfData[Idx].WorkingSetSizeDelta = 0; - pPerfData[Idx].PageFaultCount = pSPI->VmCounters.PageFaultCount; + pPerfData[Idx].PageFaultCount = pSPI->PageFaultCount; if (pPDOld) - pPerfData[Idx].PageFaultCountDelta = labs((LONG)pSPI->VmCounters.PageFaultCount - (LONG)pPDOld->PageFaultCount); + pPerfData[Idx].PageFaultCountDelta = labs((LONG)pSPI->PageFaultCount - (LONG)pPDOld->PageFaultCount); else pPerfData[Idx].PageFaultCountDelta = 0; - pPerfData[Idx].VirtualMemorySizeBytes = pSPI->VmCounters.VirtualSize; - pPerfData[Idx].PagedPoolUsagePages = pSPI->VmCounters.QuotaPagedPoolUsage; - pPerfData[Idx].NonPagedPoolUsagePages = pSPI->VmCounters.QuotaNonPagedPoolUsage; + pPerfData[Idx].VirtualMemorySizeBytes = pSPI->VirtualSize; + pPerfData[Idx].PagedPoolUsagePages = pSPI->QuotaPagedPoolUsage; + pPerfData[Idx].NonPagedPoolUsagePages = pSPI->QuotaNonPagedPoolUsage; pPerfData[Idx].BasePriority = pSPI->BasePriority; pPerfData[Idx].HandleCount = pSPI->HandleCount; - pPerfData[Idx].ThreadCount = pSPI->ThreadCount; + pPerfData[Idx].ThreadCount = pSPI->NumberOfThreads; //pPerfData[Idx].SessionId = pSPI->SessionId; #ifdef EXTRA_INFO - hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pSPI->ProcessId); + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pSPI->UniqueProcessId); if (hProcess) { if (OpenProcessToken(hProcess, TOKEN_QUERY|TOKEN_DUPLICATE|TOKEN_IMPERSONATE, &hProcessToken)) { ImpersonateLoggedOnUser(hProcessToken);
19 years, 8 months
1
0
0
0
[ion] 14814: Enable flags only for 3.4.3, should fix the build for people with versions below. Disabled on 4.0 since they are automatic
by ion@svn.reactos.com
Enable flags only for 3.4.3, should fix the build for people with versions below. Disabled on 4.0 since they are automatic Modified: trunk/reactos/tools/helper.mk _____ Modified: trunk/reactos/tools/helper.mk --- trunk/reactos/tools/helper.mk 2005-04-26 09:40:30 UTC (rev 14813) +++ trunk/reactos/tools/helper.mk 2005-04-26 12:35:32 UTC (rev 14814) @@ -255,6 +255,8 @@ MK_BOOTCDDIR := . MK_DISTDIR := drivers MK_RES_BASE := $(TARGET_NAME) + MK_LFLAGS := -Wl,--file-alignment,0x1000 \ + -Wl,--section-alignment,0x1000 endif ifeq ($(TARGET_TYPE),export_driver) @@ -295,6 +297,8 @@ MK_RES_BASE := $(TARGET_NAME) MK_INSTALL_BASENAME := hal MK_INSTALL_FULLNAME := hal.dll + MK_LFLAGS := -Wl,--file-alignment,0x1000 \ + -Wl,--section-alignment,0x1000 ifeq ($(TARGET_BOOTSTRAP),yes) TARGET_BOOTSTRAP_NAME := hal.dll else @@ -316,6 +320,8 @@ MK_IMPLIBONLY := no MK_IMPLIBDEFPATH := MK_IMPLIB_EXT := .a + MK_LFLAGS := -Wl,--file-alignment,0x1000 \ + -Wl,--section-alignment,0x1000 MK_INSTALLDIR := system32 MK_BOOTCDDIR := system32 MK_DISTDIR := # FIXME @@ -336,6 +342,8 @@ MK_IMPLIBDEFPATH := MK_IMPLIB_EXT := .a MK_INSTALLDIR := system32/drivers + MK_LFLAGS := -Wl,--file-alignment,0x1000 \ + -Wl,--section-alignment,0x1000 MK_BOOTCDDIR := . MK_DISTDIR := drivers MK_RES_BASE := $(TARGET_NAME) @@ -357,6 +365,8 @@ MK_INSTALLDIR := system32 MK_BOOTCDDIR := . MK_DISTDIR := dlls + MK_LFLAGS := -Wl,--file-alignment,0x1000 \ + -Wl,--section-alignment,0x1000 MK_RES_BASE := $(TARGET_NAME) endif @@ -660,8 +670,13 @@ # if needed, until their problems can be found # ifneq ($(DBG),1) - MK_CFLAGS += -Os -Wno-strict-aliasing -funit-at-a-time -fweb -ftracer -momit-leaf-frame-pointer + MK_CFLAGS += -Os -Wno-strict-aliasing -ftracer -momit-leaf-frame-pointer MK_CFLAGS += -mpreferred-stack-boundary=2 + + CC_VERSION=$(word 1,$(shell gcc -dumpversion)) + ifeq ($(CC_VERSION),3.4.3) + MK_CFLAGS += -funit-at-a-time -fweb + endif # # Remove Symbols if no debugging is used at all
19 years, 8 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
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