ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
28 participants
703 discussions
Start a n
N
ew thread
[gvg] 12764: Reverse last change, as it causes problems for ReadConsole (line input)
by gvg@svn.reactos.com
Reverse last change, as it causes problems for ReadConsole (line input) Modified: trunk/reactos/subsys/win32k/ntuser/keyboard.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/keyboard.c --- trunk/reactos/subsys/win32k/ntuser/keyboard.c 2005-01-03 21:19:25 UTC (rev 12763) +++ trunk/reactos/subsys/win32k/ntuser/keyboard.c 2005-01-03 22:00:39 UTC (rev 12764) @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: keyboard.c,v 1.35 2004/12/28 08:50:10 gvg Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -342,23 +342,16 @@ HKL dwhkl ) { int ToUnicodeResult = 0; - if (0 == (lpKeyState[wVirtKey] & KS_DOWN_BIT)) - { - ToUnicodeResult = 0; - } - else - { - IntLockQueueState; - ToUnicodeResult = ToUnicodeInner( wVirtKey, - wScanCode, - lpKeyState, - pwszBuff, - cchBuff, - wFlags, - PsGetWin32Thread() ? - PsGetWin32Thread()->KeyboardLayout : 0 ); - IntUnLockQueueState; - } + IntLockQueueState; + ToUnicodeResult = ToUnicodeInner( wVirtKey, + wScanCode, + lpKeyState, + pwszBuff, + cchBuff, + wFlags, + PsGetWin32Thread() ? + PsGetWin32Thread()->KeyboardLayout : 0 ); + IntUnLockQueueState; return ToUnicodeResult; }
19 years, 11 months
1
0
0
0
[navaraf] 12763: Don't crash if ShellFolder doesn't implement the IID_ISFHelper interface.
by navaraf@svn.reactos.com
Don't crash if ShellFolder doesn't implement the IID_ISFHelper interface. Modified: trunk/reactos/lib/shell32/shlview.c _____ Modified: trunk/reactos/lib/shell32/shlview.c --- trunk/reactos/lib/shell32/shlview.c 2005-01-03 20:43:23 UTC (rev 12762) +++ trunk/reactos/lib/shell32/shlview.c 2005-01-03 21:19:25 UTC (rev 12763) @@ -1456,6 +1456,9 @@ IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp); + if (psfhlp == NULL) + break; + if(!(i = ListView_GetSelectedCount(This->hWndList))) break;
19 years, 11 months
1
0
0
0
[chorns] 12762: Add makefile for rbuild.
by chorns@svn.reactos.com
Add makefile for rbuild. Modified: branches/xmlbuildsystem/reactos/tools/Makefile Added: branches/xmlbuildsystem/reactos/tools/rbuild/makefile Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp _____ Modified: branches/xmlbuildsystem/reactos/tools/Makefile --- branches/xmlbuildsystem/reactos/tools/Makefile 2005-01-03 19:51:26 UTC (rev 12761) +++ branches/xmlbuildsystem/reactos/tools/Makefile 2005-01-03 20:43:23 UTC (rev 12762) @@ -20,7 +20,7 @@ CLEAN_FILES = $(TOOLS) all: $(TOOLS) zlib_target wmc_target cabman_target cdmake_target mkhive_target rgenstat_target \ - wine2ros_target pipetools_target winebuild_target bin2res_target + wine2ros_target pipetools_target rbuild_target winebuild_target bin2res_target buildno$(EXE_POSTFIX): buildno.c ../include/reactos/version.h @$(HOST_CC) $(CFLAGS) -o buildno$(EXE_POSTFIX) buildno.c @@ -124,13 +124,16 @@ $(MAKE) --silent -C pipetools endif +rbuild_target: + $(MAKE) --silent -C rbuild rbuild$(EXE_POSTFIX) + winebuild_target: $(MAKE) --silent -C winebuild winebuild$(EXE_POSTFIX) bin2res_target: $(MAKE) --silent -C bin2res bin2res$(EXE_POSTFIX) -.PHONY: wmc_target cdmake_target mkhive_target rgenstat_target pipetools_target +.PHONY: wmc_target cdmake_target mkhive_target rgenstat_target pipetools_target rbuild_target ifeq ($(HOST),mingw32-linux) @@ -141,6 +144,7 @@ $(MAKE) --silent -C wmc clean $(MAKE) --silent -C rgenstat clean $(MAKE) --silent -C wine2ros clean + $(MAKE) --silent -C rbuild clean $(MAKE) --silent -C winebuild clean $(MAKE) --silent -C bin2res clean $(MAKE) --silent -C ../lib/zlib -f Makefile.host clean @@ -156,6 +160,7 @@ $(MAKE) --silent -C wmc clean $(MAKE) --silent -C rgenstat clean $(MAKE) --silent -C pipetools clean + $(MAKE) --silent -C rbuild clean $(MAKE) --silent -C wine2ros clean $(MAKE) --silent -C winebuild clean $(MAKE) --silent -C bin2res clean _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/makefile --- branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-03 19:51:26 UTC (rev 12761) +++ branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-03 20:43:23 UTC (rev 12762) @@ -0,0 +1,35 @@ +PATH_TO_TOP = ../.. + +TARGET = rbuild$(EXE_POSTFIX) + +all: $(TARGET) + +OBJECTS = rbuild.o + +CLEAN_FILES = *.o rbuild$(EXE_POSTFIX) + +HOST_CFLAGS = -g -I. -Werror -Wall + +HOST_LFLAGS = -g + +rbuild$(EXE_POSTFIX): $(OBJECTS) + $(HOST_CXX) $(OBJECTS) $(HOST_LFLAGS) -o rbuild$(EXE_POSTFIX) + +ifeq ($(HOST),mingw32-linux) +clean: + -rm -f *.o + -rm -f rbuild$(EXE_POSTFIX) +endif +ifeq ($(HOST),mingw32-windows) +clean: + -del *.o + -del rbuild$(EXE_POSTFIX) +endif + +.phony: clean + +%.o: %.cpp + $(HALFVERBOSEECHO) [CXX] $< + $(HOST_CXX) $(HOST_CFLAGS) -c $< -o $@ + +include $(PATH_TO_TOP)/rules.mak _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp 2005-01-03 19:51:26 UTC (rev 12761) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp 2005-01-03 20:43:23 UTC (rev 12762) @@ -311,8 +311,10 @@ } XMLElement* head = XMLParse ( f ); + if (head) + { + // REM TODO FIXME actually do something with the parsed info + } - // REM TODO FIXME actually do something with the parsed info - return 0; }
19 years, 11 months
1
0
0
0
[arty] 12761: Removed spaces, put tabs.
by arty@svn.reactos.com
Removed spaces, put tabs. Modified: trunk/reactos/bootdata/packages/reactos.dff _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-01-03 19:45:35 UTC (rev 12760) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-01-03 19:51:26 UTC (rev 12761) @@ -161,7 +161,7 @@ services\eventlog\eventlog.exe 1 services\rpcss\rpcss.exe 1 apps\utils\net\arp\arp.exe 1 -apps\utils\net\route\route.exe 1 +apps\utils\net\route\route.exe 1 apps\utils\net\finger\finger.exe 1 apps\utils\net\ipconfig\ipconfig.exe 1 apps\utils\net\netstat\netstat.exe 1
19 years, 11 months
1
0
0
0
[arty] 12760: Added route.exe to bootcd.
by arty@svn.reactos.com
Added route.exe to bootcd. Patch by WaxDragon. Modified: trunk/reactos/bootdata/packages/reactos.dff _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-01-03 19:29:19 UTC (rev 12759) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-01-03 19:45:35 UTC (rev 12760) @@ -161,6 +161,7 @@ services\eventlog\eventlog.exe 1 services\rpcss\rpcss.exe 1 apps\utils\net\arp\arp.exe 1 +apps\utils\net\route\route.exe 1 apps\utils\net\finger\finger.exe 1 apps\utils\net\ipconfig\ipconfig.exe 1 apps\utils\net\netstat\netstat.exe 1
19 years, 11 months
1
0
0
0
[royce] 12759: moved rbuild.cpp per Casper's request
by royce@svn.reactos.com
moved rbuild.cpp per Casper's request Added: branches/xmlbuildsystem/reactos/tools/rbuild/ Added: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp Deleted: branches/xmlbuildsystem/reactos/tools/rbuild.cpp _____ Copied: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.cpp (from rev 12758, branches/xmlbuildsystem/reactos/tools/rbuild.cpp) _____ Deleted: branches/xmlbuildsystem/reactos/tools/rbuild.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild.cpp 2005-01-03 18:44:36 UTC (rev 12758) +++ branches/xmlbuildsystem/reactos/tools/rbuild.cpp 2005-01-03 19:29:19 UTC (rev 12759) @@ -1,318 +0,0 @@ -// rbuild.cpp - -#ifdef _MSC_VER -#pragma warning ( disable : 4786 ) -#endif//_MSC_VER - -#include <string> -#include <vector> - -#include <stdio.h> -#include <io.h> -#include <assert.h> -//#include <sys/stat.h> -//#include <sys/types.h> - -using std::string; -using std::vector; - -#ifdef _MSC_VER -unsigned __int64 -#else -unsigned long long -#endif -filelen ( FILE* f ) -{ -#ifdef WIN32 - return _filelengthi64 ( _fileno(f) ); -#elif defined(UNIX) - struct stat64 file_stat; - if ( fstat64(fileno(f), &file_stat) != 0 ) - return 0; - return file_stat.st_size; -#endif -} - -static const char* WS = " \t\r\n"; -static const char* WSEQ = " =\t\r\n"; - -class XMLFile -{ - vector<FILE*> _f; - string _buf; - const char *_p, *_end; -public: - XMLFile() {} - void close() - { - while ( _f.size() ) - { - fclose ( _f.back() ); - _f.pop_back(); - } - _buf.resize(0); - _p = _end = NULL; - } - bool open ( const char* filename ) - { - close(); - FILE* f = fopen ( filename, "r" ); - if ( !f ) - return false; - unsigned long len = (unsigned long)filelen(f); - _buf.resize ( len ); - fread ( &_buf[0], 1, len, f ); - _p = _buf.c_str(); - _end = _p + len; - _f.push_back ( f ); - next_token(); - return true; - } - // next_token() moves the pointer to next token, which may be - // an xml element or a text element, basically it's a glorified - // skipspace, normally the user of this class won't need to call - // this function - void next_token() - { - _p += strspn ( _p, WS ); - } - bool next_is_text() - { - return *_p != '<'; - } - bool more_tokens() - { - return _p != _end; - } - // get_token() is used to return a token, and move the pointer - // past the token - bool get_token ( string& token ) - { - const char* tokend; - if ( *_p == '<' ) - { - tokend = strchr ( _p, '>' ); - if ( !tokend ) - tokend = _end; - else - ++tokend; - } - else - { - tokend = strchr ( _p, '<' ); - if ( !tokend ) - tokend = _end; - while ( tokend > _p && isspace(tokend[-1]) ) - --tokend; - } - if ( tokend == _p ) - return false; - token = string ( _p, tokend-_p ); - _p = tokend; - next_token(); - return true; - } -#if 0 - bool getc ( char& c ) - { - while ( _bufidx >= _buf.size() ) - { - static buf[4096]; - if ( !fgets ( buf, sizeof(buf), _f.back() ) ) - { - fclose ( _f.back() ); - f.pop_back(); - continue; - } - _buf = buf; - _bufidx = 0; - // REM TODO FIXME - check for and load includes here... - /*char* p = &_buf[0]; - p += strspn ( p, " \t" ); - if ( *p++ != '#' ) - break; - p += strspn ( p, " \t" ); - if ( strncmp ( p, "include", 7 ) ) - break; - p += 7; - if ( !isspace(*p++) ) - break;*/ - - } - c = _buf[_bufidx++]; - return true; - } -#endif -}; - -class XMLAttribute -{ -public: - string name, value; - - XMLAttribute() {} - - XMLAttribute ( const string& name_, const string& value_ ) - : name(name_), value(value_) - { - } - - XMLAttribute ( const XMLAttribute& src ) - { - name = src.name; - value = src.value; - } - - XMLAttribute& operator = ( const XMLAttribute& src ) - { - name = src.name; - value = src.value; - return *this; - } -}; - -class XMLElement -{ -public: - string name; - vector<XMLAttribute> attributes; - vector<XMLElement*> subElements; - string value; - - XMLElement() {} - // Parse() returns true if you need to look for a </tag> for - // this one... - bool Parse ( const string& token, bool& end_tag ) - { - const char* p = token.c_str(); - assert ( *p == '<' ); - p++; - p += strspn ( p, WS ); - end_tag = ( *p == '/' ); - if ( end_tag ) - { - ++p; - p += strspn ( p, WS ); - } - const char* end = strpbrk ( p, WS ); - if ( !end ) - { - end = strpbrk ( p, "/>" ); - assert ( end ); - } - name = string ( p, end-p ); - p = end; - p += strspn ( p, WS ); - while ( *p != '>' && *p != '/' ) - { - end = strpbrk ( p, WSEQ ); - if ( !end ) - { - end = strpbrk ( p, "/>" ); - assert ( end ); - } - string attribute ( p, end-p ), value; - p = end; - p += strspn ( p, WS ); - if ( *p == '=' ) - { - ++p; - p += strspn ( p, WS ); - char quote = 0; - if ( strchr ( "\"'", *p ) ) - { - quote = *p++; - end = strchr ( p, quote ); - } - else - { - end = strpbrk ( p, WS ); - } - if ( !end ) - { - end = strchr ( p, '>' ); - assert(end); - if ( end[-1] == '/' ) - end--; - } - value = string ( p, end-p ); - p = end; - if ( quote && *p == quote ) - p++; - p += strspn ( p, WS ); - } - attributes.push_back ( XMLAttribute ( attribute, value ) ); - } - return !( *p == '/' ) && !end_tag; - } -}; - -XMLElement* XMLParse ( XMLFile& f, bool* pend_tag = NULL ) -{ - string token; - if ( !f.get_token(token) ) - return NULL; - XMLElement* e = new XMLElement; - bool end_tag; - if ( !e->Parse ( token, end_tag ) ) - { - if ( pend_tag ) - *pend_tag = end_tag; - else if ( end_tag ) - { - delete e; - printf ( "syntax error: end tag '%s' not expected\n", token.c_str() ); - return NULL; - } - return e; - } - while ( f.more_tokens() ) - { - if ( f.next_is_text() ) - { - if ( !f.get_token ( token ) ) - { - printf ( "internal tool error - get_token() failed when more_tokens() returned true\n" ); - break; - } - if ( e->subElements.size() ) - printf ( "syntax error: mixing of inner text with sub elements\n" ); - if ( e->value.size() ) - { - printf ( "syntax error: multiple instances of inner text\n" ); - e->value += " " + token; - } - else - e->value = token; - } - else - { - XMLElement* e2 = XMLParse ( f, &end_tag ); - if ( end_tag ) - { - if ( e->name != e2->name ) - printf ( "end tag name mismatch\n" ); - delete e2; - break; - } - e->subElements.push_back ( e2 ); - } - } - return e; -} - -int main ( int argc, char** argv ) -{ - XMLFile f; - if ( !f.open ( "rbuild.xml" ) ) - { - printf ( "couldn't open rbuild.xml!\n" ); - return -1; - } - - XMLElement* head = XMLParse ( f ); - - // REM TODO FIXME actually do something with the parsed info - - return 0; -}
19 years, 11 months
1
0
0
0
[gvg] 12758: Make command-prompt-link creation code Unicode resistent
by gvg@svn.reactos.com
Make command-prompt-link creation code Unicode resistent Modified: trunk/reactos/lib/syssetup/install.c _____ Modified: trunk/reactos/lib/syssetup/install.c --- trunk/reactos/lib/syssetup/install.c 2005-01-03 14:58:44 UTC (rev 12757) +++ trunk/reactos/lib/syssetup/install.c 2005-01-03 18:44:36 UTC (rev 12758) @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: install.c,v 1.21 2004/12/28 14:41:46 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -99,11 +99,13 @@ #endif -HRESULT CreateShellLink(LPCSTR linkPath, LPCSTR cmd, LPCSTR arg, LPCSTR dir, LPCSTR iconPath, int icon_nr, LPCSTR comment) +HRESULT CreateShellLink(LPCTSTR linkPath, LPCTSTR cmd, LPCTSTR arg, LPCTSTR dir, LPCTSTR iconPath, int icon_nr, LPCTSTR comment) { - IShellLinkA* psl; + IShellLink* psl; IPersistFile* ppf; +#ifndef _UNICODE WCHAR buffer[MAX_PATH]; +#endif /* _UNICODE */ HRESULT hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID*)&psl); @@ -135,9 +137,13 @@ if (SUCCEEDED(hr)) { +#ifdef _UNICODE + hr = ppf->lpVtbl->Save(ppf, linkPath, TRUE); +#else /* _UNICODE */ MultiByteToWideChar(CP_ACP, 0, linkPath, -1, buffer, MAX_PATH); hr = ppf->lpVtbl->Save(ppf, buffer, TRUE); +#endif /* _UNICODE */ ppf->lpVtbl->Release(ppf); } @@ -152,16 +158,16 @@ static VOID CreateCmdLink(VOID) { - char path[MAX_PATH]; - LPSTR p; + TCHAR path[MAX_PATH]; + LPTSTR p; CoInitialize(NULL); - SHGetSpecialFolderPathA(0, path, CSIDL_DESKTOP, TRUE); - p = PathAddBackslashA(path); + SHGetSpecialFolderPath(0, path, CSIDL_DESKTOP, TRUE); + p = PathAddBackslash(path); - strcpy(p, "Command Prompt.lnk"); - CreateShellLink(path, "cmd.exe", "", NULL, NULL, 0, "Open command prompt"); + _tcscpy(p, _T("Command Prompt.lnk")); + CreateShellLink(path, _T("cmd.exe"), _T(""), NULL, NULL, 0, _T("Open command prompt")); CoUninitialize(); }
19 years, 11 months
1
0
0
0
[gdalsnes] 12757: critical.c:
by gdalsnes@svn.reactos.com
critical.c: -don't allocate semaphore until its. actually needed (just like windows & wine) Ripped from Wine -correct InterlockedCompareExchange proto -add Interlocked(Compare)ExchangePointer def. -correct CRITICAL_SECTION_DEBUG struct Modified: trunk/reactos/include/funcs.h Modified: trunk/reactos/include/ntdll/rtl.h Modified: trunk/reactos/lib/ntdll/rtl/critical.c _____ Modified: trunk/reactos/include/funcs.h --- trunk/reactos/include/funcs.h 2005-01-03 14:47:11 UTC (rev 12756) +++ trunk/reactos/include/funcs.h 2005-01-03 14:58:44 UTC (rev 12757) @@ -4623,12 +4623,12 @@ LONG Value ); -PVOID +LONG STDCALL InterlockedCompareExchange( - PVOID *Destination, - PVOID Exchange, - PVOID Comperand + PLONG Destination, + LONG Exchange, + LONG Comperand ); #endif _____ Modified: trunk/reactos/include/ntdll/rtl.h --- trunk/reactos/include/ntdll/rtl.h 2005-01-03 14:47:11 UTC (rev 12756) +++ trunk/reactos/include/ntdll/rtl.h 2005-01-03 14:58:44 UTC (rev 12757) @@ -1,4 +1,4 @@ -/* $Id: rtl.h,v 1.53 2004/11/29 00:05:31 gdalsnes Exp $ +/* $Id$ * */ @@ -100,7 +100,7 @@ ULONG EntryCount; ULONG ContentionCount; ULONG Depth; - PVOID OwnerBackTrace[ 5 ]; + PVOID Spare[ 2 ]; } CRITICAL_SECTION_DEBUG, *PCRITICAL_SECTION_DEBUG; @@ -190,13 +190,13 @@ IN BOOLEAN Success, IN BOOLEAN Failure); -VOID STDCALL +NTSTATUS STDCALL RtlDeleteCriticalSection (PCRITICAL_SECTION CriticalSection); WCHAR STDCALL RtlDowncaseUnicodeChar(IN WCHAR Source); -VOID STDCALL +NTSTATUS STDCALL RtlEnterCriticalSection (PCRITICAL_SECTION CriticalSection); NTSTATUS STDCALL @@ -211,7 +211,7 @@ IN ULONG Base, PUNICODE_STRING String); -VOID STDCALL +NTSTATUS STDCALL RtlLeaveCriticalSection (PCRITICAL_SECTION CriticalSection); BOOLEAN STDCALL @@ -744,12 +744,12 @@ LONG Value ); -PVOID +LONG STDCALL InterlockedCompareExchange ( - PVOID *Destination, - PVOID Exchange, - PVOID Comperand + PLONG Destination, + LONG Exchange, + LONG Comperand ); LONG @@ -759,6 +759,26 @@ LONG Increment ); +#ifndef InterlockedExchangePointer + #ifdef _WIN64 + #define InterlockedExchangePointer(Target, Value) \ + (PVOID)InterlockedExchange64((PLONGLONG)(Target), (LONGLONG)(Value)) + #else + #define InterlockedExchangePointer(Target, Value) \ + (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)) + #endif +#endif + +#ifndef InterlockedCompareExchangePointer + #ifdef _WIN64 + #define InterlockedCompareExchangePointer(Target, Exchange, Comperand) \ + (PVOID)InterlockedCompareExchange64((PLONGLONG)(Target), (LONGLONG)(Exchange), (LONGLONG)(Comperand)) + #else + #define InterlockedCompareExchangePointer(Target, Exchange, Comperand) \ + (PVOID)InterlockedCompareExchange((PLONG)Target, (LONG)Exchange, (LONG)Comperand) + #endif +#endif + #endif /* __INTERLOCKED_DECLARED */ #endif /* __NTDRIVER__ */ _____ Modified: trunk/reactos/lib/ntdll/rtl/critical.c --- trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-03 14:47:11 UTC (rev 12756) +++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-03 14:58:44 UTC (rev 12757) @@ -1,4 +1,4 @@ -/* $Id: critical.c,v 1.20 2004/03/24 23:43:52 gdalsnes Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -19,160 +19,391 @@ /* FUNCTIONS *****************************************************************/ -/* - * @implemented - */ -VOID STDCALL -RtlDeleteCriticalSection(PCRITICAL_SECTION CriticalSection) +inline static HANDLE RtlGetCurrentThreadId() { - NtClose(CriticalSection->LockSemaphore); - CriticalSection->LockCount = -1; + return (HANDLE)NtCurrentTeb()->Cid.UniqueThread; } -/* - * @implemented - */ -DWORD STDCALL -RtlSetCriticalSectionSpinCount( - LPCRITICAL_SECTION CriticalSection, - DWORD SpinCount - ) +inline static void small_pause(void) { - -#ifdef MP - DWORD PrevSpinCount = CriticalSection->SpinCount; - CriticalSection->SpinCount = SpinCount; - return PrevSpinCount; +#ifdef __i386__ + __asm__ __volatile__( "rep;nop" : : : "memory" ); #else - return 0; + __asm__ __volatile__( "" : : : "memory" ); #endif +} +/********************************************************************** * + * get_semaphore + */ +static inline HANDLE get_semaphore( PCRITICAL_SECTION crit ) +{ + HANDLE ret = crit->LockSemaphore; + if (!ret) + { + HANDLE sem; + if (!NT_SUCCESS(NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 ))) return 0; + if (!(ret = (HANDLE)InterlockedCompareExchangePointer( (PVOID *)&crit->LockSemaphore, + (PVOID)sem, 0 ))) + ret = sem; + else + NtClose(sem); /* somebody beat us to it */ + } + return ret; } +/********************************************************************** * + * RtlInitializeCriticalSection (NTDLL.@) + * + * Initialises a new critical section. + * + * PARAMS + * crit [O] Critical section to initialise + * + * RETURNS + * STATUS_SUCCESS. + * + * SEE + * RtlInitializeCriticalSectionAndSpinCount(), RtlDeleteCriticalSection(), + * RtlEnterCriticalSection(), RtlLeaveCriticalSection(), + * RtlTryEnterCriticalSection(), RtlSetCriticalSectionSpinCount() + */ +NTSTATUS STDCALL RtlInitializeCriticalSection( PCRITICAL_SECTION crit ) +{ + return RtlInitializeCriticalSectionAndSpinCount( crit, 0 ); +} -/* - * @implemented +/********************************************************************** * + * RtlInitializeCriticalSectionAndSpinCount (NTDLL.@) + * + * Initialises a new critical section with a given spin count. + * + * PARAMS + * crit [O] Critical section to initialise + * spincount [I] Spin count for crit + * + * RETURNS + * STATUS_SUCCESS. + * + * NOTES + * Available on NT4 SP3 or later. + * + * SEE + * RtlInitializeCriticalSection(), RtlDeleteCriticalSection(), + * RtlEnterCriticalSection(), RtlLeaveCriticalSection(), + * RtlTryEnterCriticalSection(), RtlSetCriticalSectionSpinCount() */ -VOID STDCALL -RtlEnterCriticalSection(PCRITICAL_SECTION CriticalSection) +NTSTATUS STDCALL RtlInitializeCriticalSectionAndSpinCount( PCRITICAL_SECTION crit, ULONG spincount ) { - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; - - if (InterlockedIncrement(&CriticalSection->LockCount)) - { - NTSTATUS Status; - - if (CriticalSection->OwningThread == Thread) - { - CriticalSection->RecursionCount++; - return; - } - - DPRINT("Entering wait for critical section\n"); - Status = NtWaitForSingleObject(CriticalSection->LockSemaphore, - 0, FALSE); - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlEnterCriticalSection: Failed to wait (Status %x)\n", - Status); - } - DPRINT("Left wait for critical section\n"); - } - CriticalSection->OwningThread = Thread; - CriticalSection->RecursionCount = 1; + /* Does ROS need this, or is this special to Wine? And if ros need it, should + it be enabled in the release build? -Gunnar */ + if (RtlGetProcessHeap()) crit->DebugInfo = NULL; + else + { + crit->DebugInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(CRITICAL_SECTION_DEBUG)); + if (crit->DebugInfo) + { + crit->DebugInfo->Type = 0; + crit->DebugInfo->CreatorBackTraceIndex = 0; + crit->DebugInfo->CriticalSection = crit; + crit->DebugInfo->ProcessLocksList.Blink = &(crit->DebugInfo->ProcessLocksList); + crit->DebugInfo->ProcessLocksList.Flink = &(crit->DebugInfo->ProcessLocksList); + crit->DebugInfo->EntryCount = 0; + crit->DebugInfo->ContentionCount = 0; + crit->DebugInfo->Spare[0] = 0; + crit->DebugInfo->Spare[1] = 0; + } + } + crit->LockCount = -1; + crit->RecursionCount = 0; + crit->OwningThread = 0; + crit->LockSemaphore = 0; + crit->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? spincount : 0; + return STATUS_SUCCESS; } +/********************************************************************** * + * RtlSetCriticalSectionSpinCount (NTDLL.@) + * + * Sets the spin count of a critical section. + * + * PARAMS + * crit [I/O] Critical section + * spincount [I] Spin count for crit + * + * RETURNS + * The previous spin count. + * + * NOTES + * If the system is not SMP, spincount is ignored and set to 0. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlEnterCriticalSection(), + * RtlLeaveCriticalSection(), RtlTryEnterCriticalSection() + */ +ULONG STDCALL RtlSetCriticalSectionSpinCount( PCRITICAL_SECTION crit, ULONG spincount ) +{ + ULONG oldspincount = crit->SpinCount; + crit->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? spincount : 0; + return oldspincount; +} -/* - * @implemented +/********************************************************************** * + * RtlDeleteCriticalSection (NTDLL.@) + * + * Frees the resources used by a critical section. + * + * PARAMS + * crit [I/O] Critical section to free + * + * RETURNS + * STATUS_SUCCESS. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlEnterCriticalSection(), + * RtlLeaveCriticalSection(), RtlTryEnterCriticalSection() */ -NTSTATUS STDCALL -RtlInitializeCriticalSection(PCRITICAL_SECTION CriticalSection) +NTSTATUS STDCALL RtlDeleteCriticalSection( PCRITICAL_SECTION crit ) { - return RtlInitializeCriticalSectionAndSpinCount (CriticalSection, - 0); + crit->LockCount = -1; + crit->RecursionCount = 0; + crit->OwningThread = (HANDLE)0; + if (crit->LockSemaphore) + NtClose( crit->LockSemaphore ); + crit->LockSemaphore = 0; + if (crit->DebugInfo) + { + /* only free the ones we made in here */ + if (!crit->DebugInfo->Spare[1]) + { + RtlFreeHeap( RtlGetProcessHeap(), 0, crit->DebugInfo ); + crit->DebugInfo = NULL; + } + } + return STATUS_SUCCESS; } -/* - * @implemented +/********************************************************************** * + * RtlpWaitForCriticalSection (NTDLL.@) + * + * Waits for a busy critical section to become free. + * + * PARAMS + * crit [I/O] Critical section to wait for + * + * RETURNS + * STATUS_SUCCESS. + * + * NOTES + * Use RtlEnterCriticalSection() instead of this function as it is often much + * faster. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlEnterCriticalSection(), + * RtlLeaveCriticalSection(), RtlTryEnterCriticalSection() */ -VOID STDCALL -RtlLeaveCriticalSection(PCRITICAL_SECTION CriticalSection) +NTSTATUS STDCALL RtlpWaitForCriticalSection( PCRITICAL_SECTION crit ) { - HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread; - - if (CriticalSection->OwningThread != Thread) - { - DPRINT1("Freeing critical section not owned\n"); - } - - CriticalSection->RecursionCount--; - if (CriticalSection->RecursionCount > 0) - { - InterlockedDecrement(&CriticalSection->LockCount); - return; - } - CriticalSection->OwningThread = 0; - if (InterlockedDecrement(&CriticalSection->LockCount) >= 0) - { - NTSTATUS Status; - - Status = NtReleaseSemaphore(CriticalSection->LockSemaphore, 1, NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to release semaphore (Status %x)\n", - Status); - } - } + for (;;) + { + EXCEPTION_RECORD rec; + HANDLE sem = get_semaphore( crit ); + LARGE_INTEGER time; + NTSTATUS status; + + time.QuadPart = -5000 * 10000; /* 5 seconds */ + status = NtWaitForSingleObject( sem, FALSE, &time ); + if ( status == STATUS_TIMEOUT ) + { + const char *name = NULL; + if (crit->DebugInfo) name = (char *)crit->DebugInfo->Spare[1]; + if (!name) name = "?"; + DPRINT1( "section %p %s wait timed out in thread %04lx, blocked by %04lx, retrying (60 sec)\n", + crit, name, RtlGetCurrentThreadId(), (DWORD)crit->OwningThread ); + time.QuadPart = -60000 * 10000; + status = NtWaitForSingleObject( sem, FALSE, &time ); + if ( status == STATUS_TIMEOUT /*&& TRACE_ON(relay)*/ ) + { + DPRINT1( "section %p %s wait timed out in thread %04lx, blocked by %04lx, retrying (5 min)\n", + crit, name, RtlGetCurrentThreadId(), (DWORD) crit->OwningThread ); + time.QuadPart = -300000 * (ULONGLONG)10000; + status = NtWaitForSingleObject( sem, FALSE, &time ); + } + } + if (status == STATUS_WAIT_0) return STATUS_SUCCESS; + + /* Throw exception only for Wine internal locks */ + if ((!crit->DebugInfo) || (!crit->DebugInfo->Spare[1])) continue; + + rec.ExceptionCode = STATUS_POSSIBLE_DEADLOCK; + rec.ExceptionFlags = 0; + rec.ExceptionRecord = NULL; + rec.ExceptionAddress = RtlRaiseException; /* sic */ + rec.NumberParameters = 1; + rec.ExceptionInformation[0] = (DWORD)crit; + RtlRaiseException( &rec ); + } } -/* - * @implemented + +/********************************************************************** * + * RtlpUnWaitCriticalSection (NTDLL.@) + * + * Notifies other threads waiting on the busy critical section that it has + * become free. + * + * PARAMS + * crit [I/O] Critical section + * + * RETURNS + * Success: STATUS_SUCCESS. + * Failure: Any error returned by NtReleaseSemaphore() + * + * NOTES + * Use RtlLeaveCriticalSection() instead of this function as it is often much + * faster. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlEnterCriticalSection(), + * RtlLeaveCriticalSection(), RtlTryEnterCriticalSection() */ -BOOLEAN STDCALL -RtlTryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) +NTSTATUS STDCALL RtlpUnWaitCriticalSection( PCRITICAL_SECTION crit ) { - if (InterlockedCompareExchange((PVOID*)&CriticalSection->LockCount, - (PVOID)0, (PVOID)-1 ) == (PVOID)-1) - { - CriticalSection->OwningThread = - (HANDLE) NtCurrentTeb()->Cid.UniqueThread; - CriticalSection->RecursionCount = 1; - return TRUE; - } - if (CriticalSection->OwningThread == - (HANDLE)NtCurrentTeb()->Cid.UniqueThread) - { - InterlockedIncrement(&CriticalSection->LockCount); - CriticalSection->RecursionCount++; - return TRUE; - } - return FALSE; + HANDLE sem = get_semaphore( crit ); + NTSTATUS res = NtReleaseSemaphore( sem, 1, NULL ); + if (!NT_SUCCESS(res)) RtlRaiseStatus( res ); + return res; } -/* - * @implemented +/********************************************************************** * + * RtlEnterCriticalSection (NTDLL.@) + * + * Enters a critical section, waiting for it to become available if necessary. + * + * PARAMS + * crit [I/O] Critical section to enter + * + * RETURNS + * STATUS_SUCCESS. The critical section is held by the caller. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlSetCriticalSectionSpinCount(), + * RtlLeaveCriticalSection(), RtlTryEnterCriticalSection() */ -NTSTATUS STDCALL -RtlInitializeCriticalSectionAndSpinCount (PCRITICAL_SECTION CriticalSection, - ULONG SpinCount) +NTSTATUS STDCALL RtlEnterCriticalSection( PCRITICAL_SECTION crit ) { - CriticalSection->LockCount = -1; - CriticalSection->RecursionCount = 0; - CriticalSection->OwningThread = (HANDLE)0; -#ifdef MP - CriticalSection->SpinCount = SpinCount; -#else - CriticalSection->SpinCount = 0; -#endif + if (crit->SpinCount) + { + ULONG count; - return NtCreateSemaphore (&CriticalSection->LockSemaphore, - SEMAPHORE_ALL_ACCESS, - NULL, - 0, - 1); + if (RtlTryEnterCriticalSection( crit )) return STATUS_SUCCESS; + for (count = crit->SpinCount; count > 0; count--) + { + if (crit->LockCount > 0) break; /* more than one waiter, don't bother spinning */ + if (crit->LockCount == -1) /* try again */ + { + if (InterlockedCompareExchange(&crit->LockCount, 0,-1 ) == -1) goto done; + } + small_pause(); + } + } + + if (InterlockedIncrement( &crit->LockCount )) + { + if (crit->OwningThread == (HANDLE)RtlGetCurrentThreadId()) + { + crit->RecursionCount++; + return STATUS_SUCCESS; + } + + /* Now wait for it */ + RtlpWaitForCriticalSection( crit ); + } +done: + crit->OwningThread = (HANDLE)RtlGetCurrentThreadId(); + crit->RecursionCount = 1; + return STATUS_SUCCESS; } + +/********************************************************************** * + * RtlTryEnterCriticalSection (NTDLL.@) + * + * Tries to enter a critical section without waiting. + * + * PARAMS + * crit [I/O] Critical section to enter + * + * RETURNS + * Success: TRUE. The critical section is held by the caller. + * Failure: FALSE. The critical section is currently held by another thread. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlEnterCriticalSection(), + * RtlLeaveCriticalSection(), RtlSetCriticalSectionSpinCount() + */ +BOOLEAN STDCALL RtlTryEnterCriticalSection( PCRITICAL_SECTION crit ) +{ + BOOL ret = FALSE; + if (InterlockedCompareExchange(&crit->LockCount, 0L, -1 ) == -1) + { + crit->OwningThread = (HANDLE)RtlGetCurrentThreadId(); + crit->RecursionCount = 1; + ret = TRUE; + } + else if (crit->OwningThread == (HANDLE)RtlGetCurrentThreadId()) + { + InterlockedIncrement( &crit->LockCount ); + crit->RecursionCount++; + ret = TRUE; + } + return ret; +} + + +/********************************************************************** * + * RtlLeaveCriticalSection (NTDLL.@) + * + * Leaves a critical section. + * + * PARAMS + * crit [I/O] Critical section to leave. + * + * RETURNS + * STATUS_SUCCESS. + * + * SEE + * RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(), + * RtlDeleteCriticalSection(), RtlEnterCriticalSection(), + * RtlSetCriticalSectionSpinCount(), RtlTryEnterCriticalSection() + */ +NTSTATUS STDCALL RtlLeaveCriticalSection( PCRITICAL_SECTION crit ) +{ + if (crit->OwningThread != RtlGetCurrentThreadId()) + { + DPRINT1("Freeing critical section not owned\n"); + } + + if (--crit->RecursionCount) InterlockedDecrement( &crit->LockCount ); + else + { + crit->OwningThread = 0; + if (InterlockedDecrement( &crit->LockCount ) >= 0) + { + /* someone is waiting */ + RtlpUnWaitCriticalSection( crit ); + } + } + return STATUS_SUCCESS; +} + + /* EOF */
19 years, 11 months
1
0
0
0
[navaraf] 12756: Fix import of DBGHELP:
by navaraf@svn.reactos.com
Fix import of DBGHELP: - StackWalk is now compilable. - SymInitialize shouldn't try to find Wine loader. Modified: trunk/reactos/lib/dbghelp/dbghelp.c Modified: trunk/reactos/lib/dbghelp/stack.c Added: trunk/reactos/lib/dbghelp/stackframe.h Modified: trunk/reactos/lib/dbghelp/type.c _____ Modified: trunk/reactos/lib/dbghelp/dbghelp.c --- trunk/reactos/lib/dbghelp/dbghelp.c 2005-01-03 14:46:08 UTC (rev 12755) +++ trunk/reactos/lib/dbghelp/dbghelp.c 2005-01-03 14:47:11 UTC (rev 12756) @@ -230,14 +230,17 @@ if (fInvadeProcess) { +#ifndef __REACTOS__ if (!elf_read_wine_loader_dbg_info(pcs)) { SymCleanup(hProcess); return FALSE; } +#endif process_invade(hProcess); elf_synchronize_module_list(pcs); } + DbgPrint("SymInitialize - Success\n"); return TRUE; } _____ Modified: trunk/reactos/lib/dbghelp/stack.c --- trunk/reactos/lib/dbghelp/stack.c 2005-01-03 14:46:08 UTC (rev 12755) +++ trunk/reactos/lib/dbghelp/stack.c 2005-01-03 14:47:11 UTC (rev 12756) @@ -33,9 +33,7 @@ #include "thread.h" /* FIXME: must be included before winternl.h */ #include "winternl.h" #include "wine/debug.h" -#ifndef __REACTOS__ #include "stackframe.h" -#endif WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); @@ -78,7 +76,6 @@ PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE f_xlat_adr) { -#ifndef __REACTOS__ STACK32FRAME frame32; STACK16FRAME frame16; char ch; @@ -388,8 +385,4 @@ done_err: curr_mode = stm_done; return FALSE; -#else - /* FIXME */ - return FALSE; -#endif } _____ Added: trunk/reactos/lib/dbghelp/stackframe.h --- trunk/reactos/lib/dbghelp/stackframe.h 2005-01-03 14:46:08 UTC (rev 12755) +++ trunk/reactos/lib/dbghelp/stackframe.h 2005-01-03 14:47:11 UTC (rev 12756) @@ -0,0 +1,94 @@ +/* + * 16-bit and 32-bit mode stack frame layout + * + * Copyright 1995, 1998 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WINE_STACKFRAME_H +#define __WINE_STACKFRAME_H + +#include <string.h> +#include <winnt.h> +#include <excpt.h> + +#define SELECTOROF(ptr) (HIWORD(ptr)) +#define OFFSETOF(ptr) (LOWORD(ptr)) + +#include <pshpack1.h> + + /* 32-bit stack layout after CallTo16() */ +typedef struct _STACK32FRAME +{ + DWORD restore_addr; /* 00 return address for restoring code selector */ + DWORD codeselector; /* 04 code selector to restore */ + EXCEPTION_REGISTRATION_RECORD frame; /* 08 Exception frame */ + SEGPTR frame16; /* 10 16-bit frame from last CallFrom16() */ + DWORD edi; /* 14 saved registers */ + DWORD esi; /* 18 */ + DWORD ebx; /* 1c */ + DWORD ebp; /* 20 saved 32-bit frame pointer */ + DWORD retaddr; /* 24 return address */ + DWORD target; /* 28 target address / CONTEXT86 pointer */ + DWORD nb_args; /* 2c number of 16-bit argument bytes */ +} STACK32FRAME; + + /* 16-bit stack layout after CallFrom16() */ +typedef struct _STACK16FRAME +{ + STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */ + DWORD edx; /* 04 saved registers */ + DWORD ecx; /* 08 */ + DWORD ebp; /* 0c */ + WORD ds; /* 10 */ + WORD es; /* 12 */ + WORD fs; /* 14 */ + WORD gs; /* 16 */ + DWORD callfrom_ip; /* 18 callfrom tail IP */ + DWORD module_cs; /* 1c module code segment */ + DWORD relay; /* 20 relay function address */ + WORD entry_ip; /* 22 entry point IP */ + DWORD entry_point; /* 26 API entry point to call, reused as mutex count */ + WORD bp; /* 2a 16-bit stack frame chain */ + WORD ip; /* 2c return address */ + WORD cs; /* 2e */ +} STACK16FRAME; + +#include <poppack.h> + +#define CURRENT_STACK16 ((STACK16FRAME*)MapSL(NtCurrentTeb()->cur_stack)) +#define CURRENT_DS (CURRENT_STACK16->ds) + +/* Push bytes on the 16-bit stack of a thread; + * return a segptr to the first pushed byte + */ +static inline SEGPTR stack16_push( int size ) +{ + STACK16FRAME *frame = CURRENT_STACK16; + memmove( (char*)frame - size, frame, sizeof(*frame) ); + NtCurrentTeb()->cur_stack -= size; + return (SEGPTR)(NtCurrentTeb()->cur_stack + sizeof(*frame)); +} + +/* Pop bytes from the 16-bit stack of a thread */ +static inline void stack16_pop( int size ) +{ + STACK16FRAME *frame = CURRENT_STACK16; + memmove( (char*)frame + size, frame, sizeof(*frame) ); + NtCurrentTeb()->cur_stack += size; +} + +#endif /* __WINE_STACKFRAME_H */ _____ Modified: trunk/reactos/lib/dbghelp/type.c --- trunk/reactos/lib/dbghelp/type.c 2005-01-03 14:46:08 UTC (rev 12755) +++ trunk/reactos/lib/dbghelp/type.c 2005-01-03 14:47:11 UTC (rev 12756) @@ -755,9 +755,7 @@ module = module_find_by_addr(pcs, ModBase, DMT_UNKNOWN); if (!(module = module_get_debug(pcs, module))) { -#ifndef __REACTOS__ FIXME("Someone didn't properly set ModBase (%s)\n", wine_dbgstr_longlong(ModBase)); -#endif return FALSE; }
19 years, 11 months
1
0
0
0
[navaraf] 12755: Add wine_dbgstr_longlong.
by navaraf@svn.reactos.com
Add wine_dbgstr_longlong. Modified: trunk/reactos/include/wine/debug.h Modified: trunk/reactos/lib/libwine/debug.c _____ Modified: trunk/reactos/include/wine/debug.h --- trunk/reactos/include/wine/debug.h 2005-01-03 13:50:04 UTC (rev 12754) +++ trunk/reactos/include/wine/debug.h 2005-01-03 14:46:08 UTC (rev 12755) @@ -37,6 +37,7 @@ extern const char *wine_dbgstr_an( const char * s, int n ); extern const char *wine_dbgstr_wn( const wchar_t *s, int n ); extern const char *wine_dbgstr_guid( const struct _GUID *id ); +extern const char *wine_dbgstr_longlong( unsigned long long ll ); extern const char *wine_dbg_sprintf( const char *format, ... ); inline static const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); } _____ Modified: trunk/reactos/lib/libwine/debug.c --- trunk/reactos/lib/libwine/debug.c 2005-01-03 13:50:04 UTC (rev 12754) +++ trunk/reactos/lib/libwine/debug.c 2005-01-03 14:46:08 UTC (rev 12755) @@ -25,6 +25,7 @@ #include <wine/config.h> #include <wine/port.h> +#include <wine/debug.h> /* ---------------------------------------------------------------------- */ @@ -203,6 +204,12 @@ return str; } +const char *wine_dbgstr_longlong( unsigned long long ll ) +{ + if (ll >> 32) return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll ); + else return wine_dbg_sprintf( "%lx", (unsigned long)ll ); +} + /* varargs wrapper for __wine_dbg_vsprintf */ const char *wine_dbg_sprintf( const char *format, ... ) {
19 years, 11 months
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
71
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200