ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
563 discussions
Start a n
N
ew thread
[hbirr] 16899: Check if the cpu supports the pae mode.
by hbirr@svn.reactos.com
Check if the cpu supports the pae mode. Modified: trunk/reactos/boot/freeldr/freeldr/reactos/loader.c _____ Modified: trunk/reactos/boot/freeldr/freeldr/reactos/loader.c --- trunk/reactos/boot/freeldr/freeldr/reactos/loader.c 2005-07-30 18:52:33 UTC (rev 16898) +++ trunk/reactos/boot/freeldr/freeldr/reactos/loader.c 2005-07-30 18:55:25 UTC (rev 16899) @@ -20,6 +20,7 @@ */ #include <freeldr.h> +#include <../arch/i386/hardware.h> #include <internal/i386/ke.h> #define NDEBUG @@ -279,33 +280,43 @@ FASTCALL FrLdrGetPaeMode(VOID) { - PCHAR p; + BOOLEAN PaeModeSupported; + PaeModeSupported = FALSE; PaeModeEnabled = FALSE; - /* Read Command Line */ - p = (PCHAR)LoaderBlock.CommandLine; - while ((p = strchr(p, '/')) != NULL) { + if (CpuidSupported() & 1) + { + ULONG eax, ebx, ecx, FeatureBits; + GetCpuid(1, &eax, &ebx, &ecx, &FeatureBits); + if (FeatureBits & X86_FEATURE_PAE) + { + PaeModeSupported = TRUE; + } + } - p++; - /* Find "PAE" */ - if (!strnicmp(p, "PAE", 3)) { + if (PaeModeSupported) + { + PCHAR p; - /* Make sure there's nothing following it */ - if (p[3] == ' ' || p[3] == 0) { + /* Read Command Line */ + p = (PCHAR)LoaderBlock.CommandLine; + while ((p = strchr(p, '/')) != NULL) { - /* Use Pae */ - PaeModeEnabled = TRUE; - break; - } - } + p++; + /* Find "PAE" */ + if (!strnicmp(p, "PAE", 3)) { + + /* Make sure there's nothing following it */ + if (p[3] == ' ' || p[3] == 0) { + + /* Use Pae */ + PaeModeEnabled = TRUE; + break; + } + } + } } - if (PaeModeEnabled) - { - /* FIXME: - * Check if the cpu is pae capable - */ - } } /*++
19 years, 5 months
1
0
0
0
[hbirr] 16898: Made cmd unicode compatible.
by hbirr@svn.reactos.com
Made cmd unicode compatible. Modified: trunk/reactos/subsys/system/cmd/console.c Modified: trunk/reactos/subsys/system/cmd/copy.c Modified: trunk/reactos/subsys/system/cmd/main.c Modified: trunk/reactos/subsys/system/cmd/move.c _____ Modified: trunk/reactos/subsys/system/cmd/console.c --- trunk/reactos/subsys/system/cmd/console.c 2005-07-30 18:51:43 UTC (rev 16897) +++ trunk/reactos/subsys/system/cmd/console.c 2005-07-30 18:52:33 UTC (rev 16898) @@ -261,22 +261,27 @@ LineCount = 0; /* rest LineCount and return if no string have been given */ - if (szFormat == NULL) - return; + if (szFormat == NULL) + return; //get the size of the visual screen that can be printed too - GetConsoleScreenBufferInfo(hConsole, &csbi); + if (!GetConsoleScreenBufferInfo(hConsole, &csbi)) + { + // we assuming its a file handle + ConPrintf(szFormat, arg_ptr, nStdHandle); + return; + } //subtract 2 to account for "press any key..." and for the blank line at the end of PagePrompt() ScreenLines = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4; ScreenCol = (csbi.srWindow.Right - csbi.srWindow.Left) + 1; - //make sure they didnt make the screen to small + //make sure they didnt make the screen to small if(ScreenLines<4) - { - ConPrintf(szFormat, arg_ptr, nStdHandle); - return ; - } + { + ConPrintf(szFormat, arg_ptr, nStdHandle); + return ; + } len = _vstprintf (szOut, szFormat, arg_ptr); #ifdef _UNICODE @@ -286,44 +291,44 @@ pBuf = szOut; #endif - for(i = 0; i < len; i++) - { + for(i = 0; i < len; i++) + { - if(szOut[i] == _T('\n')) - { - LineCount++; - CharEL=0; - } - else - { - CharEL++; - if (CharEL>=ScreenCol) - { - if (i+1<len) - { - if(szOut[i+1] != _T('\n')) LineCount++; - } - CharEL=0; - } - } + if(pBuf[i] == '\n') + { + LineCount++; + CharEL=0; + } + else + { + CharEL++; + if (CharEL>=ScreenCol) + { + if (i+1<len) + { + if(pBuf[i+1] != '\n') LineCount++; + } + CharEL=0; + } + } - /* FIXME : write more that one char at time */ - WriteFile (GetStdHandle (nStdHandle),&pBuf[i],sizeof(TCHAR),&dwWritten,NULL); - if(LineCount >= ScreenLines) - { - if(_tcsncicmp(&szOut[i],_T("\n"),2)!=0) - WriteFile (GetStdHandle (nStdHandle),_T("\n"),sizeof(TCHAR),&dwWritten,NULL); + /* FIXME : write more that one char at time */ + WriteFile (GetStdHandle (nStdHandle),&pBuf[i],sizeof(CHAR),&dwWritten,NULL); + if(LineCount >= ScreenLines) + { + if(strnicmp(&pBuf[i], "\n", 2)!=0) + WriteFile (GetStdHandle (nStdHandle),"\n",sizeof(CHAR),&dwWritten,NULL); - if(PagePrompt() != PROMPT_YES) - { - return; - } - //reset the number of lines being printed - LineCount = 0; - CharEL=0; - } + if(PagePrompt() != PROMPT_YES) + { + return; + } + //reset the number of lines being printed + LineCount = 0; + CharEL=0; + } - } + } #ifdef UNICODE free(pBuf); _____ Modified: trunk/reactos/subsys/system/cmd/copy.c --- trunk/reactos/subsys/system/cmd/copy.c 2005-07-30 18:51:43 UTC (rev 16897) +++ trunk/reactos/subsys/system/cmd/copy.c 2005-07-30 18:52:33 UTC (rev 16898) @@ -321,7 +321,7 @@ INT res; LoadString(CMD_ModuleHandle, STRING_COPY_HELP1, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg,fn); - res = FilePromptYNA (""); + res = FilePromptYNA (_T("")); return res; } @@ -833,7 +833,7 @@ nFiles++; /* only print source name when more then one file */ if(_tcschr (arg[nSrc], _T('+')) != NULL || _tcschr (arg[nSrc], _T('*')) != NULL) - ConOutPrintf("%s\n",findBuffer.cFileName); + ConOutPrintf(_T("%s\n"),findBuffer.cFileName); //LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE); } else _____ Modified: trunk/reactos/subsys/system/cmd/main.c --- trunk/reactos/subsys/system/cmd/main.c 2005-07-30 18:51:43 UTC (rev 16897) +++ trunk/reactos/subsys/system/cmd/main.c 2005-07-30 18:52:33 UTC (rev 16898) @@ -17,7 +17,7 @@ #endif { #ifdef _UNICODE - return _main(void); + return _main(); #else return _main(argc, argv); #endif _____ Modified: trunk/reactos/subsys/system/cmd/move.c --- trunk/reactos/subsys/system/cmd/move.c 2005-07-30 18:51:43 UTC (rev 16897) +++ trunk/reactos/subsys/system/cmd/move.c 2005-07-30 18:52:33 UTC (rev 16898) @@ -60,7 +60,7 @@ INT res; LoadString(CMD_ModuleHandle, STRING_MOVE_HELP1, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg,fn); - res = FilePromptYNA (""); + res = FilePromptYNA (_T("")); return res; }
19 years, 5 months
1
0
0
0
[hbirr] 16897: Use FileGetString instead of ReadFile, because ReadFile doesn't return a null terminated string.
by hbirr@svn.reactos.com
Use FileGetString instead of ReadFile, because ReadFile doesn't return a null terminated string. Modified: trunk/reactos/subsys/system/cmd/type.c _____ Modified: trunk/reactos/subsys/system/cmd/type.c --- trunk/reactos/subsys/system/cmd/type.c 2005-07-30 18:32:18 UTC (rev 16896) +++ trunk/reactos/subsys/system/cmd/type.c 2005-07-30 18:51:43 UTC (rev 16897) @@ -37,7 +37,6 @@ TCHAR szMsg[RC_STRING_MAX_SIZE]; TCHAR buff[256]; HANDLE hFile, hConsoleOut; - DWORD dwRead; BOOL bRet; INT argc,i; LPTSTR *argv; @@ -105,21 +104,20 @@ do { - bRet = ReadFile(hFile,buff,sizeof(buff),&dwRead,NULL); - + bRet = FileGetString (hFile, buff, sizeof(buff) / sizeof(TCHAR)); if(bPaging) { - if(dwRead>0 && bRet) + if(bRet) ConOutPrintfPaging(bFirstTime, buff); } else { - if(dwRead>0 && bRet) + if(bRet) ConOutPrintf(buff); } bFirstTime = FALSE; - } while(dwRead>0 && bRet); + } while(bRet); CloseHandle(hFile); }
19 years, 5 months
1
0
0
0
[hbirr] 16896: Put FindClose onto the correct position.
by hbirr@svn.reactos.com
Put FindClose onto the correct position. Modified: trunk/reactos/subsys/system/cmd/del.c _____ Modified: trunk/reactos/subsys/system/cmd/del.c --- trunk/reactos/subsys/system/cmd/del.c 2005-07-30 16:53:09 UTC (rev 16895) +++ trunk/reactos/subsys/system/cmd/del.c 2005-07-30 18:32:18 UTC (rev 16896) @@ -385,7 +385,7 @@ for (i = 0; i < args; i++) { - /*this checks to see if it isnt a flag, if it isnt, we assume it is a file name*/ + /*this checks to see if it isnt a flag, if it isnt, we assume it is a file name*/ if((*arg[i] == _T('/')) || (*arg[i] == _T('-'))) continue; bSubFileFound = FALSE; @@ -454,175 +454,175 @@ } - if(_tcschr (AltArg, _T('*')) == NULL && - IsExistingDirectory (AltArg)) - { - /* If it doesnt have a \ at the end already then on needs to be added */ - if(AltArg[_tcslen(AltArg) - 1] != _T('\\')) - _tcscat (AltArg, _T("\\")); - /* Add a wildcard after the \ */ - _tcscat (AltArg, _T("*")); - } + if(_tcschr (AltArg, _T('*')) == NULL && + IsExistingDirectory (AltArg)) + { + /* If it doesnt have a \ at the end already then on needs to be added */ + if(AltArg[_tcslen(AltArg) - 1] != _T('\\')) + _tcscat (AltArg, _T("\\")); + /* Add a wildcard after the \ */ + _tcscat (AltArg, _T("*")); + } - if(!_tcscmp (AltArg, _T("*")) || - !_tcscmp (AltArg, _T("*.*"))|| - (AltArg[_tcslen(AltArg) - 2] == _T('\\') && AltArg[_tcslen(AltArg) - 1] == _T('*'))) - { - /*well, the user wants to delete everything but if they didnt yes DEL_YES, DEL_QUIET, or DEL_PROMPT - then we are going to want to make sure that in fact they want to do that. */ + if(!_tcscmp (AltArg, _T("*")) || + !_tcscmp (AltArg, _T("*.*"))|| + (AltArg[_tcslen(AltArg) - 2] == _T('\\') && AltArg[_tcslen(AltArg) - 1] == _T('*'))) + { + /*well, the user wants to delete everything but if they didnt yes DEL_YES, DEL_QUIET, or DEL_PROMPT + then we are going to want to make sure that in fact they want to do that. */ - if (!((dwFlags & DEL_YES) || (dwFlags & DEL_QUIET) || (dwFlags & DEL_PROMPT))) - { - LoadString( CMD_ModuleHandle, STRING_DEL_HELP2, szMsg, RC_STRING_MAX_SIZE); + if (!((dwFlags & DEL_YES) || (dwFlags & DEL_QUIET) || (dwFlags & DEL_PROMPT))) + { + LoadString( CMD_ModuleHandle, STRING_DEL_HELP2, szMsg, RC_STRING_MAX_SIZE); - res = FilePromptYNA (szMsg); - if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) - break; - if(res == PROMPT_ALL) - dwFlags |= DEL_YES; - } - } + res = FilePromptYNA (szMsg); + if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) + break; + if(res == PROMPT_ALL) + dwFlags |= DEL_YES; + } + } #ifdef _DEBUG - ConErrPrintf (_T("File: %s\n"), arg[i]); + ConErrPrintf (_T("File: %s\n"), arg[i]); #endif #ifdef _DEBUG - ConErrPrintf(_T("Wildcards!\n\n")); + ConErrPrintf(_T("Wildcards!\n\n")); #endif - GetFullPathName (AltArg, - MAX_PATH, - szFullPath, - &pFilePart); + GetFullPathName (AltArg, + MAX_PATH, + szFullPath, + &pFilePart); #ifdef _DEBUG - ConErrPrintf(_T("Full path: %s\n"), szFullPath); - ConErrPrintf(_T("File part: %s\n"), pFilePart); + ConErrPrintf(_T("Full path: %s\n"), szFullPath); + ConErrPrintf(_T("File part: %s\n"), pFilePart); #endif - hFile = FindFirstFile (szFullPath, &f); + hFile = FindFirstFile (szFullPath, &f); - do - { + do + { - if (hFile == INVALID_HANDLE_VALUE) - { - error_file_not_found (); - freep (arg); - return 0; - } + if (hFile == INVALID_HANDLE_VALUE) + { + error_file_not_found (); + freep (arg); + return 0; + } - /*bExclusion is the check varible to see if it has a match - and it needs to be set to false before each loop, as it hasnt been matched yet*/ - bExclusion = 0; + /*bExclusion is the check varible to see if it has a match + and it needs to be set to false before each loop, as it hasnt been matched yet*/ + bExclusion = 0; - /*loop through each of the arguments*/ - for (ii = 0; ii < args; ii++) - { - /*check to see if it is a exclusion tag but not a ':' (used in ATTR)*/ - if(_tcschr (arg[ii], _T('-')) && _tcschr (arg[ii], _T(':')) == NULL) - { - /*remove the - from the front to get the real name*/ - _tcscpy (exfileName , arg[ii]); - szFileName = strtok (exfileName,"-"); - GetFullPathName (szFileName, - MAX_PATH, - szFullPath, - &pFilePart); - hFileExcl = FindFirstFile (szFullPath, &f2); - do - { - /*check to see if the filenames match*/ - if(!_tcscmp (f.cFileName, f2.cFileName)) - bExclusion = 1; - } - while (FindNextFile (hFileExcl, &f2)); - } - } + /*loop through each of the arguments*/ + for (ii = 0; ii < args; ii++) + { + /*check to see if it is a exclusion tag but not a ':' (used in ATTR)*/ + if(_tcschr (arg[ii], _T('-')) && _tcschr (arg[ii], _T(':')) == NULL) + { + /*remove the - from the front to get the real name*/ + _tcscpy (exfileName , arg[ii]); + szFileName = _tcstok (exfileName,_T("-")); + GetFullPathName (szFileName, + MAX_PATH, + szFullPath, + &pFilePart); + hFileExcl = FindFirstFile (szFullPath, &f2); + do + { + /*check to see if the filenames match*/ + if(!_tcscmp (f.cFileName, f2.cFileName)) + bExclusion = 1; + } + while (FindNextFile (hFileExcl, &f2)); + } + } - /*if it is going to be excluded by - no need to check attrs*/ - if(dwFlags & DEL_ATTRIBUTES && bExclusion == 0) - { + /*if it is going to be excluded by - no need to check attrs*/ + if(dwFlags & DEL_ATTRIBUTES && bExclusion == 0) + { - /*save if file attr check if user doesnt care about that attr anyways*/ - if(dwAttrFlags & ATTR_ARCHIVE && !(f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) - bExclusion = 1; - if(dwAttrFlags & ATTR_HIDDEN && !(f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) - bExclusion = 1; - if(dwAttrFlags & ATTR_SYSTEM && !(f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) - bExclusion = 1; - if(dwAttrFlags & ATTR_READ_ONLY && !(f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - bExclusion = 1; - if(dwAttrFlags & ATTR_N_ARCHIVE && (f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) - bExclusion = 1; - if(dwAttrFlags & ATTR_N_HIDDEN && (f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) - bExclusion = 1; - if(dwAttrFlags & ATTR_N_SYSTEM && (f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) - bExclusion = 1; - if(dwAttrFlags & ATTR_N_READ_ONLY && (f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - bExclusion = 1; - } + /*save if file attr check if user doesnt care about that attr anyways*/ + if(dwAttrFlags & ATTR_ARCHIVE && !(f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) + bExclusion = 1; + if(dwAttrFlags & ATTR_HIDDEN && !(f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) + bExclusion = 1; + if(dwAttrFlags & ATTR_SYSTEM && !(f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) + bExclusion = 1; + if(dwAttrFlags & ATTR_READ_ONLY && !(f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + bExclusion = 1; + if(dwAttrFlags & ATTR_N_ARCHIVE && (f.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)) + bExclusion = 1; + if(dwAttrFlags & ATTR_N_HIDDEN && (f.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) + bExclusion = 1; + if(dwAttrFlags & ATTR_N_SYSTEM && (f.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) + bExclusion = 1; + if(dwAttrFlags & ATTR_N_READ_ONLY && (f.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + bExclusion = 1; + } - if(bExclusion) - continue; + if(bExclusion) + continue; - /* ignore ".", ".." and directories */ - if (!_tcscmp (f.cFileName, _T(".")) || - !_tcscmp (f.cFileName, _T("..")) || - f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - continue; + /* ignore ".", ".." and directories */ + if (!_tcscmp (f.cFileName, _T(".")) || + !_tcscmp (f.cFileName, _T("..")) || + f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + continue; - _tcscpy (pFilePart, f.cFileName); + _tcscpy (pFilePart, f.cFileName); #ifdef _DEBUG - ConErrPrintf(_T("Full filename: %s\n"), szFullPath); + ConErrPrintf(_T("Full filename: %s\n"), szFullPath); #endif - /* ask for deleting */ - if (dwFlags & DEL_PROMPT) - { - LoadString(CMD_ModuleHandle, STRING_DEL_ERROR5, szMsg, RC_STRING_MAX_SIZE); - ConErrPrintf(szMsg, szFullPath); + /* ask for deleting */ + if (dwFlags & DEL_PROMPT) + { + LoadString(CMD_ModuleHandle, STRING_DEL_ERROR5, szMsg, RC_STRING_MAX_SIZE); + ConErrPrintf(szMsg, szFullPath); - LoadString(CMD_ModuleHandle, STRING_DEL_ERROR6, szMsg, RC_STRING_MAX_SIZE); - res = FilePromptYN (szMsg); + LoadString(CMD_ModuleHandle, STRING_DEL_ERROR6, szMsg, RC_STRING_MAX_SIZE); + res = FilePromptYN (szMsg); - if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) - { - continue; //FIXME: Errorcode? - } - } + if ((res == PROMPT_NO) || (res == PROMPT_BREAK)) + { + continue; //FIXME: Errorcode? + } + } - /*user cant ask it to be quiet and tell you what it did*/ - if (!(dwFlags & DEL_QUIET) && !(dwFlags & DEL_TOTAL)) - { - LoadString(CMD_ModuleHandle, STRING_DEL_ERROR7, szMsg, RC_STRING_MAX_SIZE); - ConErrPrintf(szMsg, szFullPath); - } + /*user cant ask it to be quiet and tell you what it did*/ + if (!(dwFlags & DEL_QUIET) && !(dwFlags & DEL_TOTAL)) + { + LoadString(CMD_ModuleHandle, STRING_DEL_ERROR7, szMsg, RC_STRING_MAX_SIZE); + ConErrPrintf(szMsg, szFullPath); + } - /* delete the file */ - if(dwFlags & DEL_NOTHING) - continue; + /* delete the file */ + if(dwFlags & DEL_NOTHING) + continue; - if(RemoveFile (szFullPath, dwFlags)) - dwFiles++; - else - { - bSubFileFound = FALSE; - ErrorMessage (GetLastError(), _T("")); - break; - } + if(RemoveFile (szFullPath, dwFlags)) + dwFiles++; + else + { + bSubFileFound = FALSE; + ErrorMessage (GetLastError(), _T("")); + break; + } + } + while (FindNextFile (hFile, &f)); + FindClose (hFile); } - while (FindNextFile (hFile, &f)); - } while(bSubFileFound); } - FindClose (hFile); freep (arg);
19 years, 5 months
1
0
0
0
[ea] 16895: Create a subdir for rbuild documentation.
by ea@svn.reactos.com
Create a subdir for rbuild documentation. Move rbuild.txt there. Convert rbuild.txt in Docbook. Fix some minor inconsistencies in the element reference. Added: trunk/reactos/tools/rbuild/doc/ Added: trunk/reactos/tools/rbuild/doc/rbuild.dbk Added: trunk/reactos/tools/rbuild/doc/rbuild.txt Deleted: trunk/reactos/tools/rbuild/rbuild.txt _____ Added: trunk/reactos/tools/rbuild/doc/rbuild.dbk --- trunk/reactos/tools/rbuild/doc/rbuild.dbk 2005-07-30 16:25:35 UTC (rev 16894) +++ trunk/reactos/tools/rbuild/doc/rbuild.dbk 2005-07-30 16:53:09 UTC (rev 16895) @@ -0,0 +1,1529 @@ +<?xml version="1.0" encoding="US-ASCII"?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" +"
http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
"> +<book> + <title>ReactOS Build System Documentation</title> + + <bookinfo> + <releaseinfo>$Id$</releaseinfo> + + <author> + <firstname>Casper</firstname> + + <surname>Hornstrup</surname> + </author> + + <othercredit> + <surname>Emanuele Aliberti</surname> + </othercredit> + + <copyright> + <year>2005</year> + </copyright> + </bookinfo> + + <chapter> + <title>Building ReactOS</title> + + <section> + <title>Building ReactOS</title> + + <para>To generate GNU make makefiles and building ReactOS, do the + following:<orderedlist> + <listitem> + <para>Go to the top-level <filename>reactos</filename> + directory;</para> + </listitem> + + <listitem> + <para>Run the command:<screen>mingw32-make</screen></para> + + <para>This will start building ReactOS.</para> + </listitem> + </orderedlist></para> + + <para>To build a bootable CD, run the following command:<screen>mingw32-make bootcd</screen>This + will create <filename>ReactOS.iso</filename> in the top-level + <filename>reactos</filename> directory.</para> + </section> + </chapter> + + <chapter> + <title>How build directions are stored</title> + + <para>XML files are used throughout the ReactOS source tree to drive the + build system.</para> + + <section> + <title>Top-level XML Build File</title> + + <para>The top-level XML build file (<filename>ReactOS.xml</filename>) is + processed by <command>rbuild</command>. The following is an example of + how it could look like:<programlisting><?xml version="1.0"?> +<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> +<project name="ReactOS" makefile="Makefile.auto" xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <xi:include href="config.xml"> + <xi:fallback> + <xi:include href="config.template.xml" /> + </xi:fallback> + </xi:include> + + <define name="_M_IX86" /> + <if property="DBG" value="1"> + <define name="DBG" value="1" /> + <property name="DBG_OR_KDBG" value="true" /> + </if> + + <include base="ReactOS">include</include> + + <directory name="boot"> + <xi:include href="boot/boot.xml" /> + </directory> + + <module name="bootcd" type="iso"> + </module> +</project></programlisting></para> + + <section> + <title>XInclude</title> + + <para>XML files used by <command>rbuild</command> are modular and use + XInclude to include other chunks of XML in the top-level ReactOS.xml + file. The namespace used by XInclude is <literal>xi</literal>.</para> + + <section> + <title>xi:include</title> + + <para>It is possible to split an XML build file over several files. + The include element in the <literal>xi</literal> namespace is used + to accomplish this.</para> + + <section> + <title>Syntax</title> + + <programlisting> <xi:include href="config.xml"> + <xi:fallback> + <xi:include href="config.template.xml" /> + </xi:fallback> + </xi:include></programlisting> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>href</term> + + <listitem> + <para>Name of XML build file to include. The filename is + relative to the location of the current XML build + file.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para>xi:fallback</para> + </section> + </section> + + <section> + <title>xi:fallback</title> + + <para>This element is used to provide the name of an alternate file + that is to be included if the first include file did not + exists.</para> + + <section> + <title>Attributes</title> + + <para>None.</para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para>xi:include</para> + </section> + </section> + </section> + + <section> + <title xreflabel="element_project">Project element</title> + + <para>There can be one <sgmltag class="element">project</sgmltag> per + top-level XML build file. A project can only be defined in a top-level + XML build file.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><project name="ReactOS" makefile="Makefile.auto" xmlns:xi="
http://www.w3.org/2001/XInclude
"> + ... +</project></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>name</term> + + <listitem> + <para>Name of the project.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>makefile</term> + + <listitem> + <para>Filename of the GNU makefile that is to be + created.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para><link linkend="element_define">define</link>, <link + linkend="element_directory">directory</link>, <link + linkend="element_if">if</link>, <link + linkend="element_include">include</link>, <link + linkend="element_module">module</link>, <link + linkend="element_property">property</link>.</para> + </section> + </section> + + <section> + <title xreflabel="element_module">Module element</title> + + <para>There can be zero or more <sgmltag + class="element">module</sgmltag>s per XML build file.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><module if="${MP}" ifnot="${MP}" name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false" warnings="true" aliasof="module1"> + ... +</module></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>if</term> + + <listitem> + <para>If the value is 1, then the module is enabled, + otherwise it is disabled. A disabled module is not + processed.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>ifnot</term> + + <listitem> + <para>If the value is 1, then the module is disabled, + otherwise it is enabled. A disabled module is not + processed.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>name</term> + + <listitem> + <para>Name of the module. Also the base name of the + generated file if such file is generated for the particular + module type.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>type</term> + + <listitem> + <para>Type of module. See below for an explanation of module + types. <emphasis><emphasis>The module type determines the + actions that is to be carried out to process the module. The + defined module types are seen + below:</emphasis></emphasis></para> + + <table> + <title>Module Types</title> + + <tgroup cols="6"> + <thead> + <row> + <entry>Value</entry> + + <entry>Output name suffix</entry> + + <entry>Entrypoint</entry> + + <entry>Baseaddress</entry> + + <entry>Mangledsymbols</entry> + + <entry>Description</entry> + </row> + </thead> + + <tbody> + <row> + <entry>buildtool</entry> + + <entrytbl cols="2"> + <tbody> + <row> + <entry><filename>.exe</filename> (Windows)</entry> + + <entry>none (Linux)</entry> + </row> + </tbody> + </entrytbl> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a tool that can be run (invoked) when + building ReactOS.</entry> + </row> + + <row> + <entry>staticlibrary</entry> + + <entry><filename>.a</filename></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a static library containing object + files that can be linked together with other + modules.</entry> + </row> + + <row> + <entry>objectlibrary</entry> + + <entry><filename>.o</filename></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds object files that can be linked + together with other modules.</entry> + </row> + + <row> + <entry>kernel</entry> + + <entry><filename>.exe</filename></entry> + + <entry><function>_NtProcessStartup</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds + <filename>ntoskrnl.exe</filename>.</entry> + </row> + + <row> + <entry>kernelmodedll</entry> + + <entry><filename>.dll</filename></entry> + + <entry><function>_DriverEntry@8</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a kernel-mode DLL.</entry> + </row> + + <row> + <entry>kernelmodedriver</entry> + + <entry><filename>.sys</filename></entry> + + <entry><function>_DriverEntry@8</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a kernel-mode driver.</entry> + </row> + + <row> + <entry>nativedll</entry> + + <entry><filename>.dll</filename></entry> + + <entry><function>_DllMainCRTStartup@12</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a native DLL.</entry> + </row> + + <row> + <entry>win32dll</entry> + + <entry><filename>.dll</filename></entry> + + <entry><function>_DllMain@12</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a Win32 DLL.</entry> + </row> + + <row> + <entry>win32cui</entry> + + <entry><filename>.exe</filename></entry> + + <entry><function>_mainCRTStartup</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a Win32 console executable.</entry> + </row> + + <row> + <entry>win32gui</entry> + + <entry><filename>.exe</filename></entry> + + <entry><function>_WinMainCRTStartup</function></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a Win32 GUI executable.</entry> + </row> + + <row> + <entry>bootloader</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a bootloader.</entry> + </row> + + <row> + <entry>bootsector</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds one or more bootsector binaries. The + entrypoint, baseaddress, and mangledsymbols module + attributes are not applicable for this module + type.</entry> + </row> + + <row> + <entry>iso</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-.</entry> + + <entry>Builds a bootable CD.</entry> + </row> + + <row> + <entry>test</entry> + + <entry>.exe</entry> + + <entry>_mainCRTStartup</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Builds a testsuite.</entry> + </row> + + <row> + <entry>rpcserver</entry> + + <entry><filename>.o</filename></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Generates and builds server code for an RPC + interface.</entry> + </row> + + <row> + <entry>rpcclient</entry> + + <entry><filename>.o</filename></entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Generates and builds client code for an RPC + interface.</entry> + </row> + + <row> + <entry>alias</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>-</entry> + + <entry>Module is an alias for another module. This + module type is the only module type for which the + aliasof attribute is applicable. Only the module + install functionality is aliased.</entry> + </row> + </tbody> + </tgroup> + </table> + </listitem> + </varlistentry> + + <varlistentry> + <term>extension</term> + + <listitem> + <para>Extension of the generated file if such file is + generated for the particular module type.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>entrypoint</term> + + <listitem> + <para>Entrypoint symbol of the generated file if such file + is generated for the particular module type.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>baseaddress</term> + + <listitem> + <para>Base address of the generated file if such file is + generated for the particular module type.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>mangledsymbols</term> + + <listitem> + <para>Controls wether or not to pass --kill-at to dlltool. + If this attribute has the value false then --kill-at is + passed to dlltool. If the value is true, then --kill-at is + not passed to dlltool. If the generated file exports C++ + classes then this need to be true.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>installbase</term> + + <listitem> + <para>Base directory of the generated file in the + installation directory. This attribute is optional.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>installname</term> + + <listitem> + <para>Name of generated file in the installation directory. + This attribute is optional, but if not specified, the + generated file is not copied to the installation + directory.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>usewrc</term> + + <listitem> + <para>Use WRC to compile resources if true. If false, + windres is used. This attribute is optional. If not + specified, WRC will be used.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>warnings</term> + + <listitem> + <para>Error out if false and at least one warning is emitted + during building of this module. This attribute is optional. + If not specified, it is assumed to be false.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>aliasof</term> + + <listitem> + <para>Name of module that is aliased.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para><link linkend="element_bootstrap">bootstrap</link>, <link + linkend="element_component">component</link>, <link + linkend="element_define">define</link>, <link + linkend="element_dependency">dependency</link>, <link + linkend="element_directory">directory</link>, <link + linkend="element_file">file</link>, <link + linkend="element_if">if</link>, <link + linkend="element_importlibrary">importlibrary</link>, <link + linkend="element_include">include</link>, <link + linkend="element_invoke">invoke</link>, <link + linkend="element_library">library</link>, <link + linkend="element_property">property</link>.</para> + </section> + </section> + + <section> + <title xreflabel="element_bootstrap">Bootstrap element</title> + + <para>A bootstrap element specifies that the generated file should be + put on the bootable CD as a bootstrap file.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><bootstrap base="reactos" nameoncd="halmp.dll" /></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>base</term> + + <listitem> + <para> Put file in this directory on the bootable CD. This + attribute is optional.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>nameoncd</term> + + <listitem> + <para> Name of file on the bootable CD. This attribute is + optional.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para>None.</para> + </section> + </section> + + <section> + <title xreflabel="element_cdfile">CDFile element</title> + + <para>A cdfile element specifies the name of a file that is to be put + on the bootable CD.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><cdfile base="reactos" nameoncd="ReadMe.txt">ReadMe.txt</cdfile></programlisting></par a> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>base</term> + + <listitem> + <para> Put file in this directory on the bootable CD. This + attribute is optional.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>nameoncd</term> + + <listitem> + <para>Name of file on the bootable CD. This attribute is + optional.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>Name of file.</para> + </section> + + <section> + <title>Elements</title> + + <para>None.</para> + </section> + </section> + + <section> + <title xreflabel="element_component">Component element</title> + + <para>A component element specifies that imports from a library are to + be stubbed so tests can be run without actually calling the functions + in the library. This element can only be used for modules of type + test.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><component name="ntdll.dll"> + ... +</component></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>name</term> + + <listitem> + <para>Name of library.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para><link linkend="element_symbol">symbol</link>.</para> + </section> + </section> + + <section> + <title xreflabel="element_symbol">Symbol element</title> + + <para>A symbol element specifies an imported function from a library + that is to be stubbed so tests can be run without actually calling the + function in the library.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol></programlisting ></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>newname</term> + + <listitem> + <para>New name of symbol. This attribute is optional.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>Name of symbol.</para> + </section> + + <section> + <title>Elements</title> + + <para>None.</para> + </section> + </section> + + <section> + <title xreflabel="element_define">Define element</title> + + <para>A define element specifies the name and (optionally) value of a + define for the C/C++ compiler and resource compiler.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><define name="WINVER">0x501</define></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>name</term> + + <listitem> + <para> Name of define.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>Value of define. The value is optional.</para> + </section> + + <section> + <title>Elements</title> + + <para>None.</para> + </section> + </section> + + <section> + <title xreflabel="element_dependency">Dependency element</title> + + <para>A dependency element specifies the name of a module (usually of + type buildtool) that is to be processed before the current + module.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><dependency>OtherModule</dependency></ programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para>None.</para> + </section> + + <section> + <title>Value</title> + + <para>Name of module.</para> + </section> + + <section> + <title>Elements</title> + + <para>None.</para> + </section> + </section> + + <section> + <title xreflabel="element_directory">Directory element</title> + + <para>A directory element specifies the name of a subdirectory.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><directory name="<replaceable>MyDirectory</replaceable>"> + ... +</directory></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para><variablelist> + <varlistentry> + <term>name</term> + + <listitem> + <para>Name of directory.</para> + </listitem> + </varlistentry> + </variablelist></para> + </section> + + <section> + <title>Value</title> + + <para>None.</para> + </section> + + <section> + <title>Elements</title> + + <para><link linkend="element_cdfile">cdfile</link>, <link + linkend="element_directory">directory</link>, <link + linkend="element_file">file</link>, <link + linkend="element_if">if</link>, <link + linkend="element_property">property</link>.</para> + </section> + </section> + + <section> + <title xreflabel="element_file">File element</title> + + <para>A file element specifies the name of a file that is to be + processed.</para> + + <section> + <title>Syntax</title> + + <para><programlisting><file><replaceable>MyFile.c</replaceable>< ;/file></programlisting></para> + </section> + + <section> + <title>Attributes</title> + + <para>None.</para> + </section> + + <section> + <title>Value</title> + [truncated at 1000 lines; 1031 more skipped]
19 years, 5 months
1
0
0
0
[navaraf] 16894: - Replace MODULE_OBJECT with LDR_DATA_TABLE_ENTRY.
by navaraf@svn.reactos.com
- Replace MODULE_OBJECT with LDR_DATA_TABLE_ENTRY. - Export PsGetCurrentThread and PsGetCurrentProcess. Modified: trunk/reactos/ntoskrnl/include/internal/io.h Modified: trunk/reactos/ntoskrnl/include/internal/kd.h Modified: trunk/reactos/ntoskrnl/include/internal/ldr.h Deleted: trunk/reactos/ntoskrnl/include/internal/module.h Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h Modified: trunk/reactos/ntoskrnl/include/internal/tag.h Modified: trunk/reactos/ntoskrnl/io/driver.c Modified: trunk/reactos/ntoskrnl/io/iomgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c Modified: trunk/reactos/ntoskrnl/kd/kdio.c Modified: trunk/reactos/ntoskrnl/kd/wrappers/gdbstub.c Modified: trunk/reactos/ntoskrnl/kdbg/kdb_symbols.c Modified: trunk/reactos/ntoskrnl/ke/bug.c Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c Modified: trunk/reactos/ntoskrnl/ldr/loader.c Modified: trunk/reactos/ntoskrnl/mm/mm.c Modified: trunk/reactos/ntoskrnl/mm/pagefile.c Modified: trunk/reactos/ntoskrnl/ntoskrnl.def _____ Modified: trunk/reactos/ntoskrnl/include/internal/io.h --- trunk/reactos/ntoskrnl/include/internal/io.h 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/include/internal/io.h 2005-07-30 16:25:35 UTC (rev 16894) @@ -350,14 +350,14 @@ FASTCALL IopLoadServiceModule( IN PUNICODE_STRING ServiceName, - OUT PMODULE_OBJECT *ModuleObject + OUT PLDR_DATA_TABLE_ENTRY *ModuleObject ); NTSTATUS FASTCALL IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, - IN PMODULE_OBJECT ModuleObject, + IN PLDR_DATA_TABLE_ENTRY ModuleObject, IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject _____ Modified: trunk/reactos/ntoskrnl/include/internal/kd.h --- trunk/reactos/ntoskrnl/include/internal/kd.h 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/include/internal/kd.h 2005-07-30 16:25:35 UTC (rev 16894) @@ -17,19 +17,19 @@ VOID KdbSymLoadDriverSymbols( IN PUNICODE_STRING Filename, - IN PMODULE_OBJECT Module + IN PLDR_DATA_TABLE_ENTRY Module ); VOID -KdbSymUnloadDriverSymbols(IN PMODULE_OBJECT ModuleObject); +KdbSymUnloadDriverSymbols(IN PLDR_DATA_TABLE_ENTRY ModuleObject); VOID KdbSymProcessBootSymbols(IN PCHAR FileName); VOID KdbSymInit( - IN PMODULE_TEXT_SECTION NtoskrnlTextSection, - IN PMODULE_TEXT_SECTION LdrHalTextSection + IN PLDR_DATA_TABLE_ENTRY NtoskrnlTextSection, + IN PLDR_DATA_TABLE_ENTRY LdrHalTextSection ); BOOLEAN _____ Modified: trunk/reactos/ntoskrnl/include/internal/ldr.h --- trunk/reactos/ntoskrnl/include/internal/ldr.h 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/include/internal/ldr.h 2005-07-30 16:25:35 UTC (rev 16894) @@ -99,13 +99,13 @@ NTSTATUS LdrLoadModule( PUNICODE_STRING Filename, - PMODULE_OBJECT *ModuleObject + PLDR_DATA_TABLE_ENTRY *ModuleObject ); NTSTATUS -LdrUnloadModule(PMODULE_OBJECT ModuleObject); +LdrUnloadModule(PLDR_DATA_TABLE_ENTRY ModuleObject); -PMODULE_OBJECT +PLDR_DATA_TABLE_ENTRY LdrGetModuleObject(PUNICODE_STRING ModuleName); #endif /* __INCLUDE_INTERNAL_LDR_H */ _____ Deleted: trunk/reactos/ntoskrnl/include/internal/module.h --- trunk/reactos/ntoskrnl/include/internal/module.h 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/include/internal/module.h 2005-07-30 16:25:35 UTC (rev 16894) @@ -1,53 +0,0 @@ -#ifndef __MODULE_H -#define __MODULE_H - -typedef struct _MODULE_TEXT_SECTION -{ - ULONG Base; - ULONG Length; - LIST_ENTRY ListEntry; - PWCH Name; - PIMAGE_OPTIONAL_HEADER OptionalHeader; - PROSSYM_INFO RosSymInfo; -} MODULE_TEXT_SECTION, *PMODULE_TEXT_SECTION; - -typedef struct _MODULE_OBJECT -{ - CSHORT ObjectType; - CSHORT ObjectSize; - PVOID Base; - ULONG Length; - ULONG Flags; - PVOID EntryPoint; - LIST_ENTRY ListEntry; - UNICODE_STRING FullName; - UNICODE_STRING BaseName; - PMODULE_TEXT_SECTION TextSection; - union - { - struct - { - PIMAGE_FILE_HEADER FileHeader; - PIMAGE_OPTIONAL_HEADER OptionalHeader; - PIMAGE_SECTION_HEADER SectionList; - } PE; - } Image; -} MODULE_OBJECT, *PMODULE_OBJECT; - -typedef MODULE_OBJECT MODULE, *PMODULE; - -#define MODULE_FLAG_BIN 0x0001 -#define MODULE_FLAG_MZ 0x0002 -#define MODULE_FLAG_NE 0x0004 -#define MODULE_FLAG_PE 0x0008 -#define MODULE_FLAG_COFF 0x0010 - -typedef struct _INSTANCE -{ - HANDLE ModuleHandle; -} INSTANCE, *PINSTANCE; - -BOOLEAN process_boot_module(unsigned int start); - -#endif - _____ Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h --- trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h 2005-07-30 16:25:35 UTC (rev 16894) @@ -14,7 +14,6 @@ #include "ke.h" #include "i386/mm.h" #include "i386/fpu.h" -#include "module.h" #include "ob.h" #include "mm.h" #include "ps.h" _____ Modified: trunk/reactos/ntoskrnl/include/internal/tag.h --- trunk/reactos/ntoskrnl/include/internal/tag.h 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/include/internal/tag.h 2005-07-30 16:25:35 UTC (rev 16894) @@ -87,7 +87,6 @@ #define TAG_DRIVER_MEM TAG('D', 'R', 'V', 'M') /* drvm */ #define TAG_MODULE_OBJECT TAG('k', 'l', 'm', 'o') /* klmo - kernel ldr module object */ #define TAG_LDR_WSTR TAG('k', 'l', 'w', 's') /* klws - kernel ldr wide string */ -#define TAG_MODULE_TEXT_SECTION TAG('k', 'l', 'm', 't') /* klmt - kernel ldr module text */ /* formerly located in lpc/connect */ #define TAG_LPC_CONNECT_MESSAGE TAG('L', 'P', 'C', 'C') _____ Modified: trunk/reactos/ntoskrnl/io/driver.c --- trunk/reactos/ntoskrnl/io/driver.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/io/driver.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -23,7 +23,7 @@ NTSTATUS LdrProcessModule(PVOID ModuleLoadBase, PUNICODE_STRING ModuleName, - PMODULE_OBJECT *ModuleObject); + PLDR_DATA_TABLE_ENTRY *ModuleObject); typedef struct _SERVICE_GROUP { @@ -432,7 +432,7 @@ NTSTATUS FASTCALL IopLoadServiceModule( IN PUNICODE_STRING ServiceName, - OUT PMODULE_OBJECT *ModuleObject) + OUT PLDR_DATA_TABLE_ENTRY *ModuleObject) { RTL_QUERY_REGISTRY_TABLE QueryTable[3]; ULONG ServiceStart; @@ -591,7 +591,7 @@ NTSTATUS FASTCALL IopInitializeDriverModule( IN PDEVICE_NODE DeviceNode, - IN PMODULE_OBJECT ModuleObject, + IN PLDR_DATA_TABLE_ENTRY ModuleObject, IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject) @@ -625,8 +625,8 @@ ServiceName, 0, FileSystemDriver, - ModuleObject->Base, - ModuleObject->Length); + ModuleObject->DllBase, + ModuleObject->SizeOfImage); if (!NT_SUCCESS(Status)) { @@ -673,7 +673,7 @@ PDEVICE_NODE DeviceNode = Context; UNICODE_STRING ServiceName; PWCHAR Filters; - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; PDRIVER_OBJECT DriverObject; NTSTATUS Status; @@ -1187,7 +1187,7 @@ PCHAR FileName, ULONG ModuleLength) { - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; PDEVICE_NODE DeviceNode; PDRIVER_OBJECT DriverObject; NTSTATUS Status; @@ -1519,7 +1519,7 @@ UNICODE_STRING ServiceName; UNICODE_STRING ObjectName; PDRIVER_OBJECT DriverObject; - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; NTSTATUS Status; LPWSTR Start; @@ -1857,7 +1857,7 @@ NTSTATUS Status; ULONG Type; PDEVICE_NODE DeviceNode; - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; PDRIVER_OBJECT DriverObject; WCHAR *cur; _____ Modified: trunk/reactos/ntoskrnl/io/iomgr.c --- trunk/reactos/ntoskrnl/io/iomgr.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/io/iomgr.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -321,7 +321,7 @@ { PDEVICE_NODE DeviceNode; PDRIVER_OBJECT DriverObject; - MODULE_OBJECT ModuleObject; + LDR_DATA_TABLE_ENTRY ModuleObject; NTSTATUS Status; PnpInit2(); @@ -342,8 +342,8 @@ return; } - ModuleObject.Base = NULL; - ModuleObject.Length = 0; + ModuleObject.DllBase = NULL; + ModuleObject.SizeOfImage = 0; ModuleObject.EntryPoint = RawFsDriverEntry; Status = IopInitializeDriverModule( _____ Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c --- trunk/reactos/ntoskrnl/io/pnpmgr.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/io/pnpmgr.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -1702,7 +1702,7 @@ !IopDeviceNodeHasFlag(DeviceNode, DNF_ADDED) && !IopDeviceNodeHasFlag(DeviceNode, DNF_STARTED)) { - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; PDRIVER_OBJECT DriverObject; Status = IopLoadServiceModule(&DeviceNode->ServiceName, &ModuleObject); _____ Modified: trunk/reactos/ntoskrnl/kd/kdio.c --- trunk/reactos/ntoskrnl/kd/kdio.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/kd/kdio.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -89,12 +89,13 @@ KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase) { - if (!KdpDebugMode.File) return; NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING FileName; IO_STATUS_BLOCK Iosb; + if (!KdpDebugMode.File) return; + if (BootPhase == 0) { /* Write out the functions that we support for now */ _____ Modified: trunk/reactos/ntoskrnl/kd/wrappers/gdbstub.c --- trunk/reactos/ntoskrnl/kd/wrappers/gdbstub.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/kd/wrappers/gdbstub.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -1458,7 +1458,7 @@ KdGdbListModules() { PLIST_ENTRY CurrentEntry; - PMODULE_OBJECT Current; + PLDR_DATA_TABLE_ENTRY Current; ULONG ModuleCount; DPRINT1("\n"); @@ -1468,10 +1468,10 @@ CurrentEntry = ModuleListHead.Flink; while (CurrentEntry != (&ModuleListHead)) { - Current = CONTAINING_RECORD (CurrentEntry, MODULE_OBJECT, ListEntry); + Current = CONTAINING_RECORD (CurrentEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); - DbgPrint ("Module %S Base 0x%.08x Length 0x%.08x\n", - Current->BaseName.Buffer, Current->Base, Current->Length); + DbgPrint ("Module %wZ Base 0x%.08x Length 0x%.08x\n", + &Current->BaseDllName, Current->DllBase, Current->SizeOfImage); ModuleCount++; CurrentEntry = CurrentEntry->Flink; _____ Modified: trunk/reactos/ntoskrnl/kdbg/kdb_symbols.c --- trunk/reactos/ntoskrnl/kdbg/kdb_symbols.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/kdbg/kdb_symbols.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -108,26 +108,27 @@ OUT PKDB_MODULE_INFO pInfo) { PLIST_ENTRY current_entry; - MODULE_TEXT_SECTION* current; - extern LIST_ENTRY ModuleTextListHead; + PLDR_DATA_TABLE_ENTRY current; + extern LIST_ENTRY ModuleListHead; INT Count = 0; - current_entry = ModuleTextListHead.Flink; + current_entry = ModuleListHead.Flink; - while (current_entry != &ModuleTextListHead && - current_entry != NULL) + while (current_entry != &ModuleListHead) { - current = CONTAINING_RECORD(current_entry, MODULE_TEXT_SECTION, ListEntry); + current = CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); - if ((Address != NULL && (Address >= (PVOID)current->Base && - Address < (PVOID)(current->Base + current->Length))) || - (Name != NULL && _wcsicmp(current->Name, Name) == 0) || + if ((Address != NULL && (Address >= (PVOID)current->DllBase && + Address < (PVOID)((ULONG_PTR)current->DllBase + current->SizeOfImage))) || + (Name != NULL && _wcsnicmp(current->BaseDllName.Buffer, Name, + current->BaseDllName.Length / sizeof(WCHAR)) == 0) || (Index >= 0 && Count++ == Index)) { - wcsncpy(pInfo->Name, current->Name, 255); + wcsncpy(pInfo->Name, current->BaseDllName.Buffer, + min(255, current->BaseDllName.Length / sizeof(WCHAR))); pInfo->Name[255] = L'\0'; - pInfo->Base = (ULONG_PTR)current->Base; - pInfo->Size = current->Length; + pInfo->Base = (ULONG_PTR)current->DllBase; + pInfo->Size = current->SizeOfImage; pInfo->RosSymInfo = current->RosSymInfo; return TRUE; } @@ -553,30 +554,30 @@ /*! \brief Load symbol info for a driver. * * \param Filename Filename of the driver. - * \param Module Pointer to the driver MODULE_OBJECT. + * \param Module Pointer to the driver LDR_DATA_TABLE_ENTRY. */ VOID KdbSymLoadDriverSymbols(IN PUNICODE_STRING Filename, - IN PMODULE_OBJECT Module) + IN PLDR_DATA_TABLE_ENTRY Module) { /* Load symbols for the image if available */ DPRINT("Loading driver %wZ symbols (driver @ %08x)\n", Filename, Module->Base); - Module->TextSection->RosSymInfo = NULL; + Module->RosSymInfo = NULL; - KdbpSymLoadModuleSymbols(Filename, &Module->TextSection->RosSymInfo); + KdbpSymLoadModuleSymbols(Filename, (PROSSYM_INFO*)&Module->RosSymInfo); } /*! \brief Unloads symbol info for a driver. * - * \param ModuleObject Pointer to the driver MODULE_OBJECT. + * \param ModuleObject Pointer to the driver LDR_DATA_TABLE_ENTRY. */ VOID -KdbSymUnloadDriverSymbols(IN PMODULE_OBJECT ModuleObject) +KdbSymUnloadDriverSymbols(IN PLDR_DATA_TABLE_ENTRY ModuleObject) { /* Unload symbols for module if available */ - KdbpSymUnloadModuleSymbols(ModuleObject->TextSection->RosSymInfo); - ModuleObject->TextSection->RosSymInfo = NULL; + KdbpSymUnloadModuleSymbols(ModuleObject->RosSymInfo); + ModuleObject->RosSymInfo = NULL; } /*! \brief Called when a symbol file is loaded by the loader? @@ -591,7 +592,7 @@ VOID KdbSymProcessBootSymbols(IN PCHAR FileName) { - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; UNICODE_STRING UnicodeString; PLOADER_MODULE KeLoaderModules = (PLOADER_MODULE)KeLoaderBlock.ModsAddr; ANSI_STRING AnsiString; @@ -618,7 +619,7 @@ { if (! LoadSymbols) { - ModuleObject->TextSection->RosSymInfo = NULL; + ModuleObject->RosSymInfo = NULL; return; } @@ -632,16 +633,16 @@ if (i < KeLoaderBlock.ModsCount) { KeLoaderModules[i].Reserved = 1; - if (ModuleObject->TextSection->RosSymInfo != NULL) + if (ModuleObject->RosSymInfo != NULL) { - KdbpSymRemoveCachedFile(ModuleObject->TextSection->RosSymInfo); + KdbpSymRemoveCachedFile(ModuleObject->RosSymInfo); } if (IsRaw) { if (! RosSymCreateFromRaw((PVOID) KeLoaderModules[i].ModStart, KeLoaderModules[i].ModEnd - KeLoaderModules[i].ModStart, - &ModuleObject->TextSection->RosSymInfo)) + (PROSSYM_INFO*)&ModuleObject->RosSymInfo)) { return; } @@ -650,7 +651,7 @@ { if (! RosSymCreateFromMem((PVOID) KeLoaderModules[i].ModStart, KeLoaderModules[i].ModEnd - KeLoaderModules[i].ModStart, - &ModuleObject->TextSection->RosSymInfo)) + (PROSSYM_INFO*)&ModuleObject->RosSymInfo)) { return; } @@ -659,33 +660,33 @@ /* add file to cache */ RtlInitAnsiString(&AnsiString, FileName); RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, TRUE); - KdbpSymAddCachedFile(&UnicodeString, ModuleObject->TextSection->RosSymInfo); + KdbpSymAddCachedFile(&UnicodeString, ModuleObject->RosSymInfo); RtlFreeUnicodeString(&UnicodeString); DPRINT("Installed symbols: %s@%08x-%08x %p\n", FileName, - ModuleObject->Base, - ModuleObject->Length + ModuleObject->Base, - ModuleObject->TextSection->RosSymInfo); + ModuleObject->DllBase, + ModuleObject->SizeOfImage + ModuleObject->DllBase, + ModuleObject->RosSymInfo); } } } /*! \brief Initializes the KDB symbols implementation. * - * \param NtoskrnlTextSection MODULE_TEXT_SECTION of ntoskrnl.exe - * \param LdrHalTextSection MODULE_TEXT_SECTION of hal.sys + * \param NtoskrnlModuleObject LDR_DATA_TABLE_ENTRY of ntoskrnl.exe + * \param LdrHalModuleObject LDR_DATA_TABLE_ENTRY of hal.sys */ VOID -KdbSymInit(IN PMODULE_TEXT_SECTION NtoskrnlTextSection, - IN PMODULE_TEXT_SECTION LdrHalTextSection) +KdbSymInit(IN PLDR_DATA_TABLE_ENTRY NtoskrnlModuleObject, + IN PLDR_DATA_TABLE_ENTRY LdrHalModuleObject) { PCHAR p1, p2; int Found; char YesNo; - NtoskrnlTextSection->RosSymInfo = NULL; - LdrHalTextSection->RosSymInfo = NULL; + NtoskrnlModuleObject->RosSymInfo = NULL; + LdrHalModuleObject->RosSymInfo = NULL; InitializeListHead(&SymbolFileListHead); KeInitializeSpinLock(&SymbolFileListLock); _____ Modified: trunk/reactos/ntoskrnl/ke/bug.c --- trunk/reactos/ntoskrnl/ke/bug.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/ke/bug.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -297,8 +297,8 @@ BOOLEAN GotExtendedCrashInfo = FALSE; PVOID Address = 0; PLIST_ENTRY CurrentEntry; - MODULE_TEXT_SECTION* CurrentSection = NULL; - extern LIST_ENTRY ModuleTextListHead; + PLDR_DATA_TABLE_ENTRY CurrentModule = NULL; + extern LIST_ENTRY ModuleListHead; #if 0 CHAR PrintString[100]; #endif @@ -321,17 +321,17 @@ Address = (PVOID)Tf->Eip; /* Try to get information on the module */ - CurrentEntry = ModuleTextListHead.Flink; - while (CurrentEntry != &ModuleTextListHead && CurrentEntry) + CurrentEntry = ModuleListHead.Flink; + while (CurrentEntry != &ModuleListHead) { /* Get the current Section */ - CurrentSection = CONTAINING_RECORD(CurrentEntry, - MODULE_TEXT_SECTION, - ListEntry); + CurrentModule = CONTAINING_RECORD(CurrentEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderModuleList); /* Check if this is the right one */ - if ((Address != NULL && (Address >= (PVOID)CurrentSection->Base && - Address < (PVOID)(CurrentSection->Base + CurrentSection->Length)))) + if ((Address != NULL && (Address >= (PVOID)CurrentModule->DllBase && + Address < (PVOID)((ULONG_PTR)CurrentModule->DllBase + CurrentModule->SizeOfImage)))) { /* We got it */ GotExtendedCrashInfo = TRUE; @@ -366,12 +366,12 @@ { #if 0 sprintf(PrintString, - "The problem seems to be caused by the following file: %S\n\n", - CurrentSection->Name); + "The problem seems to be caused by the following file: %wZ\n\n", + &CurrentModule->BaseDllName); InbvDisplayString(PrintString); #else - DbgPrint("The problem seems to be caused by the following file: %S\n\n", - CurrentSection->Name); + DbgPrint("The problem seems to be caused by the following file: %wZ\n\n", + &CurrentModule->BaseDllName); #endif } @@ -401,17 +401,17 @@ { #if 0 sprintf(PrintString, - "*** %S - Address 0x%p base at 0x%p, DateStamp 0x%x\n\n", - CurrentSection->Name, + "*** %wZ - Address 0x%p base at 0x%p, DateStamp 0x%x\n\n", + &CurrentModule->BaseDllName, Address, - (PVOID)CurrentSection->Base, + (PVOID)CurrentModule->DllBase, 0); InbvDisplayString(PrintString); #else - DbgPrint("*** %S - Address 0x%p base at 0x%p, DateStamp 0x%x\n\n", - CurrentSection->Name, + DbgPrint("*** %wZ - Address 0x%p base at 0x%p, DateStamp 0x%x\n\n", + &CurrentModule->BaseDllName, Address, - (PVOID)CurrentSection->Base, + (PVOID)CurrentModule->DllBase, 0); #endif } _____ Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c --- trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -110,26 +110,25 @@ KiRosPrintAddress(PVOID address) { PLIST_ENTRY current_entry; - MODULE_TEXT_SECTION* current; - extern LIST_ENTRY ModuleTextListHead; + PLDR_DATA_TABLE_ENTRY current; + extern LIST_ENTRY ModuleListHead; ULONG_PTR RelativeAddress; ULONG i = 0; do { - current_entry = ModuleTextListHead.Flink; + current_entry = ModuleListHead.Flink; - while (current_entry != &ModuleTextListHead && - current_entry != NULL) + while (current_entry != &ModuleListHead) { current = - CONTAINING_RECORD(current_entry, MODULE_TEXT_SECTION, ListEntry); + CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); - if (address >= (PVOID)current->Base && - address < (PVOID)(current->Base + current->Length)) + if (address >= (PVOID)current->DllBase && + address < (PVOID)((ULONG_PTR)current->DllBase + current->SizeOfImage)) { - RelativeAddress = (ULONG_PTR) address - current->Base; - DbgPrint("<%ws: %x>", current->Name, RelativeAddress); + RelativeAddress = (ULONG_PTR) address - (ULONG_PTR) current->DllBase; + DbgPrint("<%wZ: %x>", ¤t->FullDllName, RelativeAddress); return(TRUE); } current_entry = current_entry->Flink; _____ Modified: trunk/reactos/ntoskrnl/ldr/loader.c --- trunk/reactos/ntoskrnl/ldr/loader.c 2005-07-30 13:49:41 UTC (rev 16893) +++ trunk/reactos/ntoskrnl/ldr/loader.c 2005-07-30 16:25:35 UTC (rev 16894) @@ -38,12 +38,9 @@ LIST_ENTRY ModuleListHead; KSPIN_LOCK ModuleListLock; -MODULE_OBJECT NtoskrnlModuleObject; -MODULE_OBJECT HalModuleObject; +LDR_DATA_TABLE_ENTRY NtoskrnlModuleObject; +LDR_DATA_TABLE_ENTRY HalModuleObject; -LIST_ENTRY ModuleTextListHead; -STATIC MODULE_TEXT_SECTION NtoskrnlTextSection; -STATIC MODULE_TEXT_SECTION LdrHalTextSection; ULONG_PTR LdrHalBase; /* FORWARD DECLARATIONS ******************************************************/ @@ -52,7 +49,7 @@ LdrProcessModule ( PVOID ModuleLoadBase, PUNICODE_STRING ModuleName, - PMODULE_OBJECT *ModuleObject ); + PLDR_DATA_TABLE_ENTRY *ModuleObject ); static VOID LdrpBuildModuleBaseName ( @@ -70,7 +67,7 @@ LdrPEProcessModule ( PVOID ModuleLoadBase, PUNICODE_STRING FileName, - PMODULE_OBJECT *ModuleObject ); + PLDR_DATA_TABLE_ENTRY *ModuleObject ); static PVOID LdrPEGetExportByName ( @@ -87,72 +84,20 @@ ULONG DriverSize ); static NTSTATUS -LdrPEFixupImports ( PMODULE_OBJECT Module ); +LdrPEFixupImports ( PLDR_DATA_TABLE_ENTRY Module ); /* FUNCTIONS *****************************************************************/ VOID LdrInitDebug ( PLOADER_MODULE Module, PWCH Name ) { - PLIST_ENTRY current_entry; - MODULE_TEXT_SECTION* current; - - current_entry = ModuleTextListHead.Flink; - while (current_entry != &ModuleTextListHead) - { - current = - CONTAINING_RECORD(current_entry, MODULE_TEXT_SECTION, ListEntry); - if (wcscmp(current->Name, Name) == 0) - { - break; - } - current_entry = current_entry->Flink; - } - - if (current_entry == &ModuleTextListHead) - { - return; - } } VOID INIT_FUNCTION LdrInit1 ( VOID ) { - PIMAGE_NT_HEADERS NtHeader; - PIMAGE_SECTION_HEADER SectionList; - - InitializeListHead(&ModuleTextListHead); - - /* Setup ntoskrnl.exe text section */ - /* - * This isn't the base of the text segment, but the start of the - * full image (in memory) - * Also, the Length field isn't set to the length of the segment, - * but is more like the offset, from the image base, to the end - * of the segment. - */ - NtHeader = RtlImageNtHeader((PVOID)KERNEL_BASE); - SectionList = IMAGE_FIRST_SECTION(NtHeader); - NtoskrnlTextSection.Base = KERNEL_BASE; - NtoskrnlTextSection.Length = SectionList[0].Misc.VirtualSize - + SectionList[0].VirtualAddress; - NtoskrnlTextSection.Name = KERNEL_MODULE_NAME; - NtoskrnlTextSection.OptionalHeader = OPTHDROFFSET(KERNEL_BASE); - InsertTailList(&ModuleTextListHead, &NtoskrnlTextSection.ListEntry); - - /* Setup hal.dll text section */ - /* Same comment as above applies */ - NtHeader = RtlImageNtHeader((PVOID)LdrHalBase); - SectionList = IMAGE_FIRST_SECTION(NtHeader); - LdrHalTextSection.Base = LdrHalBase; - LdrHalTextSection.Length = SectionList[0].Misc.VirtualSize - + SectionList[0].VirtualAddress; - LdrHalTextSection.Name = HAL_MODULE_NAME; - LdrHalTextSection.OptionalHeader = OPTHDROFFSET(LdrHalBase); - InsertTailList(&ModuleTextListHead, &LdrHalTextSection.ListEntry); - /* Hook for KDB on initialization of the loader. */ - KDB_LOADERINIT_HOOK(&NtoskrnlTextSection, &LdrHalTextSection); + KDB_LOADERINIT_HOOK(&NtoskrnlModuleObject, &HalModuleObject); } VOID INIT_FUNCTION @@ -165,43 +110,31 @@ KeInitializeSpinLock(&ModuleListLock); /* Initialize ModuleObject for NTOSKRNL */ - RtlZeroMemory(&NtoskrnlModuleObject, sizeof(MODULE_OBJECT)); - NtoskrnlModuleObject.Base = (PVOID) KERNEL_BASE; - NtoskrnlModuleObject.Flags = MODULE_FLAG_PE; - RtlInitUnicodeString(&NtoskrnlModuleObject.FullName, KERNEL_MODULE_NAME); - LdrpBuildModuleBaseName(&NtoskrnlModuleObject.BaseName, &NtoskrnlModuleObject.FullName); + RtlZeroMemory(&NtoskrnlModuleObject, sizeof(LDR_DATA_TABLE_ENTRY)); + NtoskrnlModuleObject.DllBase = (PVOID) KERNEL_BASE; + RtlInitUnicodeString(&NtoskrnlModuleObject.FullDllName, KERNEL_MODULE_NAME); + LdrpBuildModuleBaseName(&NtoskrnlModuleObject.BaseDllName, &NtoskrnlModuleObject.FullDllName); NtHeader = RtlImageNtHeader((PVOID)KERNEL_BASE); - NtoskrnlModuleObject.Image.PE.FileHeader = &NtHeader->FileHeader; - NtoskrnlModuleObject.Image.PE.OptionalHeader = &NtHeader->OptionalHeader; - NtoskrnlModuleObject.Image.PE.SectionList = IMAGE_FIRST_SECTION(NtHeader); - NtoskrnlModuleObject.EntryPoint = (PVOID) ((ULONG_PTR) NtoskrnlModuleObject.Base + NtHeader->OptionalHeader.AddressOfEntryPoint); + NtoskrnlModuleObject.EntryPoint = (PVOID) ((ULONG_PTR) NtoskrnlModuleObject.DllBase + NtHeader->OptionalHeader.AddressOfEntryPoint); DPRINT("ModuleObject:%08x entrypoint at %x\n", &NtoskrnlModuleObject, NtoskrnlModuleObject.EntryPoint); - NtoskrnlModuleObject.Length = NtoskrnlModuleObject.Image.PE.OptionalHeader->SizeOfImage; - NtoskrnlModuleObject.TextSection = &NtoskrnlTextSection; + NtoskrnlModuleObject.SizeOfImage = NtHeader->OptionalHeader.SizeOfImage; - InsertTailList(&ModuleListHead, - &NtoskrnlModuleObject.ListEntry); + InsertTailList(&ModuleListHead, &NtoskrnlModuleObject.InLoadOrderModuleList); /* Initialize ModuleObject for HAL */ - RtlZeroMemory(&HalModuleObject, sizeof(MODULE_OBJECT)); - HalModuleObject.Base = (PVOID) LdrHalBase; - HalModuleObject.Flags = MODULE_FLAG_PE; + RtlZeroMemory(&HalModuleObject, sizeof(LDR_DATA_TABLE_ENTRY)); + HalModuleObject.DllBase = (PVOID) LdrHalBase; - RtlInitUnicodeString(&HalModuleObject.FullName, HAL_MODULE_NAME); - LdrpBuildModuleBaseName(&HalModuleObject.BaseName, &HalModuleObject.FullName); + RtlInitUnicodeString(&HalModuleObject.FullDllName, HAL_MODULE_NAME); + LdrpBuildModuleBaseName(&HalModuleObject.BaseDllName, &HalModuleObject.FullDllName); NtHeader = RtlImageNtHeader((PVOID)LdrHalBase); - HalModuleObject.Image.PE.FileHeader = &NtHeader->FileHeader; - HalModuleObject.Image.PE.OptionalHeader = &NtHeader->OptionalHeader; - HalModuleObject.Image.PE.SectionList = IMAGE_FIRST_SECTION(NtHeader); - HalModuleObject.EntryPoint = (PVOID) ((ULONG_PTR) HalModuleObject.Base + NtHeader->OptionalHeader.AddressOfEntryPoint); + HalModuleObject.EntryPoint = (PVOID) ((ULONG_PTR) HalModuleObject.DllBase + NtHeader->OptionalHeader.AddressOfEntryPoint); DPRINT("ModuleObject:%08x entrypoint at %x\n", &HalModuleObject, HalModuleObject.EntryPoint); - HalModuleObject.Length = HalModuleObject.Image.PE.OptionalHeader->SizeOfImage; - HalModuleObject.TextSection = &LdrHalTextSection; + HalModuleObject.SizeOfImage = NtHeader->OptionalHeader.SizeOfImage; - InsertTailList(&ModuleListHead, - &HalModuleObject.ListEntry); + InsertTailList(&ModuleListHead, &HalModuleObject.InLoadOrderModuleList); } NTSTATUS @@ -212,7 +145,7 @@ PVOID *EntryPoint, PVOID *ExportSectionPointer ) { - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; NTSTATUS Status; ModuleObject = LdrGetModuleObject(DriverName); @@ -226,7 +159,7 @@ } if (ModuleBase) - *ModuleBase = ModuleObject->Base; + *ModuleBase = ModuleObject->DllBase; //if (SectionPointer) // *SectionPointer = ModuleObject-> @@ -252,7 +185,8 @@ LdrpLoadAndCallImage ( PUNICODE_STRING ModuleName ) { PDRIVER_INITIALIZE DriverEntry; - PMODULE_OBJECT ModuleObject; + PLDR_DATA_TABLE_ENTRY ModuleObject; + DRIVER_OBJECT DriverObject; NTSTATUS Status; ModuleObject = LdrGetModuleObject(ModuleName); @@ -269,7 +203,10 @@ DriverEntry = (PDRIVER_INITIALIZE)ModuleObject->EntryPoint; - Status = DriverEntry(NULL, NULL); + RtlZeroMemory(&DriverObject, sizeof(DriverObject)); + DriverObject.DriverStart = ModuleObject->DllBase; + + Status = DriverEntry(&DriverObject, NULL); if (!NT_SUCCESS(Status)) { LdrUnloadModule(ModuleObject); @@ -282,13 +219,13 @@ NTSTATUS LdrLoadModule( PUNICODE_STRING Filename, - PMODULE_OBJECT *ModuleObject ) + PLDR_DATA_TABLE_ENTRY *ModuleObject ) { PVOID ModuleLoadBase; NTSTATUS Status; HANDLE FileHandle; OBJECT_ATTRIBUTES ObjectAttributes; - PMODULE_OBJECT Module; + PLDR_DATA_TABLE_ENTRY Module; FILE_STANDARD_INFORMATION FileStdInfo; IO_STATUS_BLOCK IoStatusBlock; @@ -384,31 +321,22 @@ NTSTATUS -LdrUnloadModule ( PMODULE_OBJECT ModuleObject ) +LdrUnloadModule ( PLDR_DATA_TABLE_ENTRY ModuleObject ) { KIRQL Irql; /* Remove the module from the module list */ KeAcquireSpinLock(&ModuleListLock,&Irql); - RemoveEntryList(&ModuleObject->ListEntry); + RemoveEntryList(&ModuleObject->InLoadOrderModuleList); KeReleaseSpinLock(&ModuleListLock, Irql); /* Hook for KDB on unloading a driver. */ KDB_UNLOADDRIVER_HOOK(ModuleObject); - /* Free text section */ - if (ModuleObject->TextSection != NULL) - { - ExFreePool(ModuleObject->TextSection->Name); - RemoveEntryList(&ModuleObject->TextSection->ListEntry); - ExFreePool(ModuleObject->TextSection); - ModuleObject->TextSection = NULL; - } - /* Free module section */ - // MmFreeSection(ModuleObject->Base); + // MmFreeSection(ModuleObject->DllBase); - ExFreePool(ModuleObject->FullName.Buffer); + ExFreePool(ModuleObject->FullDllName.Buffer); ExFreePool(ModuleObject); return(STATUS_SUCCESS); @@ -419,7 +347,7 @@ LdrProcessModule( PVOID ModuleLoadBase, PUNICODE_STRING ModuleName, - PMODULE_OBJECT *ModuleObject ) + PLDR_DATA_TABLE_ENTRY *ModuleObject ) { PIMAGE_DOS_HEADER PEDosHeader; @@ -443,7 +371,7 @@ PULONG ReqSize ) { PLIST_ENTRY current_entry; - PMODULE_OBJECT current; + PLDR_DATA_TABLE_ENTRY current; ULONG ModuleCount = 0; PSYSTEM_MODULE_INFORMATION Smi; ANSI_STRING AnsiName; @@ -479,12 +407,12 @@ current_entry = ModuleListHead.Flink; while (current_entry != (&ModuleListHead)) { - current = CONTAINING_RECORD(current_entry,MODULE_OBJECT,ListEntry); + current = CONTAINING_RECORD(current_entry,LDR_DATA_TABLE_ENTRY,InLoadOrderModuleLi st); Smi->Module[ModuleCount].Unknown1 = 0; /* Always 0 */ Smi->Module[ModuleCount].Unknown2 = 0; /* Always 0 */ - Smi->Module[ModuleCount].Base = current->Base; - Smi->Module[ModuleCount].Size = current->Length; + Smi->Module[ModuleCount].Base = current->DllBase; + Smi->Module[ModuleCount].Size = current->SizeOfImage; Smi->Module[ModuleCount].Flags = 0; /* Flags ??? (GN) */ Smi->Module[ModuleCount].Index = (USHORT)ModuleCount; Smi->Module[ModuleCount].NameLength = 0; @@ -494,7 +422,7 @@ AnsiName.MaximumLength = 256; AnsiName.Buffer = Smi->Module[ModuleCount].ImageName; RtlUnicodeStringToAnsiString(&AnsiName, - ¤t->FullName, + ¤t->FullDllName, FALSE); p = strrchr(AnsiName.Buffer, '\\'); @@ -613,10 +541,10 @@ return(0); } -PMODULE_OBJECT +PLDR_DATA_TABLE_ENTRY LdrGetModuleObject ( PUNICODE_STRING ModuleName ) { - PMODULE_OBJECT Module; + PLDR_DATA_TABLE_ENTRY Module; PLIST_ENTRY Entry; KIRQL Irql; @@ -627,15 +555,15 @@ Entry = ModuleListHead.Flink; while (Entry != &ModuleListHead) { - Module = CONTAINING_RECORD(Entry, MODULE_OBJECT, ListEntry); + Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); DPRINT("Comparing %wZ and %wZ\n", &Module->BaseName, ModuleName); - if (!LdrpCompareModuleNames(&Module->BaseName, ModuleName)) + if (!LdrpCompareModuleNames(&Module->BaseDllName, ModuleName)) { - DPRINT("Module %wZ\n", &Module->BaseName); + DPRINT("Module %wZ\n", &Module->BaseDllName); KeReleaseSpinLock(&ModuleListLock, Irql); return(Module); } @@ -710,7 +638,7 @@ LdrPEProcessModule( PVOID ModuleLoadBase, PUNICODE_STRING FileName, - PMODULE_OBJECT *ModuleObject ) + PLDR_DATA_TABLE_ENTRY *ModuleObject ) { unsigned int DriverSize, Idx; DWORD CurrentSize; @@ -718,8 +646,7 @@ PIMAGE_DOS_HEADER PEDosHeader; PIMAGE_NT_HEADERS PENtHeaders; PIMAGE_SECTION_HEADER PESectionHeaders; - PMODULE_OBJECT CreatedModuleObject; - MODULE_TEXT_SECTION* ModuleTextSection; + PLDR_DATA_TABLE_ENTRY CreatedModuleObject; NTSTATUS Status; KIRQL Irql; @@ -817,59 +744,45 @@ /* Create the module */ CreatedModuleObject = ExAllocatePoolWithTag ( - NonPagedPool, sizeof(MODULE_OBJECT), TAG_MODULE_OBJECT ); + NonPagedPool, sizeof(LDR_DATA_TABLE_ENTRY), TAG_MODULE_OBJECT ); if (CreatedModuleObject == NULL) { // MmFreeSection(DriverBase); return STATUS_INSUFFICIENT_RESOURCES; } - RtlZeroMemory(CreatedModuleObject, sizeof(MODULE_OBJECT)); + RtlZeroMemory(CreatedModuleObject, sizeof(LDR_DATA_TABLE_ENTRY)); /* Initialize ModuleObject data */ - CreatedModuleObject->Base = DriverBase; - CreatedModuleObject->Flags = MODULE_FLAG_PE; + CreatedModuleObject->DllBase = DriverBase; - CreatedModuleObject->FullName.Length = 0; - CreatedModuleObject->FullName.MaximumLength = FileName->Length + sizeof(UNICODE_NULL); - CreatedModuleObject->FullName.Buffer = - ExAllocatePoolWithTag(PagedPool, CreatedModuleObject->FullName.MaximumLength, TAG_LDR_WSTR); - if (CreatedModuleObject->FullName.Buffer == NULL) + CreatedModuleObject->FullDllName.Length = 0; + CreatedModuleObject->FullDllName.MaximumLength = FileName->Length + sizeof(UNICODE_NULL); + CreatedModuleObject->FullDllName.Buffer = + ExAllocatePoolWithTag(PagedPool, CreatedModuleObject->FullDllName.MaximumLength, TAG_LDR_WSTR); + if (CreatedModuleObject->FullDllName.Buffer == NULL) { ExFreePool(CreatedModuleObject); // MmFreeSection(DriverBase); return STATUS_INSUFFICIENT_RESOURCES; } [truncated at 1000 lines; 281 more skipped]
19 years, 5 months
1
0
0
0
[hbirr] 16893: Reverted back to 16420, because it contains too many bugs.
by hbirr@svn.reactos.com
Reverted back to 16420, because it contains too many bugs. Modified: trunk/reactos/lib/kernel32/file/find.c _____ Modified: trunk/reactos/lib/kernel32/file/find.c --- trunk/reactos/lib/kernel32/file/find.c 2005-07-30 13:44:07 UTC (rev 16892) +++ trunk/reactos/lib/kernel32/file/find.c 2005-07-30 13:49:41 UTC (rev 16893) @@ -4,11 +4,9 @@ * PROJECT: ReactOS system libraries * FILE: lib/kernel32/file/find.c * PURPOSE: Find functions - * PROGRAMMERS: Ariadne ( ariadne(a)xs4all.nl) - Dmitry Philippov ( shedon(a)mail.ru ) + * PROGRAMMER: Ariadne ( ariadne(a)xs4all.nl) * UPDATE HISTORY: * Created 01/11/98 - * DP (18/06/2005) remove InternalFindFirstFile, implemented FindFirstFileExW */ /* INCLUDES *****************************************************************/ @@ -82,278 +80,21 @@ return TRUE; } -/* - * @implemented - */ -BOOL -STDCALL -FindNextFileA ( - HANDLE hFindFile, - LPWIN32_FIND_DATAA lpFindFileData) -{ - PKERNEL32_FIND_FILE_DATA IData; - UNICODE_STRING FileNameU; - ANSI_STRING FileName; - if (hFindFile == INVALID_HANDLE_VALUE) - { - SetLastError (ERROR_INVALID_HANDLE); - DPRINT("Failing request\n"); - return FALSE; - } - - IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; - if (!InternalFindNextFile (hFindFile)) - { - DPRINT("InternalFindNextFile() failed\n"); - return FALSE; - } - - DPRINT("IData->pFileInfo->FileNameLength %d\n", - IData->pFileInfo->FileNameLength); - - /* copy data into WIN32_FIND_DATA structure */ - lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes; - - lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; - lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; - - lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; - lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; - - lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; - lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; - - lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; - lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; - - FileNameU.Length = IData->pFileInfo->FileNameLength; - FileNameU.MaximumLength = FileNameU.Length + sizeof(WCHAR); - FileNameU.Buffer = IData->pFileInfo->FileName; - - FileName.Length = 0; - FileName.MaximumLength = MAX_PATH; - FileName.Buffer = lpFindFileData->cFileName; - - /* convert unicode string to ansi (or oem) */ - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString (&FileName, - &FileNameU, - FALSE); - else - RtlUnicodeStringToOemString (&FileName, - &FileNameU, - FALSE); - - DPRINT("IData->pFileInfo->ShortNameLength %d\n", - IData->pFileInfo->ShortNameLength); - - FileNameU.Length = IData->pFileInfo->ShortNameLength; - FileNameU.MaximumLength = FileNameU.Length + sizeof(WCHAR); - FileNameU.Buffer = IData->pFileInfo->ShortName; - - FileName.Length = 0; - FileName.MaximumLength = 14; - FileName.Buffer = lpFindFileData->cAlternateFileName; - - /* convert unicode string to ansi (or oem) */ - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString (&FileName, - &FileNameU, - FALSE); - else - RtlUnicodeStringToOemString (&FileName, - &FileNameU, - FALSE); - - return TRUE; -} - - /* * @implemented */ -BOOL -STDCALL -FindClose ( - HANDLE hFindFile - ) -{ - PKERNEL32_FIND_FILE_DATA IData; - - DPRINT("FindClose(hFindFile %x)\n",hFindFile); - - if (!hFindFile || hFindFile == INVALID_HANDLE_VALUE) - { - SetLastError (ERROR_INVALID_HANDLE); - return FALSE; - } - - IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; - - CloseHandle (IData->DirectoryHandle); - RtlFreeHeap (hProcessHeap, 0, IData); - - return TRUE; -} - -/* - * @implemented - */ HANDLE STDCALL -FindFirstFileA ( - LPCSTR lpFileName, - LPWIN32_FIND_DATAA lpFindFileData +InternalFindFirstFile ( + LPCWSTR lpFileName ) { - PKERNEL32_FIND_FILE_DATA IData; - UNICODE_STRING FileNameU; - ANSI_STRING FileName; - WIN32_FIND_DATAW FindFileData; - - RtlInitAnsiString (&FileName, - (LPSTR)lpFileName); - - /* convert ansi (or oem) string to unicode */ - if (bIsFileApiAnsi) - RtlAnsiStringToUnicodeString (&FileNameU, - &FileName, - TRUE); - else - RtlOemStringToUnicodeString (&FileNameU, - &FileName, - TRUE); - - IData = FindFirstFileExW(FileNameU.Buffer, - FindExInfoStandard, - &FindFileData, - FindExSearchNameMatch, - NULL, - 0); - - RtlFreeUnicodeString(&FileNameU); - - if(INVALID_HANDLE_VALUE != IData) - { - RtlInitUnicodeString(&FileNameU, (PWSTR)FindFileData.cFileName); - FileName.Buffer = lpFindFileData->cFileName; - FileName.MaximumLength = MAX_PATH; - if (bIsFileApiAnsi) { - RtlUnicodeStringToAnsiString (&FileName, - &FileNameU, - FALSE); - } - else - { - RtlUnicodeStringToOemString (&FileName, - &FileNameU, - FALSE); - } - memcpy(lpFindFileData, &FindFileData, offsetof(WIN32_FIND_DATAA, cFileName)); - - } - - - return (HANDLE)IData; -} - -/* - * @implemented - */ -HANDLE -STDCALL -FindFirstFileW ( - LPCWSTR lpFileName, - LPWIN32_FIND_DATAW lpFindFileData - ) -{ - return FindFirstFileExW( - lpFileName, - FindExInfoStandard, - lpFindFileData, - FindExSearchNameMatch, - NULL, - 0 - ); -} - - -/* - * @implemented - */ -BOOL -STDCALL -FindNextFileW ( - HANDLE hFindFile, - LPWIN32_FIND_DATAW lpFindFileData - ) -{ - PKERNEL32_FIND_FILE_DATA IData; - - if (hFindFile == INVALID_HANDLE_VALUE) - { - SetLastError (ERROR_INVALID_HANDLE); - DPRINT("Failing request\n"); - return FALSE; - } - - IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; - if (!InternalFindNextFile(hFindFile)) - { - DPRINT("Failing request\n"); - return FALSE; - } - - /* copy data into WIN32_FIND_DATA structure */ - lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes; - - lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; - lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; - - lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; - lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; - - lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; - lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; - - lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; - lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; - - lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; - lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; - - memcpy (lpFindFileData->cFileName, - IData->pFileInfo->FileName, - IData->pFileInfo->FileNameLength); - lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0; - memcpy (lpFindFileData->cAlternateFileName, - IData->pFileInfo->ShortName, - IData->pFileInfo->ShortNameLength); - lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength / sizeof(WCHAR)] = 0; - return TRUE; -} - - -/* - * @implemented - */ -HANDLE -STDCALL -FindFirstFileExW ( - LPCWSTR lpFileName, - FINDEX_INFO_LEVELS fInfoLevelId, - LPVOID lpFindFileData, - FINDEX_SEARCH_OPS fSearchOp, - LPVOID lpSearchFilter, - DWORD dwAdditionalFlags - ) -{ OBJECT_ATTRIBUTES ObjectAttributes; PKERNEL32_FIND_FILE_DATA IData; IO_STATUS_BLOCK IoStatusBlock; UNICODE_STRING NtPathU; - UNICODE_STRING PatternStr; + UNICODE_STRING PatternStr = RTL_CONSTANT_STRING(L"*"); NTSTATUS Status; PWSTR e1, e2; WCHAR CurrentDir[256]; @@ -363,20 +104,9 @@ ULONG Length; BOOLEAN bResult; -/* -..... -..... -..... -*/ - DPRINT("FindFirstFileExW(%S, %p, %p, %X, %p %d)\n", - lpFileName, - fInfoLevelId, - lpFindFileData, - fSearchOp, - lpSearchFilter, - dwAdditionalFlags); + DPRINT("FindFirstFileW(lpFileName %S)\n", + lpFileName); - Length = wcslen(lpFileName); if (L'\\' == lpFileName[Length - 1]) { @@ -386,7 +116,7 @@ if (NULL == SlashlessFileName) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return INVALID_HANDLE_VALUE; + return NULL; } memcpy(SlashlessFileName, lpFileName, (Length - 1) * sizeof(WCHAR)); SlashlessFileName[Length - 1] = L'\0'; @@ -415,7 +145,7 @@ 0, SlashlessFileName); } - return INVALID_HANDLE_VALUE; + return NULL; } if (Length > sizeof(CurrentDir) / sizeof(WCHAR)) { @@ -431,7 +161,7 @@ SlashlessFileName); } SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return INVALID_HANDLE_VALUE; + return NULL; } GetCurrentDirectoryW(Length, SearchPath); } @@ -455,7 +185,7 @@ SlashlessFileName); } SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return INVALID_HANDLE_VALUE; + return NULL; } } memcpy(SearchPath, lpFileName, Length * sizeof(WCHAR)); @@ -480,7 +210,7 @@ 0, SlashlessFileName); } - return INVALID_HANDLE_VALUE; + return NULL; } DPRINT("NtPathU \'%S\'\n", NtPathU.Buffer); @@ -500,16 +230,12 @@ SlashlessFileName); } SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return INVALID_HANDLE_VALUE; + return NULL; } /* change pattern: "*.*" --> "*" */ - if (!wcscmp (SearchPattern, L"*.*")) + if (wcscmp (SearchPattern, L"*.*")) { - RtlInitUnicodeString(&PatternStr, L"*"); - } - else - { RtlInitUnicodeString(&PatternStr, SearchPattern); } @@ -523,11 +249,11 @@ NULL); Status = NtOpenFile (&IData->DirectoryHandle, - SYNCHRONIZE|FILE_LIST_DIRECTORY, + FILE_LIST_DIRECTORY, &ObjectAttributes, &IoStatusBlock, FILE_SHARE_READ|FILE_SHARE_WRITE, - FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT); + FILE_DIRECTORY_FILE); RtlFreeHeap (hProcessHeap, 0, @@ -543,10 +269,9 @@ SlashlessFileName); } SetLastErrorByStatus (Status); - return INVALID_HANDLE_VALUE; + return(NULL); } IData->pFileInfo = (PVOID)((ULONG_PTR)IData + sizeof(KERNEL32_FIND_FILE_DATA)); - IData->pFileInfo->FileIndex = 0; Status = NtQueryDirectoryFile (IData->DirectoryHandle, @@ -572,36 +297,11 @@ CloseHandle (IData->DirectoryHandle); RtlFreeHeap (hProcessHeap, 0, IData); SetLastErrorByStatus (Status); - return INVALID_HANDLE_VALUE; + return NULL; } DPRINT("Found %.*S\n",IData->pFileInfo->FileNameLength/sizeof(WCHAR), IData->pFileInfo->FileName); - /* copy data into WIN32_FIND_DATA structure */ - ((LPWIN32_FIND_DATAW)lpFindFileData)->dwFileAttributes = IData->pFileInfo->FileAttributes; - - ((LPWIN32_FIND_DATAW)lpFindFileData)->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; - ((LPWIN32_FIND_DATAW)lpFindFileData)->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; - - ((LPWIN32_FIND_DATAW)lpFindFileData)->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; - ((LPWIN32_FIND_DATAW)lpFindFileData)->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; - - ((LPWIN32_FIND_DATAW)lpFindFileData)->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; - ((LPWIN32_FIND_DATAW)lpFindFileData)->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; - - ((LPWIN32_FIND_DATAW)lpFindFileData)->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; - ((LPWIN32_FIND_DATAW)lpFindFileData)->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; - - memcpy (((LPWIN32_FIND_DATAW)lpFindFileData)->cFileName, - IData->pFileInfo->FileName, - IData->pFileInfo->FileNameLength); - ((LPWIN32_FIND_DATAW)lpFindFileData)->cFileName[IData->pFileInfo->FileNa meLength / sizeof(WCHAR)] = 0; - memcpy (((LPWIN32_FIND_DATAW)lpFindFileData)->cAlternateFileName, - IData->pFileInfo->ShortName, - IData->pFileInfo->ShortNameLength); - ((LPWIN32_FIND_DATAW)lpFindFileData)->cAlternateFileName[IData->pFileInf o->ShortNameLength / sizeof(WCHAR)] = 0; - - - return (HANDLE)IData; + return IData; } @@ -610,62 +310,353 @@ */ HANDLE STDCALL -FindFirstFileExA ( - LPCSTR lpFileName, - FINDEX_INFO_LEVELS fInfoLevelId, - LPVOID lpFindFileData, - FINDEX_SEARCH_OPS fSearchOp, - LPVOID lpSearchFilter, - DWORD dwAdditionalFlags +FindFirstFileA ( + LPCSTR lpFileName, + LPWIN32_FIND_DATAA lpFindFileData ) { PKERNEL32_FIND_FILE_DATA IData; UNICODE_STRING FileNameU; - ANSI_STRING FileNameA; + ANSI_STRING FileName; - RtlInitAnsiString (&FileNameA, + RtlInitAnsiString (&FileName, (LPSTR)lpFileName); /* convert ansi (or oem) string to unicode */ if (bIsFileApiAnsi) RtlAnsiStringToUnicodeString (&FileNameU, - &FileNameA, + &FileName, TRUE); else RtlOemStringToUnicodeString (&FileNameU, - &FileNameA, + &FileName, TRUE); - IData = FindFirstFileExW( - (LPCWSTR)FileNameU.Buffer, - fInfoLevelId, - lpFindFileData, - fSearchOp, - lpSearchFilter, - dwAdditionalFlags - ); + IData = InternalFindFirstFile (FileNameU.Buffer); - RtlFreeUnicodeString(&FileNameU); + RtlFreeUnicodeString (&FileNameU); - if(INVALID_HANDLE_VALUE != IData) + if (IData == NULL) { - RtlInitUnicodeString(&FileNameU, (PWSTR)((LPWIN32_FIND_DATAW)lpFindFileData)->cFileName); - FileNameU.Buffer = ((LPWIN32_FIND_DATAW)lpFindFileData)->cFileName; - FileNameU.MaximumLength = MAX_PATH; - - /* convert unicode string to ansi (or oem) */ - if (bIsFileApiAnsi) - RtlUnicodeStringToAnsiString (&FileNameA, - &FileNameU, - FALSE); - else - RtlUnicodeStringToOemString (&FileNameA, - &FileNameU, - FALSE); + DPRINT("Failing request\n"); + return INVALID_HANDLE_VALUE; } + DPRINT("IData->pFileInfo->FileNameLength %d\n", + IData->pFileInfo->FileNameLength); + + /* copy data into WIN32_FIND_DATA structure */ + lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes; + + lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; + lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; + + lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; + lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; + + lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; + lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; + + lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; + lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; + + FileNameU.Length = IData->pFileInfo->FileNameLength; + FileNameU.MaximumLength = FileNameU.Length + sizeof(WCHAR); + FileNameU.Buffer = IData->pFileInfo->FileName; + + FileName.Length = 0; + FileName.MaximumLength = MAX_PATH; + FileName.Buffer = lpFindFileData->cFileName; + + /* convert unicode string to ansi (or oem) */ + if (bIsFileApiAnsi) + RtlUnicodeStringToAnsiString (&FileName, + &FileNameU, + FALSE); + else + RtlUnicodeStringToOemString (&FileName, + &FileNameU, + FALSE); + + DPRINT("IData->pFileInfo->ShortNameLength %d\n", + IData->pFileInfo->ShortNameLength); + + FileNameU.Length = IData->pFileInfo->ShortNameLength; + FileNameU.MaximumLength = FileNameU.Length + sizeof(WCHAR); + FileNameU.Buffer = IData->pFileInfo->ShortName; + + FileName.Length = 0; + FileName.MaximumLength = 14; + FileName.Buffer = lpFindFileData->cAlternateFileName; + + /* convert unicode string to ansi (or oem) */ + if (bIsFileApiAnsi) + RtlUnicodeStringToAnsiString (&FileName, + &FileNameU, + FALSE); + else + RtlUnicodeStringToOemString (&FileName, + &FileNameU, + FALSE); + return (HANDLE)IData; } +/* + * @implemented + */ +BOOL +STDCALL +FindNextFileA ( + HANDLE hFindFile, + LPWIN32_FIND_DATAA lpFindFileData) +{ + PKERNEL32_FIND_FILE_DATA IData; + UNICODE_STRING FileNameU; + ANSI_STRING FileName; + + if (hFindFile == INVALID_HANDLE_VALUE) + { + SetLastError (ERROR_INVALID_HANDLE); + DPRINT("Failing request\n"); + return FALSE; + } + + IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; + if (!InternalFindNextFile (hFindFile)) + { + DPRINT("InternalFindNextFile() failed\n"); + return FALSE; + } + + DPRINT("IData->pFileInfo->FileNameLength %d\n", + IData->pFileInfo->FileNameLength); + + /* copy data into WIN32_FIND_DATA structure */ + lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes; + + lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; + lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; + + lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; + lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; + + lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; + lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; + + lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; + lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; + + FileNameU.Length = IData->pFileInfo->FileNameLength; + FileNameU.MaximumLength = FileNameU.Length + sizeof(WCHAR); + FileNameU.Buffer = IData->pFileInfo->FileName; + + FileName.Length = 0; + FileName.MaximumLength = MAX_PATH; + FileName.Buffer = lpFindFileData->cFileName; + + /* convert unicode string to ansi (or oem) */ + if (bIsFileApiAnsi) + RtlUnicodeStringToAnsiString (&FileName, + &FileNameU, + FALSE); + else + RtlUnicodeStringToOemString (&FileName, + &FileNameU, + FALSE); + + DPRINT("IData->pFileInfo->ShortNameLength %d\n", + IData->pFileInfo->ShortNameLength); + + FileNameU.Length = IData->pFileInfo->ShortNameLength; + FileNameU.MaximumLength = FileNameU.Length + sizeof(WCHAR); + FileNameU.Buffer = IData->pFileInfo->ShortName; + + FileName.Length = 0; + FileName.MaximumLength = 14; + FileName.Buffer = lpFindFileData->cAlternateFileName; + + /* convert unicode string to ansi (or oem) */ + if (bIsFileApiAnsi) + RtlUnicodeStringToAnsiString (&FileName, + &FileNameU, + FALSE); + else + RtlUnicodeStringToOemString (&FileName, + &FileNameU, + FALSE); + + return TRUE; +} + + +/* + * @implemented + */ +BOOL +STDCALL +FindClose ( + HANDLE hFindFile + ) +{ + PKERNEL32_FIND_FILE_DATA IData; + + DPRINT("FindClose(hFindFile %x)\n",hFindFile); + + if (!hFindFile || hFindFile == INVALID_HANDLE_VALUE) + { + SetLastError (ERROR_INVALID_HANDLE); + return FALSE; + } + + IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; + + CloseHandle (IData->DirectoryHandle); + RtlFreeHeap (hProcessHeap, 0, IData); + + return TRUE; +} + + +/* + * @implemented + */ +HANDLE +STDCALL +FindFirstFileW ( + LPCWSTR lpFileName, + LPWIN32_FIND_DATAW lpFindFileData + ) +{ + PKERNEL32_FIND_FILE_DATA IData; + + IData = InternalFindFirstFile (lpFileName); + if (IData == NULL) + { + DPRINT("Failing request\n"); + return INVALID_HANDLE_VALUE; + } + + /* copy data into WIN32_FIND_DATA structure */ + lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes; + + lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; + lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; + + lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; + lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; + + lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; + lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; + + lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; + lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; + + memcpy (lpFindFileData->cFileName, + IData->pFileInfo->FileName, + IData->pFileInfo->FileNameLength); + lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0; + memcpy (lpFindFileData->cAlternateFileName, + IData->pFileInfo->ShortName, + IData->pFileInfo->ShortNameLength); + lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength / sizeof(WCHAR)] = 0; + return IData; +} + + +/* + * @implemented + */ +BOOL +STDCALL +FindNextFileW ( + HANDLE hFindFile, + LPWIN32_FIND_DATAW lpFindFileData + ) +{ + PKERNEL32_FIND_FILE_DATA IData; + + if (hFindFile == INVALID_HANDLE_VALUE) + { + SetLastError (ERROR_INVALID_HANDLE); + DPRINT("Failing request\n"); + return FALSE; + } + + IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; + if (!InternalFindNextFile(hFindFile)) + { + DPRINT("Failing request\n"); + return FALSE; + } + + /* copy data into WIN32_FIND_DATA structure */ + lpFindFileData->dwFileAttributes = IData->pFileInfo->FileAttributes; + + lpFindFileData->ftCreationTime.dwHighDateTime = IData->pFileInfo->CreationTime.u.HighPart; + lpFindFileData->ftCreationTime.dwLowDateTime = IData->pFileInfo->CreationTime.u.LowPart; + + lpFindFileData->ftLastAccessTime.dwHighDateTime = IData->pFileInfo->LastAccessTime.u.HighPart; + lpFindFileData->ftLastAccessTime.dwLowDateTime = IData->pFileInfo->LastAccessTime.u.LowPart; + + lpFindFileData->ftLastWriteTime.dwHighDateTime = IData->pFileInfo->LastWriteTime.u.HighPart; + lpFindFileData->ftLastWriteTime.dwLowDateTime = IData->pFileInfo->LastWriteTime.u.LowPart; + + lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; + lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; + + lpFindFileData->nFileSizeHigh = IData->pFileInfo->EndOfFile.u.HighPart; + lpFindFileData->nFileSizeLow = IData->pFileInfo->EndOfFile.u.LowPart; + + memcpy (lpFindFileData->cFileName, + IData->pFileInfo->FileName, + IData->pFileInfo->FileNameLength); + lpFindFileData->cFileName[IData->pFileInfo->FileNameLength / sizeof(WCHAR)] = 0; + memcpy (lpFindFileData->cAlternateFileName, + IData->pFileInfo->ShortName, + IData->pFileInfo->ShortNameLength); + lpFindFileData->cAlternateFileName[IData->pFileInfo->ShortNameLength / sizeof(WCHAR)] = 0; + return TRUE; +} + + +/* + * @unimplemented + */ +HANDLE +STDCALL +FindFirstFileExW ( + LPCWSTR lpFileName, + FINDEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFindFileData, + FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, + DWORD dwAdditionalFlags + ) +{ + /* FIXME */ + return (HANDLE) 0; +} + + +/* + * @unimplemented + */ +HANDLE +STDCALL +FindFirstFileExA ( + LPCSTR lpFileName, + FINDEX_INFO_LEVELS fInfoLevelId, + LPVOID lpFindFileData, + FINDEX_SEARCH_OPS fSearchOp, + LPVOID lpSearchFilter, + DWORD dwAdditionalFlags + ) +{ + /* FIXME */ + return (HANDLE) 0; +} + + /* EOF */
19 years, 5 months
1
0
0
0
[greatlrd] 16892: fix waring kdump.c:246: warning: 'OldIrql' may be used uninitialized for dgb=0;
by greatlrd@svn.reactos.com
fix waring kdump.c:246: warning: 'OldIrql' may be used uninitialized for dgb=0; Modified: trunk/reactos/drivers/storage/diskdump/diskdump.c _____ Modified: trunk/reactos/drivers/storage/diskdump/diskdump.c --- trunk/reactos/drivers/storage/diskdump/diskdump.c 2005-07-30 00:52:22 UTC (rev 16891) +++ trunk/reactos/drivers/storage/diskdump/diskdump.c 2005-07-30 13:44:07 UTC (rev 16892) @@ -243,7 +243,7 @@ NTSTATUS STDCALL DiskDumpWrite(LARGE_INTEGER Address, PMDL Mdl) { - KIRQL OldIrql, OldIrql2; + KIRQL OldIrql = 0, OldIrql2 = 0; KIRQL CurrentIrql = KeGetCurrentIrql(); if (CurrentIrql < (CoreDumpPortDeviceExtension->Interrupt->SynchronizeIrql - 1))
19 years, 5 months
1
0
0
0
[jimtabor] 16891: Implement SetMenuItemBitmaps and fix bool flags.
by jimtabor@svn.reactos.com
Implement SetMenuItemBitmaps and fix bool flags. Modified: trunk/reactos/lib/user32/windows/menu.c _____ Modified: trunk/reactos/lib/user32/windows/menu.c --- trunk/reactos/lib/user32/windows/menu.c 2005-07-29 23:37:11 UTC (rev 16890) +++ trunk/reactos/lib/user32/windows/menu.c 2005-07-30 00:52:22 UTC (rev 16891) @@ -4327,7 +4327,7 @@ if(!GetMenuItemInfoA( hMnu, uPosition, - (BOOL)!(MF_BYPOSITION & uFlags), + (BOOL)(MF_BYPOSITION & uFlags), &mii)) return FALSE; if(uFlags & MF_BITMAP) @@ -4397,7 +4397,7 @@ return SetMenuItemInfoA( hMnu, uPosition, - (BOOL)!(MF_BYPOSITION & uFlags), + (BOOL)(MF_BYPOSITION & uFlags), &mii); } @@ -4424,7 +4424,7 @@ if(!NtUserMenuItemInfo( hMnu, uPosition, - (BOOL)!(MF_BYPOSITION & uFlags), + (BOOL)(MF_BYPOSITION & uFlags), (PROSMENUITEMINFO) &mii, FALSE)) return FALSE; @@ -4494,7 +4494,7 @@ return SetMenuItemInfoW( hMnu, uPosition, - (BOOL)!(MF_BYPOSITION & uFlags), + (BOOL)(MF_BYPOSITION & uFlags), &mii); } @@ -4558,7 +4558,7 @@ /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -4569,8 +4569,23 @@ HBITMAP hBitmapUnchecked, HBITMAP hBitmapChecked) { - UNIMPLEMENTED; - return FALSE; + ROSMENUITEMINFO uItem; + + if(!(NtUserMenuItemInfo(hMenu, uPosition, + (BOOL)(MF_BYPOSITION & uFlags), &uItem, FALSE))) return FALSE; + + if (!hBitmapChecked && !hBitmapUnchecked) + { + uItem.fState &= ~MF_USECHECKBITMAPS; + } + else /* Install new bitmaps */ + { + uItem.hbmpChecked = hBitmapChecked; + uItem.hbmpUnchecked = hBitmapUnchecked; + uItem.fState |= MF_USECHECKBITMAPS; + } + return NtUserMenuItemInfo(hMenu, uPosition, + (BOOL)(MF_BYPOSITION & uFlags), &uItem, TRUE); }
19 years, 5 months
1
0
0
0
[jimtabor] 16890: Patch by Dmitry Timoshkov dmitry@baikal.ru. Take into account CS_NOCLOSE window class style and SC_CLOSE system menu item state while adding MDI system menu buttons and generating WM_SYSCOMMAND messages.
by jimtabor@svn.reactos.com
Patch by Dmitry Timoshkov dmitry(a)baikal.ru. Take into account CS_NOCLOSE window class style and SC_CLOSE system menu item state while adding MDI system menu buttons and generating WM_SYSCOMMAND messages. Modified: trunk/reactos/lib/user32/windows/mdi.c _____ Modified: trunk/reactos/lib/user32/windows/mdi.c --- trunk/reactos/lib/user32/windows/mdi.c 2005-07-29 23:15:01 UTC (rev 16889) +++ trunk/reactos/lib/user32/windows/mdi.c 2005-07-29 23:37:11 UTC (rev 16890) @@ -264,6 +264,20 @@ #endif } +static BOOL is_close_enabled(HWND hwnd, HMENU hSysMenu) +{ + if (GetClassLongW(hwnd, GCL_STYLE) & CS_NOCLOSE) return FALSE; + + if (!hSysMenu) hSysMenu = GetSystemMenu(hwnd, FALSE); + if (hSysMenu) + { + UINT state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); + if (state == 0xFFFFFFFF || (state & (MF_DISABLED | MF_GRAYED))) + return FALSE; + } + return TRUE; +} + /********************************************************************** * MDI_MenuModifyItem */ @@ -1108,14 +1122,14 @@ if (!(hSysPopup = GetSystemMenu(hChild, FALSE))) return 0; - AppendMenuA(menu,MF_HELP | MF_BITMAP, - SC_MINIMIZE, (LPSTR)(DWORD)HBMMENU_MBAR_MINIMIZE ) ; - AppendMenuA(menu,MF_HELP | MF_BITMAP, - SC_RESTORE, (LPSTR)(DWORD)HBMMENU_MBAR_RESTORE ); + AppendMenuW(menu, MF_HELP | MF_BITMAP, + SC_MINIMIZE, (LPCWSTR)HBMMENU_MBAR_MINIMIZE ) ; + AppendMenuW(menu, MF_HELP | MF_BITMAP, + SC_RESTORE, (LPCWSTR)HBMMENU_MBAR_RESTORE ); + AppendMenuW(menu, MF_HELP | MF_BITMAP, + SC_CLOSE, is_close_enabled(hChild, hSysPopup) ? + (LPCWSTR)HBMMENU_MBAR_CLOSE : (LPCWSTR)HBMMENU_MBAR_CLOSE_D ); - AppendMenuA(menu,MF_HELP | MF_BITMAP, - SC_CLOSE, (LPSTR)(DWORD)HBMMENU_MBAR_CLOSE ); - /* The system menu is replaced by the child icon */ hIcon = (HICON)GetClassLongW(hChild, GCL_HICONSM); if (!hIcon) @@ -1612,13 +1626,14 @@ if( !ci->hwndChildMaximized ) break; switch( id ) { + case SC_CLOSE: + if (!is_close_enabled(ci->hwndActiveChild, 0)) break; case SC_SIZE: case SC_MOVE: case SC_MINIMIZE: case SC_MAXIMIZE: case SC_NEXTWINDOW: case SC_PREVWINDOW: - case SC_CLOSE: case SC_RESTORE: return SendMessageW( ci->hwndChildMaximized, WM_SYSCOMMAND, wParam, lParam); @@ -2033,8 +2048,12 @@ break; case VK_F4: case VK_RBUTTON: - wParam = SC_CLOSE; - break; + if (is_close_enabled(ci->hwndActiveChild, 0)) + { + wParam = SC_CLOSE; + break; + } + /* fall through */ default: return 0; }
19 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
57
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Results per page:
10
25
50
100
200