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
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 -----
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
[ion] 12744: Fix more wrong structure defintions that don't match official ones, plus fix little bug I introduced.
by ion@svn.reactos.com
Fix more wrong structure defintions that don't match official ones, plus fix little bug I introduced. Modified: trunk/reactos/include/ddk/setypes.h Modified: trunk/reactos/ntoskrnl/include/internal/ps.h Modified: trunk/reactos/ntoskrnl/ps/create.c Modified: trunk/reactos/ntoskrnl/se/token.c _____ Modified: trunk/reactos/include/ddk/setypes.h --- trunk/reactos/include/ddk/setypes.h 2005-01-03 01:02:26 UTC (rev 12743) +++ trunk/reactos/include/ddk/setypes.h 2005-01-03 01:13:10 UTC (rev 12744) @@ -143,12 +143,12 @@ typedef struct _SECURITY_CLIENT_CONTEXT { - SECURITY_QUALITY_OF_SERVICE SecurityQos; /* 0x00 */ - PACCESS_TOKEN Token; /* 0x0C */ - BOOLEAN DirectlyAccessClientToken; /* 0x10 */ - BOOLEAN DirectAccessEffectiveOnly; /* 0x11 */ - BOOLEAN ServerIsRemote; /* 0x12 */ - TOKEN_CONTROL ClientTokenControl; /* 0x14 */ + SECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_TOKEN ClientToken; + BOOLEAN DirectlyAccessClientToken; + BOOLEAN DirectAccessEffectiveOnly; + BOOLEAN ServerIsRemote; + TOKEN_CONTROL ClientTokenControl; } SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; _____ Modified: trunk/reactos/ntoskrnl/include/internal/ps.h --- trunk/reactos/ntoskrnl/include/internal/ps.h 2005-01-03 01:02:26 UTC (rev 12743) +++ trunk/reactos/ntoskrnl/include/internal/ps.h 2005-01-03 01:13:10 UTC (rev 12744) @@ -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: ps.h,v 1.77 2004/12/05 15:42:41 weiden Exp $ +/* $Id$ * * FILE: ntoskrnl/ke/kthread.c * PURPOSE: Process manager definitions @@ -147,10 +147,10 @@ #ifndef __USE_W32API typedef struct { - PACCESS_TOKEN Token; - BOOLEAN CopyOnOpen; - BOOLEAN EffectiveOnly; - SECURITY_IMPERSONATION_LEVEL Level; + PACCESS_TOKEN Token; + BOOLEAN CopyOnOpen; + BOOLEAN EffectiveOnly; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; } PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION; #endif _____ Modified: trunk/reactos/ntoskrnl/ps/create.c --- trunk/reactos/ntoskrnl/ps/create.c 2005-01-03 01:02:26 UTC (rev 12743) +++ trunk/reactos/ntoskrnl/ps/create.c 2005-01-03 01:13:10 UTC (rev 12744) @@ -134,7 +134,7 @@ sizeof(PS_IMPERSONATION_INFORMATION)); } - Thread->ImpersonationInfo->Level = ImpersonationLevel; + Thread->ImpersonationInfo->ImpersonationLevel = ImpersonationLevel; Thread->ImpersonationInfo->CopyOnOpen = CopyOnOpen; Thread->ImpersonationInfo->EffectiveOnly = EffectiveOnly; Thread->ImpersonationInfo->Token = Token; @@ -167,7 +167,7 @@ Token = Thread->ImpersonationInfo->Token; *TokenType = TokenImpersonation; *EffectiveOnly = Thread->ImpersonationInfo->EffectiveOnly; - *Level = Thread->ImpersonationInfo->Level; + *Level = Thread->ImpersonationInfo->ImpersonationLevel; } return(Token); } @@ -219,9 +219,9 @@ SeImpersonateClient (&ClientContext, Thread); - if (ClientContext.Token != NULL) + if (ClientContext.ClientToken != NULL) { - ObDereferenceObject (ClientContext.Token); + ObDereferenceObject (ClientContext.ClientToken); } ObDereferenceObject (ThreadToImpersonate); @@ -244,7 +244,7 @@ return NULL; } - *ImpersonationLevel = Thread->ImpersonationInfo->Level; + *ImpersonationLevel = Thread->ImpersonationInfo->ImpersonationLevel; *CopyOnOpen = Thread->ImpersonationInfo->CopyOnOpen; *EffectiveOnly = Thread->ImpersonationInfo->EffectiveOnly; ObReferenceObjectByPointer (Thread->ImpersonationInfo->Token, @@ -255,8 +255,11 @@ return Thread->ImpersonationInfo->Token; } +#ifdef PsDereferencePrimaryToken +#undef PsDereferenceImpersonationToken +#endif /* - * @unimplemented + * @implemented */ VOID STDCALL @@ -264,11 +267,16 @@ IN PACCESS_TOKEN ImpersonationToken ) { - UNIMPLEMENTED; + if (ImpersonationToken) { + ObDereferenceObject(ImpersonationToken); + } } +#ifdef PsDereferencePrimaryToken +#undef PsDereferencePrimaryToken +#endif /* - * @unimplemented + * @implemented */ VOID STDCALL @@ -276,7 +284,7 @@ IN PACCESS_TOKEN PrimaryToken ) { - UNIMPLEMENTED; + ObDereferenceObject(PrimaryToken); } /* @@ -305,7 +313,7 @@ ImpersonationState->Token = Thread->ImpersonationInfo->Token; ImpersonationState->CopyOnOpen = Thread->ImpersonationInfo->CopyOnOpen; ImpersonationState->EffectiveOnly = Thread->ImpersonationInfo->EffectiveOnly; - ImpersonationState->Level = Thread->ImpersonationInfo->Level; + ImpersonationState->Level = Thread->ImpersonationInfo->ImpersonationLevel; /* FIXME */ /* ExfReleasePushLock(&Thread->ThreadLock); */ _____ Modified: trunk/reactos/ntoskrnl/se/token.c --- trunk/reactos/ntoskrnl/se/token.c 2005-01-03 01:02:26 UTC (rev 12743) +++ trunk/reactos/ntoskrnl/se/token.c 2005-01-03 01:13:10 UTC (rev 12744) @@ -317,7 +317,6 @@ { NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; - PTOKEN TokenNew; InitializeObjectAttributes(&ObjectAttributes, NULL, @@ -332,7 +331,6 @@ PreviousMode, (PTOKEN*)&NewToken); - *NewToken = (PACCESS_TOKEN)TokenNew; return(Status); } @@ -423,7 +421,7 @@ ClientContext->SecurityQos.ContextTrackingMode = Qos->ContextTrackingMode; ClientContext->SecurityQos.EffectiveOnly = Qos->EffectiveOnly; ClientContext->ServerIsRemote = RemoteClient; - ClientContext->Token = NewToken; + ClientContext->ClientToken = NewToken; return(STATUS_SUCCESS); } @@ -511,7 +509,7 @@ ServerThread = PsGetCurrentThread(); } PsImpersonateClient(ServerThread, - ClientContext->Token, + ClientContext->ClientToken, 1, (ULONG)b, ClientContext->SecurityQos.ImpersonationLevel);
19 years, 10 months
1
0
0
0
[royce] 12743: XML parsing working with my local sample build script. Now we need to start coding the makefile-generation
by royce@svn.reactos.com
XML parsing working with my local sample build script. Now we need to start coding the makefile-generation Added: branches/xmlbuildsystem/reactos/tools/rbuild.cpp _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild.cpp 2005-01-03 00:46:42 UTC (rev 12742) +++ branches/xmlbuildsystem/reactos/tools/rbuild.cpp 2005-01-03 01:02:26 UTC (rev 12743) @@ -0,0 +1,318 @@ +// 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, 10 months
1
0
0
0
[chorns] 12739: Add sample build script.
by chorns@svn.reactos.com
Add sample build script. Added: branches/xmlbuildsystem/reactos/ReactOS.xml _____ Added: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-02 20:51:02 UTC (rev 12738) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-02 22:17:02 UTC (rev 12739) @@ -0,0 +1,372 @@ +<project name="ReactOS"> + <directory name="tools"> + <module name="depends" type="buildtool"> + <file>depends.c</file> + </module> + </directory> + <directory name="ntoskrnl"> + <module name="ntoskrnl" type="kernelmodedll"> + <include>./include</include> + <include>../lib/kjs/include</include> + <library>kjs</library> + <directory name="cc"> + <file>cacheman.c</file> + <file>copy.c</file> + <file>fs.c</file> + <file>mdl.c</file> + <file>misc.c</file> + <file>pin.c</file> + <file>view.c</file> + </directory> + <directory name="cm"> + <file>import.c</file> + <file>ntfunc.c</file> + <file>regfile.c</file> + <file>registry.c</file> + <file>regobj.c</file> + <file>rtlfunc.c</file> + </directory> + <directory name="dbg"> + <if property="arch" value="i386"> + <directory name="i386"> + <if property="kdbg" value="true"> + <group> + <file>i386-dis.c</file> + <file>kdb_help.S</file> + </group> + </if> + </directory> + </if> + <if property="kdbg" value="true"> + <group> + <file>kdb.c</file> + <file>kdb_keyboard.c</file> + <file>kdb_serial.c</file> + <file>profile.c</file> + <file>rdebug.c</file> + </group> + </if> + <or> + <if property="kdbg" value="true"> + <group> + <file>kdb_stabs.c</file> + <file>kdb_symbols.c</file> + </group> + </if> + <if property="dbg" value="true"> + <group> + <file>kdb_stabs.c</file> + <file>kdb_symbols.c</file> + </group> + </if> + </or> + <file>user.c</file> + <file>dbgctrl.c</file> + <file>errinfo.c</file> + <file>print.c</file> + </directory> + <directory name="ex"> + <if property="arch" value="i386"> + <directory name="i386"> + <file>interlck.c</file> + </directory> + </if> + <file>btree.c</file> + <file>callback.c</file> + <file>fmutex.c</file> + <file>hashtab.c</file> + <file>init.c</file> + <file>interlck.c</file> + <file>list.c</file> + <file>lookas.c</file> + <file>napi.c</file> + <file>power.c</file> + <file>resource.c</file> + <file>rundown.c</file> + <file>stree.c</file> + <file>synch.c</file> + <file>sysinfo.c</file> + <file>time.c</file> + <file>util.c</file> + <file>uuid.c</file> + <file>win32k.c</file> + <file>work.c</file> + <file>zone.c</file> + </directory> + <directory name="fs"> + <file>dbcsname.c</file> + <file>filelock.c</file> + <file>mcb.c</file> + <file>mdl.c</file> + <file>name.c</file> + <file>notify.c</file> + <file>oplock.c</file> + <file>pool.c</file> + <file>tunnel.c</file> + <file>unc.c</file> + <file>util.c</file> + </directory> + <directory name="inbv"> + <if property="arch" value="i386"> + <directory name="i386"> + </directory> + </if> + <file>inbv.c</file> + </directory> + <directory name="io"> + <file>adapter.c</file> + <file>arcname.c</file> + <file>bootlog.c</file> + <file>buildirp.c</file> + <file>cancel.c</file> + <file>cleanup.c</file> + <file>cntrller.c</file> + <file>create.c</file> + <file>device.c</file> + <file>deviface.c</file> + <file>dir.c</file> + <file>driver.c</file> + <file>errlog.c</file> + <file>error.c</file> + <file>event.c</file> + <file>file.c</file> + <file>flush.c</file> + <file>fs.c</file> + <file>iocomp.c</file> + <file>ioctrl.c</file> + <file>iomgr.c</file> + <file>iowork.c</file> + <file>irp.c</file> + <file>irq.c</file> + <file>lock.c</file> + <file>mailslot.c</file> + <file>mdl.c</file> + <file>npipe.c</file> + <file>page.c</file> + <file>parttab.c</file> + <file>pnpdma.c</file> + <file>pnpmgr.c</file> + <file>pnpnotify.c</file> + <file>pnpreport.c</file> + <file>pnproot.c</file> + <file>process.c</file> + <file>queue.c</file> + <file>rawfs.c</file> + <file>remlock.c</file> + <file>resource.c</file> + <file>rw.c</file> + <file>share.c</file> + <file>shutdown.c</file> + <file>symlink.c</file> + <file>timer.c</file> + <file>vpb.c</file> + <file>wdm.c</file> + <file>wmi.c</file> + <file>xhaldisp.c</file> + <file>xhaldrv.c</file> + </directory> + <directory name="kd"> + <file>dlog.c</file> + <file>gdbstub.c</file> + <file>kdebug.c</file> + <file>mda.c</file> + <file>service.c</file> + </directory> + <directory name="ke"> + <if property="arch" value="i386"> + <directory name="i386"> + <file>bios.c</file> + <file>brkpoint.c</file> + <file>bthread.S</file> + <file>exp.c</file> + <file>fpu.c</file> + <file>gdt.c</file> + <file>i386-mcount.S</file> + <file>idt.c</file> + <file>irq.c</file> + <file>irqhand.S</file> + <file>kernel.c</file> + <file>kernel.c</file> + <file>ldt.c</file> + <file>multiboot.S</file> + <file>stkswitch.S</file> + <file>syscall.S</file> + <file>thread.c</file> + <file>tlbflush.S</file> + <file>trap.S</file> + <file>tskswitch.S</file> + <file>tss.c</file> + <file>usercall.c</file> + <file>usertrap.c</file> + <file>v86m.c</file> + <file>v86m_sup.S</file> + </directory> + </if> + <file>apc.c</file> + <file>bug.c</file> + <file>catch.c</file> + <file>critical.c</file> + <file>device.c</file> + <file>dpc.c</file> + <file>error.c</file> + <file>event.c</file> + <file>gmutex.c</file> + <file>ipi.c</file> + <file>kqueue.c</file> + <file>kthread.c</file> + <file>main.c</file> + <file>mutex.c</file> + <file>process.c</file> + <file>profile.c</file> + <file>queue.c</file> + <file>sem.c</file> + <file>spinlock.c</file> + <file>timer.c</file> + <file>wait.c</file> + </directory> + <directory name="ldr"> + <file>init.c</file> + <file>loader.c</file> + <file>resource.c</file> + <file>rtl.c</file> + <file>sysdll.c</file> + <file>userldr.c</file> + </directory> + <directory name="lpc"> + <file>close.c</file> + <file>complete.c</file> + <file>connect.c</file> + <file>create.c</file> + <file>listen.c</file> + <file>port.c</file> + <file>query.c</file> + <file>queue.c</file> + <file>receive.c</file> + <file>reply.c</file> + <file>send.c</file> + </directory> + <directory name="mm"> + <if property="arch" value="i386"> + <directory name="i386"> + <file>memsafe.s</file> + <file>page.c</file> + <file>pfault.c</file> + </directory> + </if> + <file>anonmem.c</file> + <file>aspace.c</file> + <file>balance.c</file> + <file>cont.c</file> + <file>drvlck.c</file> + <file>freelist.c</file> + <file>iospace.c</file> + <file>kmap.c</file> + <file>marea.c</file> + <file>mdl.c</file> + <file>mm.c</file> + <file>mminit.c</file> + <file>mpw.c</file> + <file>ncache.c</file> + <file>npool.c</file> + <file>pagefile.c</file> + <file>pageop.c</file> + <file>pager.c</file> + <file>pagfault.c</file> + <file>paging.c</file> + <file>physical.c</file> + <file>pool.c</file> + <file>ppool.c</file> + <file>region.c</file> + <file>rmap.c</file> + <file>section.c</file> + <file>slab.c</file> + <file>verifier.c</file> + <file>virtual.c</file> + <file>wset.c</file> + </directory> + <directory name="nt"> + <file>channel.c</file> + <file>efi.c</file> + <file>evtpair.c</file> + <file>misc.c</file> + <file>mutant.c</file> + <file>nt.c</file> + <file>ntevent.c</file> + <file>ntsem.c</file> + <file>nttimer.c</file> + <file>plugplay.c</file> + <file>profile.c</file> + <file>vdm.c</file> + </directory> + <directory name="ob"> + <file>dirobj.c</file> + <file>handle.c</file> + <file>namespc.c</file> + <file>ntobj.c</file> + <file>object.c</file> + <file>sdcache.c</file> + <file>security.c</file> + <file>symlink.c</file> + </directory> + <directory name="po"> + <file>power.c</file> + </directory> + <directory name="ps"> + <if property="arch" value="i386"> + <directory name="i386"> + <file>continue.c</file> + </directory> + </if> + <file>cid.c</file> + <file>create.c</file> + <file>debug.c</file> + <file>idle.c</file> + <file>job.c</file> + <file>kill.c</file> + <file>locale.c</file> + <file>process.c</file> + <file>psmgr.c</file> + <file>suspend.c</file> + <file>thread.c</file> + <file>tinfo.c</file> + <file>w32call.c</file> + <file>win32.c</file> + </directory> + <directory name="rtl"> + <if property="arch" value="i386"> + <directory name="i386"> + <file>exception.c</file> + </directory> + </if> + <file>atom.c</file> + <file>capture.c</file> + <file>ctype.c</file> + <file>handle.c</file> + <file>libsupp.c</file> + <file>message.c</file> + <file>nls.c</file> + <file>purecall.c</file> + <file>rangelist.c</file> + <file>regio.c</file> + <file>sprintf.c</file> + <file>stdlib.c</file> + <file>string.c</file> + <file>strtok.c</file> + <file>swprintf.c</file> + <file>wstring.c</file> + </directory> + <directory name="se"> + <file>access.c</file> + <file>acl.c</file> + <file>audit.c</file> + <file>lsa.c</file> + <file>luid.c</file> + <file>priv.c</file> + <file>sd.c</file> + <file>semgr.c</file> + <file>sid.c</file> + <file>token.c</file> + </directory> + </module> + </directory> +</project>
19 years, 10 months
2
1
0
0
[gvg] 12742: Don't destroy cursors/icons prematurely.
by gvg@svn.reactos.com
Don't destroy cursors/icons prematurely. Modified: trunk/reactos/include/napi/win32.h Modified: trunk/reactos/lib/user32/windows/bitmap.c Modified: trunk/reactos/subsys/win32k/include/cursoricon.h Modified: trunk/reactos/subsys/win32k/main/dllmain.c Modified: trunk/reactos/subsys/win32k/ntuser/cursoricon.c _____ Modified: trunk/reactos/include/napi/win32.h --- trunk/reactos/include/napi/win32.h 2005-01-02 23:46:28 UTC (rev 12741) +++ trunk/reactos/include/napi/win32.h 2005-01-03 00:46:42 UTC (rev 12742) @@ -28,8 +28,6 @@ LIST_ENTRY MenuListHead; FAST_MUTEX PrivateFontListLock; LIST_ENTRY PrivateFontListHead; - FAST_MUTEX CursorIconListLock; - LIST_ENTRY CursorIconListHead; struct _KBDTABLES* KeyboardLayout; ULONG Flags; LONG GDIObjects; _____ Modified: trunk/reactos/lib/user32/windows/bitmap.c --- trunk/reactos/lib/user32/windows/bitmap.c 2005-01-02 23:46:28 UTC (rev 12741) +++ trunk/reactos/lib/user32/windows/bitmap.c 2005-01-03 00:46:42 UTC (rev 12742) @@ -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: bitmap.c,v 1.34 2004/12/19 05:00:22 royce Exp $ +/* $Id$ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -149,7 +149,7 @@ hIcon = (HANDLE)CreateIconFromResourceEx((PBYTE)ResIcon, SizeofResource(hinst, h2Resource), FALSE, 0x00030000, 32, 32, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); - if (hIcon) + if (hIcon && 0 != (fuLoad & LR_SHARED)) { NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes, (HRSRC)NULL); @@ -157,100 +157,98 @@ return hIcon; } - else + + if (fuLoad & LR_SHARED) { - if (fuLoad & LR_SHARED) - { - DbgPrint("FIXME: need LR_SHARED support loading cursor images from files\n"); - } + DbgPrint("FIXME: need LR_SHARED support loading cursor images from files\n"); + } - hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, 0, NULL); - if (hFile == NULL) - { - return NULL; - } + hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, 0, NULL); + if (hFile == NULL) + { + return NULL; + } - hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); - CloseHandle(hFile); - if (hSection == NULL) - { - return NULL; - } + hSection = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); + CloseHandle(hFile); + if (hSection == NULL) + { + return NULL; + } - IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); - CloseHandle(hSection); - if (IconDIR == NULL || 0 != IconDIR->idReserved - || (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) - { - return NULL; - } + IconDIR = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); + CloseHandle(hSection); + if (IconDIR == NULL || 0 != IconDIR->idReserved + || (IMAGE_ICON != IconDIR->idType && IMAGE_CURSOR != IconDIR->idType)) + { + return NULL; + } - /* - * Get a handle to the screen dc, the icon we create is going to be - * compatable with it. + /* + * Get a handle to the screen dc, the icon we create is going to be + * compatable with it. + */ + hScreenDc = CreateCompatibleDC(0); + if (hScreenDc == NULL) + { + UnmapViewOfFile(IconDIR); + return NULL; + } + + if (fuLoad & LR_MONOCHROME) + { + ColorBits = 1; + } + else + { + ColorBits = GetDeviceCaps(hScreenDc, BITSPIXEL); + /* + * FIXME: + * Remove this after proper support for alpha icons will be finished. */ - hScreenDc = CreateCompatibleDC(0); - if (hScreenDc == NULL) - { - UnmapViewOfFile(IconDIR); - return NULL; - } + if (ColorBits > 8) + ColorBits = 8; + } - if (fuLoad & LR_MONOCHROME) - { - ColorBits = 1; - } - else - { - ColorBits = GetDeviceCaps(hScreenDc, BITSPIXEL); - /* - * FIXME: - * Remove this after proper support for alpha icons will be finished. - */ - if (ColorBits > 8) - ColorBits = 8; - } - - /* Pick the best size. */ - dirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestIcon(IconDIR, 32, 32, ColorBits); - if (!dirEntry) - { - UnmapViewOfFile(IconDIR); - return(NULL); - } - - SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); - memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); + /* Pick the best size. */ + dirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestIcon(IconDIR, 32, 32, ColorBits); + if (!dirEntry) + { + UnmapViewOfFile(IconDIR); + return(NULL); } - //at this point we have a copy of the icon image to play with + SafeIconImage = RtlAllocateHeap(GetProcessHeap(), 0, dirEntry->dwBytesInRes); + memcpy(SafeIconImage, ((PBYTE)IconDIR) + dirEntry->dwImageOffset, dirEntry->dwBytesInRes); - SafeIconImage->icHeader.biHeight = SafeIconImage->icHeader.biHeight /2; + /* at this point we have a copy of the icon image to play with */ - if (SafeIconImage->icHeader.biSize == sizeof(BITMAPCOREHEADER)) - { + SafeIconImage->icHeader.biHeight = SafeIconImage->icHeader.biHeight /2; + + if (SafeIconImage->icHeader.biSize == sizeof(BITMAPCOREHEADER)) + { BITMAPCOREHEADER* Core = (BITMAPCOREHEADER*)SafeIconImage; ColorCount = (Core->bcBitCount <= 8) ? (1 << Core->bcBitCount) : 0; HeaderSize = sizeof(BITMAPCOREHEADER) + ColorCount * sizeof(RGBTRIPLE); - } - else - { + } + else + { ColorCount = SafeIconImage->icHeader.biClrUsed; if (ColorCount == 0 && SafeIconImage->icHeader.biBitCount <= 8) { ColorCount = 1 << SafeIconImage->icHeader.biBitCount; } HeaderSize = sizeof(BITMAPINFOHEADER) + ColorCount * sizeof(RGBQUAD); - } + } - //make data point to the start of the XOR image data - Data = (PBYTE)SafeIconImage + HeaderSize; + /* make data point to the start of the XOR image data */ + Data = (PBYTE)SafeIconImage + HeaderSize; - hIcon = ICON_CreateCursorFromData(hScreenDc, Data, SafeIconImage, 32, 32, dirEntry->Info.cursor.wXHotspot, dirEntry->Info.cursor.wYHotspot); - DeleteDC(hScreenDc); - RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); - return hIcon; + hIcon = ICON_CreateCursorFromData(hScreenDc, Data, SafeIconImage, 32, 32, dirEntry->Info.cursor.wXHotspot, dirEntry->Info.cursor.wYHotspot); + DeleteDC(hScreenDc); + RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage); + return hIcon; } @@ -326,7 +324,7 @@ hIcon = (HANDLE)CreateIconFromResourceEx((PBYTE) ResIcon, SizeofResource(hinst, h2Resource), TRUE, 0x00030000, width, height, fuLoad & (LR_DEFAULTCOLOR | LR_MONOCHROME)); - if(hIcon) + if (hIcon && 0 != (fuLoad & LR_SHARED)) { NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, (HRSRC)hfRes, (HRSRC)NULL); _____ Modified: trunk/reactos/subsys/win32k/include/cursoricon.h --- trunk/reactos/subsys/win32k/include/cursoricon.h 2005-01-02 23:46:28 UTC (rev 12741) +++ trunk/reactos/subsys/win32k/include/cursoricon.h 2005-01-03 00:46:42 UTC (rev 12742) @@ -3,11 +3,18 @@ #define MAXCURICONHANDLES 4096 +typedef struct tagCURICON_PROCESS +{ + LIST_ENTRY ListEntry; + PW32PROCESS Process; +} CURICON_PROCESS, *PCURICON_PROCESS; + typedef struct _CURICON_OBJECT { + LIST_ENTRY ListEntry; HANDLE Self; - LIST_ENTRY ListEntry; - PW32PROCESS Process; + FAST_MUTEX Lock; + LIST_ENTRY ProcessList; HMODULE hModule; HRSRC hRsrc; HRSRC hGroupRsrc; _____ Modified: trunk/reactos/subsys/win32k/main/dllmain.c --- trunk/reactos/subsys/win32k/main/dllmain.c 2005-01-02 23:46:28 UTC (rev 12741) +++ trunk/reactos/subsys/win32k/main/dllmain.c 2005-01-03 00:46:42 UTC (rev 12742) @@ -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: dllmain.c,v 1.86 2004/12/29 19:55:01 gvg Exp $ +/* $Id$ * * Entry Point for win32k.sys */ @@ -71,9 +71,6 @@ InitializeListHead(&Win32Process->PrivateFontListHead); ExInitializeFastMutex(&Win32Process->PrivateFontListLock); - InitializeListHead(&Win32Process->CursorIconListHead); - ExInitializeFastMutex(&Win32Process->CursorIconListLock); - Win32Process->KeyboardLayout = W32kGetDefaultKeyLayout(); /* setup process flags */ _____ Modified: trunk/reactos/subsys/win32k/ntuser/cursoricon.c --- trunk/reactos/subsys/win32k/ntuser/cursoricon.c 2005-01-02 23:46:28 UTC (rev 12741) +++ trunk/reactos/subsys/win32k/ntuser/cursoricon.c 2005-01-03 00:46:42 UTC (rev 12742) @@ -16,9 +16,32 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cursoricon.c,v 1.5 2004/12/30 02:32:18 navaraf Exp $ */ + +/* + * We handle two types of cursors/icons: + * - Private + * Loaded without LR_SHARED flag + * Private to a process + * Can be deleted by calling NtDestroyCursorIcon() + * CurIcon->hModule, CurIcon->hRsrc and CurIcon->hGroupRsrc set to NULL + * - Shared + * Loaded with LR_SHARED flag + * Possibly shared by multiple processes + * Immune to NtDestroyCursorIcon() + * CurIcon->hModule, CurIcon->hRsrc and CurIcon->hGroupRsrc are valid + * There's a M:N relationship between processes and (shared) cursor/icons. + * A process can have multiple cursor/icons and a cursor/icon can be used + * by multiple processes. To keep track of this we keep a list of all + * cursor/icons (CurIconList) and per cursor/icon we keep a list of + * CURICON_PROCESS structs starting at CurIcon->ProcessList. + */ + #include <w32k.h> +static PAGED_LOOKASIDE_LIST ProcessLookasideList; +static LIST_ENTRY CurIconList; +static FAST_MUTEX CurIconListLock; + PCURICON_OBJECT FASTCALL IntGetCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle) { @@ -248,48 +271,97 @@ BOOL FASTCALL IntSetupCurIconHandles(PWINSTATION_OBJECT WinStaObject) { + ExInitializePagedLookasideList(&ProcessLookasideList, + NULL, + NULL, + 0, + sizeof(CURICON_PROCESS), + 0, + 128); + InitializeListHead(&CurIconList); + ExInitializeFastMutex(&CurIconListLock); + return TRUE; } +/* + * We have to register that this object is in use by the current + * process. The only way to do that seems to be to walk the list + * of cursor/icon objects starting at W32Process->CursorIconListHead. + * If the object is already present in the list, we don't have to do + * anything, if it's not present we add it and inc the ProcessCount + * in the object. Having to walk the list kind of sucks, but that's + * life... + */ +static BOOLEAN FASTCALL +ReferenceCurIconByProcess(PCURICON_OBJECT Object) +{ + PW32PROCESS Win32Process; + PLIST_ENTRY Search; + PCURICON_PROCESS Current; + + Win32Process = PsGetWin32Process(); + + ExAcquireFastMutex(&Object->Lock); + Search = Object->ProcessList.Flink; + while (Search != &Object->ProcessList) + { + Current = CONTAINING_RECORD(Search, CURICON_PROCESS, ListEntry); + if (Current->Process == Win32Process) + { + /* Already registered for this process */ + ExReleaseFastMutex(&Object->Lock); + return TRUE; + } + Search = Search->Flink; + } + + /* Not registered yet */ + Current = ExAllocateFromPagedLookasideList(&ProcessLookasideList); + if (NULL == Current) + { + return FALSE; + } + InsertHeadList(&Object->ProcessList, &Current->ListEntry); + Current->Process = Win32Process; + + ExReleaseFastMutex(&Object->Lock); + return TRUE; +} + PCURICON_OBJECT FASTCALL IntFindExistingCurIconObject(PWINSTATION_OBJECT WinStaObject, HMODULE hModule, HRSRC hRsrc, LONG cx, LONG cy) { - PUSER_HANDLE_TABLE HandleTable; PLIST_ENTRY CurrentEntry; - PUSER_HANDLE_BLOCK Current; PCURICON_OBJECT Object; - ULONG i; - - HandleTable = (PUSER_HANDLE_TABLE)WinStaObject->HandleTable; - ObmpLockHandleTable(HandleTable); - - CurrentEntry = HandleTable->ListHead.Flink; - while(CurrentEntry != &HandleTable->ListHead) + + ExAcquireFastMutex(&CurIconListLock); + + CurrentEntry = CurIconList.Flink; + while (CurrentEntry != &CurIconList) { - Current = CONTAINING_RECORD(CurrentEntry, USER_HANDLE_BLOCK, ListEntry); - for(i = 0; i < HANDLE_BLOCK_ENTRIES; i++) + Object = CONTAINING_RECORD(CurrentEntry, CURICON_OBJECT, ListEntry); + CurrentEntry = CurrentEntry->Flink; + if((Object->hModule == hModule) && (Object->hRsrc == hRsrc)) { - Object = (PCURICON_OBJECT)Current->Handles[i].ObjectBody; - if(Object && (ObmReferenceObjectByPointer(Object, otCursorIcon) == STATUS_SUCCESS)) + if(cx && ((cx != Object->Size.cx) || (cy != Object->Size.cy))) { - if((Object->hModule == hModule) && (Object->hRsrc == hRsrc)) - { - if(cx && ((cx != Object->Size.cx) || (cy != Object->Size.cy))) - { - ObmDereferenceObject(Object); - continue; - } - ObmpUnlockHandleTable(HandleTable); - return Object; - } ObmDereferenceObject(Object); + continue; } + if (! ReferenceCurIconByProcess(Object)) + { + ExReleaseFastMutex(&CurIconListLock); + return NULL; + } + ExReleaseFastMutex(&CurIconListLock); + return Object; } - CurrentEntry = CurrentEntry->Flink; } - ObmpUnlockHandleTable(HandleTable); + ExReleaseFastMutex(&CurIconListLock); + return NULL; } @@ -298,7 +370,6 @@ { PCURICON_OBJECT Object; HANDLE Handle; - PW32PROCESS Win32Process; Object = ObmCreateObject(WinStaObject->HandleTable, &Handle, otCursorIcon, sizeof(CURICON_OBJECT)); @@ -308,39 +379,90 @@ return FALSE; } - Win32Process = PsGetWin32Process(); - - IntLockProcessCursorIcons(Win32Process); - InsertTailList(&Win32Process->CursorIconListHead, &Object->ListEntry); - IntUnLockProcessCursorIcons(Win32Process); - Object->Self = Handle; - Object->Process = PsGetWin32Process(); - + ExInitializeFastMutex(&Object->Lock); + InitializeListHead(&Object->ProcessList); + + if (! ReferenceCurIconByProcess(Object)) + { + DPRINT1("Failed to add process\n"); + ObmCloseHandle(WinStaObject->HandleTable, Handle); + ObmDereferenceObject(Object); + return NULL; + } + + ExAcquireFastMutex(&CurIconListLock); + InsertHeadList(&CurIconList, &Object->ListEntry); + ExReleaseFastMutex(&CurIconListLock); + + ObmDereferenceObject(Object); + return Object; } -BOOL FASTCALL -IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, HANDLE Handle, BOOL RemoveFromProcess) +BOOLEAN FASTCALL +IntDestroyCurIconObject(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT Object, BOOL ProcessCleanup) { PSYSTEM_CURSORINFO CurInfo; - PCURICON_OBJECT Object; HBITMAP bmpMask, bmpColor; - NTSTATUS Status; - BOOL Ret; - - Status = ObmReferenceObjectByHandle(WinStaObject->HandleTable, Handle, otCursorIcon, (PVOID*)&Object); - if(!NT_SUCCESS(Status)) - { - return FALSE; - } - - if (Object->Process != PsGetWin32Process()) - { - ObmDereferenceObject(Object); - return FALSE; - } + BOOLEAN Ret; + PLIST_ENTRY Search; + PCURICON_PROCESS Current; + PW32PROCESS W32Process = PsGetWin32Process(); + ExAcquireFastMutex(&Object->Lock); + + /* Private objects can only be destroyed by their own process */ + if (NULL == Object->hModule) + { + ASSERT(Object->ProcessList.Flink->Flink == &Object->ProcessList); + Current = CONTAINING_RECORD(Object->ProcessList.Flink, CURICON_PROCESS, ListEntry); + if (Current->Process != W32Process) + { + ExReleaseFastMutex(&Object->Lock); + DPRINT1("Trying to destroy private icon/cursor of another process\n"); + return FALSE; + } + } + else if (! ProcessCleanup) + { + ExReleaseFastMutex(&Object->Lock); + DPRINT("Trying to destroy shared icon/cursor\n"); + return FALSE; + } + + /* Now find this process in the list of processes referencing this object and + remove it from that list */ + Search = Object->ProcessList.Flink; + while (Search != &Object->ProcessList) + { + Current = CONTAINING_RECORD(Object->ProcessList.Flink, CURICON_PROCESS, ListEntry); + if (Current->Process == W32Process) + { + break; + } + Search = Search->Flink; + } + ASSERT(Search != &Object->ProcessList); + RemoveEntryList(Search); + ExFreeToPagedLookasideList(&ProcessLookasideList, Current); + + /* If there are still processes referencing this object we can't destroy it yet */ + if (! IsListEmpty(&Object->ProcessList)) + { + ExReleaseFastMutex(&Object->Lock); + return TRUE; + } + + ExReleaseFastMutex(&Object->Lock); + + if (! ProcessCleanup) + { + ExAcquireFastMutex(&CurIconListLock); + RemoveEntryList(&Object->ListEntry); + ExReleaseFastMutex(&CurIconListLock); + } + CurInfo = IntGetSysCursorInfo(WinStaObject); if (CurInfo->CurrentCursorObject == Object) @@ -351,15 +473,8 @@ bmpMask = Object->IconInfo.hbmMask; bmpColor = Object->IconInfo.hbmColor; - - if (Object->Process && RemoveFromProcess) - { - IntLockProcessCursorIcons(Object->Process); - RemoveEntryList(&Object->ListEntry); - IntUnLockProcessCursorIcons(Object->Process); - } - Ret = NT_SUCCESS(ObmCloseHandle(WinStaObject->HandleTable, Handle)); + Ret = NT_SUCCESS(ObmCloseHandle(WinStaObject->HandleTable, Object->Self)); /* delete bitmaps */ if(bmpMask) @@ -372,8 +487,6 @@ GDIOBJ_SetOwnership(bmpColor, PsGetCurrentProcess()); NtGdiDeleteObject(bmpColor); } - - ObmDereferenceObject(Object); return Ret; } @@ -382,23 +495,50 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process) { PWINSTATION_OBJECT WinStaObject; - PCURICON_OBJECT Current; - PLIST_ENTRY CurrentEntry, NextEntry; - + PLIST_ENTRY CurrentEntry; + PCURICON_OBJECT Object; + PLIST_ENTRY ProcessEntry; + PCURICON_PROCESS ProcessData; + WinStaObject = IntGetWinStaObj(); - if(WinStaObject != NULL) + if(WinStaObject == NULL) { - CurrentEntry = Win32Process->CursorIconListHead.Flink; - while(CurrentEntry != &Win32Process->CursorIconListHead) - { - NextEntry = CurrentEntry->Flink; - Current = CONTAINING_RECORD(CurrentEntry, CURICON_OBJECT, ListEntry); - RemoveEntryList(&Current->ListEntry); - IntDestroyCurIconObject(WinStaObject, Current->Self, FALSE); - CurrentEntry = NextEntry; + return; + } + + ExAcquireFastMutex(&CurIconListLock); + + CurrentEntry = CurIconList.Flink; + while (CurrentEntry != &CurIconList) + { + Object = CONTAINING_RECORD(CurrentEntry, CURICON_OBJECT, ListEntry); + CurrentEntry = CurrentEntry->Flink; + if(NT_SUCCESS(ObmReferenceObjectByPointer(Object, otCursorIcon))) + { + ExAcquireFastMutex(&Object->Lock); + ProcessEntry = Object->ProcessList.Flink; + while (ProcessEntry != &Object->ProcessList) + { + ProcessData = CONTAINING_RECORD(ProcessEntry, CURICON_PROCESS, ListEntry); + if (Win32Process == ProcessData->Process) + { + ExReleaseFastMutex(&Object->Lock); + RemoveEntryList(&Object->ListEntry); + IntDestroyCurIconObject(WinStaObject, Object, TRUE); + break; + } + ProcessEntry = ProcessEntry->Flink; + } + if (ProcessEntry == &Object->ProcessList) + { + ExReleaseFastMutex(&Object->Lock); + } + ObmDereferenceObject(Object); } - ObDereferenceObject(WinStaObject); } + + ExReleaseFastMutex(&CurIconListLock); + ObDereferenceObject(WinStaObject); } /* @@ -729,6 +869,8 @@ DWORD Unknown) { PWINSTATION_OBJECT WinStaObject; + PCURICON_OBJECT Object; + NTSTATUS Status; WinStaObject = IntGetWinStaObj(); if(WinStaObject == NULL) @@ -736,14 +878,24 @@ return FALSE; } - if(IntDestroyCurIconObject(WinStaObject, Handle, TRUE)) + Status = ObmReferenceObjectByHandle(WinStaObject->HandleTable, Handle, otCursorIcon, (PVOID*)&Object); + if(!NT_SUCCESS(Status)) { ObDereferenceObject(WinStaObject); + SetLastNtError(Status); + return FALSE; + } + + if(IntDestroyCurIconObject(WinStaObject, Object, FALSE)) + { + ObmDereferenceObject(Object); + ObDereferenceObject(WinStaObject); return TRUE; } + ObmDereferenceObject(Object); + ObDereferenceObject(WinStaObject); SetLastWin32Error(ERROR_INVALID_CURSOR_HANDLE); - ObDereferenceObject(WinStaObject); return FALSE; }
19 years, 10 months
1
0
0
0
[arty] 12741: Change temporary file creation to tmpfile(). FullName was not initialized
by arty@svn.reactos.com
Change temporary file creation to tmpfile(). FullName was not initialized correctly before and it's only by chance that this worked at all. Modified: trunk/reactos/tools/cabman/cabinet.cxx _____ Modified: trunk/reactos/tools/cabman/cabinet.cxx --- trunk/reactos/tools/cabman/cabinet.cxx 2005-01-02 23:12:40 UTC (rev 12740) +++ trunk/reactos/tools/cabman/cabinet.cxx 2005-01-02 23:46:28 UTC (rev 12741) @@ -188,7 +188,7 @@ return CAB_STATUS_FAILURE; #else /* !WIN32 */ fclose(FileHandle); - FileHandle = fopen(FullName, "w+b"); + FileHandle = tmpfile(); if (FileHandle == NULL) { DPRINT(MID_TRACE, ("ERROR '%d'.\n", (unsigned int)errno)); return CAB_STATUS_FAILURE; @@ -532,6 +532,7 @@ return false; } #else /* !WIN32 */ + FileHandle = fopen(ConvertPath(FileName, true), "rb"); if (FileHandle == NULL) { DPRINT(MID_TRACE, ("Cannot open cabinet reserved file.\n"));
19 years, 10 months
1
0
0
0
[ion] 12740: Fix my previous patch and fix ACCESS_TOKEN being declared as a structure. This is incompatible with DDK/W32API because ACCESS_TOKEN is a PVOID. The real structure is TOKEN. Also, structure has been updated.
by ion@svn.reactos.com
Fix my previous patch and fix ACCESS_TOKEN being declared as a structure. This is incompatible with DDK/W32API because ACCESS_TOKEN is a PVOID. The real structure is TOKEN. Also, structure has been updated. Modified: trunk/reactos/apps/utils/objdir/objdir.c Modified: trunk/reactos/include/ddk/setypes.h Modified: trunk/reactos/lib/kernel32/file/dosdev.c Modified: trunk/reactos/ntoskrnl/include/internal/se.h Modified: trunk/reactos/ntoskrnl/ps/create.c Modified: trunk/reactos/ntoskrnl/se/acl.c Modified: trunk/reactos/ntoskrnl/se/priv.c Modified: trunk/reactos/ntoskrnl/se/semgr.c Modified: trunk/reactos/ntoskrnl/se/token.c Modified: trunk/reactos/subsys/system/services/database.c Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c Modified: trunk/reactos/w32api/include/ddk/ntapi.h _____ Modified: trunk/reactos/apps/utils/objdir/objdir.c --- trunk/reactos/apps/utils/objdir/objdir.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/apps/utils/objdir/objdir.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: objdir.c,v 1.14 2004/08/05 12:11:49 ea Exp $ +/* $Id$ * * DESCRIPTION: Object Manager Simple Explorer * PROGRAMMER: David Welch @@ -173,8 +173,8 @@ OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status; HANDLE DirectoryHandle; - BYTE DirectoryEntry [MAX_DIR_ENTRY * sizeof(DIRECTORY_BASIC_INFORMATION)]; - PDIRECTORY_BASIC_INFORMATION pDirectoryEntry = (PDIRECTORY_BASIC_INFORMATION) DirectoryEntry; + BYTE DirectoryEntry [MAX_DIR_ENTRY * sizeof(OBJECT_DIRECTORY_INFORMATION)]; + POBJECT_DIRECTORY_INFORMATION pDirectoryEntry = (POBJECT_DIRECTORY_INFORMATION) DirectoryEntry; ULONG Context = 0; ULONG ReturnLength = 0; ULONG EntryCount = 0; @@ -296,7 +296,7 @@ */ if (FALSE != Recurse) { - pDirectoryEntry = (PDIRECTORY_BASIC_INFORMATION) DirectoryEntry; + pDirectoryEntry = (POBJECT_DIRECTORY_INFORMATION) DirectoryEntry; while (0 != pDirectoryEntry->ObjectTypeName.Length) { if (0 == wcscmp (L"Directory", pDirectoryEntry->ObjectTypeName.Buffer)) _____ Modified: trunk/reactos/include/ddk/setypes.h --- trunk/reactos/include/ddk/setypes.h 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/include/ddk/setypes.h 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: setypes.h,v 1.17 2004/12/22 05:06:59 royce Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory for details * PROJECT: ReactOS kernel @@ -71,34 +71,66 @@ #define SID_REVISION (1) #define SID_MAX_SUB_AUTHORITIES (15) -typedef struct _ACCESS_TOKEN -{ - TOKEN_SOURCE TokenSource; /* 0x00 */ +typedef struct _SEP_AUDIT_POLICY_CATEGORIES { + UCHAR System:4; + UCHAR Logon:4; + UCHAR ObjectAccess:4; + UCHAR PrivilegeUse:4; + UCHAR DetailedTracking:4; + UCHAR PolicyChange:4; + UCHAR AccountManagement:4; + UCHAR DirectoryServiceAccess:4; + UCHAR AccountLogon:4; +} SEP_AUDIT_POLICY_CATEGORIES, *PSEP_AUDIT_POLICY_CATEGORIES; + +typedef struct _SEP_AUDIT_POLICY_OVERLAY { + ULONGLONG PolicyBits:36; + UCHAR SetBit:1; +} SEP_AUDIT_POLICY_OVERLAY, *PSEP_AUDIT_POLICY_OVERLAY; + +typedef struct _SEP_AUDIT_POLICY { + union { + SEP_AUDIT_POLICY_CATEGORIES PolicyElements; + SEP_AUDIT_POLICY_OVERLAY PolicyOverlay; + ULONGLONG Overlay; + }; +} SEP_AUDIT_POLICY, *PSEP_AUDIT_POLICY; + +typedef struct _TOKEN { + TOKEN_SOURCE TokenSource; /* 0x00 */ LUID TokenId; /* 0x10 */ LUID AuthenticationId; /* 0x18 */ - LARGE_INTEGER ExpirationTime; /* 0x20 */ - LUID ModifiedId; /* 0x28 */ - ULONG UserAndGroupCount; /* 0x30 */ - ULONG PrivilegeCount; /* 0x34 */ - ULONG VariableLength; /* 0x38 */ - ULONG DynamicCharged; /* 0x3C */ - ULONG DynamicAvailable; /* 0x40 */ - ULONG DefaultOwnerIndex; /* 0x44 */ - PSID_AND_ATTRIBUTES UserAndGroups; /* 0x48 */ - PSID PrimaryGroup; /* 0x4C */ - PLUID_AND_ATTRIBUTES Privileges; /* 0x50 */ - ULONG Unknown1; /* 0x54 */ - PACL DefaultDacl; /* 0x58 */ - TOKEN_TYPE TokenType; /* 0x5C */ - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; /* 0x60 */ - UCHAR TokenFlags; /* 0x64 */ - UCHAR TokenInUse; /* 0x65 */ - UCHAR Unused[2]; /* 0x66 */ - PVOID ProxyData; /* 0x68 */ - PVOID AuditData; /* 0x6c */ - UCHAR VariablePart[1]; /* 0x70 */ -} ACCESS_TOKEN, *PACCESS_TOKEN; + LUID ParentTokenId; /* 0x20 */ + LARGE_INTEGER ExpirationTime; /* 0x28 */ + struct _ERESOURCE *TokenLock; /* 0x30 */ + ULONG Padding; /* 0x34 */ + SEP_AUDIT_POLICY AuditPolicy; /* 0x38 */ + LUID ModifiedId; /* 0x40 */ + ULONG SessionId; /* 0x48 */ + ULONG UserAndGroupCount; /* 0x4C */ + ULONG RestrictedSidCount; /* 0x50 */ + ULONG PrivilegeCount; /* 0x54 */ + ULONG VariableLength; /* 0x58 */ + ULONG DynamicCharged; /* 0x5C */ + ULONG DynamicAvailable; /* 0x60 */ + ULONG DefaultOwnerIndex; /* 0x64 */ + PSID_AND_ATTRIBUTES UserAndGroups; /* 0x68 */ + PSID_AND_ATTRIBUTES RestrictedSids; /* 0x6C */ + PSID PrimaryGroup; /* 0x70 */ + PLUID_AND_ATTRIBUTES Privileges; /* 0x74 */ + PULONG DynamicPart; /* 0x78 */ + PACL DefaultDacl; /* 0x7C */ + TOKEN_TYPE TokenType; /* 0x80 */ + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; /* 0x84 */ + ULONG TokenFlags; /* 0x88 */ + ULONG TokenInUse; /* 0x8C */ + PVOID ProxyData; /* 0x90 */ + PVOID AuditData; /* 0x94 */ + LUID OriginatingLogonSession; /* 0x98 */ + UCHAR VariablePart[1]; /* 0xA0 */ +} TOKEN, *PTOKEN; +typedef PVOID PACCESS_TOKEN; typedef struct _SECURITY_SUBJECT_CONTEXT { _____ Modified: trunk/reactos/lib/kernel32/file/dosdev.c --- trunk/reactos/lib/kernel32/file/dosdev.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/lib/kernel32/file/dosdev.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: dosdev.c,v 1.11 2004/01/23 21:16:03 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -156,7 +156,7 @@ DWORD ucchMax ) { - PDIRECTORY_BASIC_INFORMATION DirInfo; + POBJECT_DIRECTORY_INFORMATION DirInfo; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING UnicodeString; HANDLE DirectoryHandle; @@ -252,7 +252,7 @@ RestartScan = TRUE; Context = 0; Ptr = lpTargetPath; - DirInfo = (PDIRECTORY_BASIC_INFORMATION)Buffer; + DirInfo = (POBJECT_DIRECTORY_INFORMATION)Buffer; while (TRUE) { _____ Modified: trunk/reactos/ntoskrnl/include/internal/se.h --- trunk/reactos/ntoskrnl/include/internal/se.h 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/ntoskrnl/include/internal/se.h 2005-01-02 23:12:40 UTC (rev 12740) @@ -111,8 +111,8 @@ BOOLEAN SepInitSDs(VOID); NTSTATUS STDCALL -SepCreateImpersonationTokenDacl(PACCESS_TOKEN Token, - PACCESS_TOKEN PrimaryToken, +SepCreateImpersonationTokenDacl(PTOKEN Token, + PTOKEN PrimaryToken, PACL *Dacl); VOID SepInitializeTokenImplementation(VOID); @@ -142,7 +142,7 @@ ULONG a); BOOLEAN -SepPrivilegeCheck(PACCESS_TOKEN Token, +SepPrivilegeCheck(PTOKEN Token, PLUID_AND_ATTRIBUTES Privileges, ULONG PrivilegeCount, ULONG PrivilegeControl, _____ Modified: trunk/reactos/ntoskrnl/ps/create.c --- trunk/reactos/ntoskrnl/ps/create.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/ntoskrnl/ps/create.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.89 2004/12/18 15:52:51 hbirr Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -58,7 +58,7 @@ { return(Status); } - ImpersonationLevel = Token->ImpersonationLevel; + ImpersonationLevel = SeTokenImpersonationLevel(Token); } else { _____ Modified: trunk/reactos/ntoskrnl/se/acl.c --- trunk/reactos/ntoskrnl/se/acl.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/ntoskrnl/se/acl.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: acl.c,v 1.22 2004/12/10 16:50:37 navaraf Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -220,8 +220,8 @@ } NTSTATUS STDCALL -SepCreateImpersonationTokenDacl(PACCESS_TOKEN Token, - PACCESS_TOKEN PrimaryToken, +SepCreateImpersonationTokenDacl(PTOKEN Token, + PTOKEN PrimaryToken, PACL *Dacl) { ULONG AclLength; _____ Modified: trunk/reactos/ntoskrnl/se/priv.c --- trunk/reactos/ntoskrnl/se/priv.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/ntoskrnl/se/priv.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: priv.c,v 1.11 2004/08/15 16:39:11 chorns Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -98,7 +98,7 @@ BOOLEAN -SepPrivilegeCheck (PACCESS_TOKEN Token, +SepPrivilegeCheck (PTOKEN Token, PLUID_AND_ATTRIBUTES Privileges, ULONG PrivilegeCount, ULONG PrivilegeControl, @@ -223,7 +223,7 @@ IN PBOOLEAN Result) { PLUID_AND_ATTRIBUTES Privilege; - PACCESS_TOKEN Token; + PTOKEN Token; ULONG PrivilegeCount; ULONG PrivilegeControl; ULONG Length; _____ Modified: trunk/reactos/ntoskrnl/se/semgr.c --- trunk/reactos/ntoskrnl/se/semgr.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/ntoskrnl/se/semgr.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: semgr.c,v 1.51 2004/11/21 18:35:05 gdalsnes Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -320,7 +320,7 @@ POOL_TYPE PoolType) { PSECURITY_DESCRIPTOR Descriptor; - PACCESS_TOKEN Token; + PTOKEN Token; ULONG OwnerLength = 0; ULONG GroupLength = 0; ULONG DaclLength = 0; @@ -557,10 +557,11 @@ static BOOLEAN -SepSidInToken(PACCESS_TOKEN Token, +SepSidInToken(PACCESS_TOKEN _Token, PSID Sid) { ULONG i; + PTOKEN Token = (PTOKEN)_Token; if (Token->UserAndGroupCount == 0) { @@ -793,7 +794,7 @@ { SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; KPROCESSOR_MODE PreviousMode; - PACCESS_TOKEN Token; + PTOKEN Token; NTSTATUS Status; DPRINT("NtAccessCheck() called\n"); _____ Modified: trunk/reactos/ntoskrnl/se/token.c --- trunk/reactos/ntoskrnl/se/token.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/ntoskrnl/se/token.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -1,4 +1,4 @@ -/* $Id: token.c,v 1.45 2004/12/19 16:16:58 navaraf Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -47,10 +47,11 @@ } NTSTATUS SeExchangePrimaryToken(PEPROCESS Process, - PACCESS_TOKEN NewToken, + PACCESS_TOKEN NewTokenP, PACCESS_TOKEN* OldTokenP) { - PACCESS_TOKEN OldToken; + PTOKEN OldToken; + PTOKEN NewToken = (PTOKEN)NewTokenP; if (NewToken->TokenType != TokenPrimary) { @@ -68,7 +69,7 @@ SepTokenObjectType, KernelMode); OldToken->TokenInUse = 0; - *OldTokenP = OldToken; + *OldTokenP = (PACCESS_TOKEN)OldToken; return(STATUS_SUCCESS); } @@ -88,7 +89,7 @@ NTSTATUS -SepFindPrimaryGroupAndDefaultOwner(PACCESS_TOKEN Token, +SepFindPrimaryGroupAndDefaultOwner(PTOKEN Token, PSID PrimaryGroup, PSID DefaultOwner) { @@ -131,13 +132,13 @@ NTSTATUS -SepDuplicateToken(PACCESS_TOKEN Token, +SepDuplicateToken(PTOKEN Token, POBJECT_ATTRIBUTES ObjectAttributes, BOOLEAN EffectiveOnly, TOKEN_TYPE TokenType, SECURITY_IMPERSONATION_LEVEL Level, KPROCESSOR_MODE PreviousMode, - PACCESS_TOKEN* NewAccessToken) + PTOKEN* NewAccessToken) { NTSTATUS Status; ULONG uLength; @@ -145,14 +146,14 @@ PVOID EndMem; - PACCESS_TOKEN AccessToken; + PTOKEN AccessToken; Status = ObCreateObject(PreviousMode, SepTokenObjectType, ObjectAttributes, PreviousMode, NULL, - sizeof(ACCESS_TOKEN), + sizeof(TOKEN), 0, 0, (PVOID*)&AccessToken); @@ -266,8 +267,8 @@ struct _EPROCESS* ParentProcess) { NTSTATUS Status; - PACCESS_TOKEN pNewToken; - PACCESS_TOKEN pParentToken; + PTOKEN pNewToken; + PTOKEN pParentToken; OBJECT_ATTRIBUTES ObjectAttributes; @@ -316,6 +317,7 @@ { NTSTATUS Status; OBJECT_ATTRIBUTES ObjectAttributes; + PTOKEN TokenNew; InitializeObjectAttributes(&ObjectAttributes, NULL, @@ -328,7 +330,9 @@ TokenImpersonation, Level, PreviousMode, - NewToken); + (PTOKEN*)&NewToken); + + *NewToken = (PACCESS_TOKEN)TokenNew; return(Status); } @@ -517,7 +521,7 @@ VOID STDCALL SepDeleteToken(PVOID ObjectBody) { - PACCESS_TOKEN AccessToken = (PACCESS_TOKEN)ObjectBody; + PTOKEN AccessToken = (PTOKEN)ObjectBody; if (AccessToken->UserAndGroups) ExFreePool(AccessToken->UserAndGroups); @@ -541,7 +545,7 @@ SepTokenObjectType->TotalObjects = 0; SepTokenObjectType->TotalHandles = 0; SepTokenObjectType->PagedPoolCharge = 0; - SepTokenObjectType->NonpagedPoolCharge = sizeof(ACCESS_TOKEN); + SepTokenObjectType->NonpagedPoolCharge = sizeof(TOKEN); SepTokenObjectType->Mapping = &SepTokenMapping; SepTokenObjectType->Dump = NULL; SepTokenObjectType->Open = NULL; @@ -573,7 +577,7 @@ NTSTATUS Status, LengthStatus; PVOID UnusedInfo; PVOID EndMem; - PACCESS_TOKEN Token; + PTOKEN Token; ULONG Length; PTOKEN_GROUPS PtrTokenGroups; PTOKEN_DEFAULT_DACL PtrDefaultDacl; @@ -901,7 +905,7 @@ IN ULONG TokenInformationLength) { NTSTATUS Status; - PACCESS_TOKEN Token; + PTOKEN Token; TOKEN_OWNER TokenOwnerSet = { 0 }; TOKEN_PRIMARY_GROUP TokenPrimaryGroupSet = { 0 }; DWORD NeededAccess = 0; @@ -1036,8 +1040,8 @@ OUT PHANDLE NewTokenHandle) { KPROCESSOR_MODE PreviousMode; - PACCESS_TOKEN Token; - PACCESS_TOKEN NewToken; + PTOKEN Token; + PTOKEN NewToken; NTSTATUS Status; PreviousMode = KeGetPreviousMode(); @@ -1213,7 +1217,7 @@ // PLUID_AND_ATTRIBUTES Privileges; KPROCESSOR_MODE PreviousMode; // ULONG PrivilegeCount; - PACCESS_TOKEN Token; + PTOKEN Token; // ULONG Length; ULONG i; ULONG j; @@ -1363,7 +1367,7 @@ ULONG uAuthUserLength = RtlLengthSid(SeAuthenticatedUserSid); ULONG uAdminsLength = RtlLengthSid(SeAliasAdminsSid); - PACCESS_TOKEN AccessToken; + PTOKEN AccessToken; PVOID SidArea; @@ -1375,7 +1379,7 @@ NULL, KernelMode, NULL, - sizeof(ACCESS_TOKEN), + sizeof(TOKEN), 0, 0, (PVOID*)&AccessToken); @@ -1572,7 +1576,7 @@ IN PTOKEN_SOURCE TokenSource) { HANDLE TokenHandle; - PACCESS_TOKEN AccessToken; + PTOKEN AccessToken; NTSTATUS Status; OBJECT_ATTRIBUTES SafeObjectAttributes; POBJECT_ATTRIBUTES ObjectAttributes; @@ -1603,7 +1607,7 @@ ObjectAttributes, ExGetPreviousMode(), NULL, - sizeof(ACCESS_TOKEN), + sizeof(TOKEN), 0, 0, (PVOID*)&AccessToken); @@ -1744,8 +1748,7 @@ SeQueryAuthenticationIdToken(IN PACCESS_TOKEN Token, OUT PLUID LogonId) { - LogonId->LowPart = Token->AuthenticationId.LowPart; - LogonId->HighPart = Token->AuthenticationId.HighPart; + *LogonId = ((PTOKEN)Token)->AuthenticationId; return STATUS_SUCCESS; } @@ -1754,10 +1757,11 @@ /* * @implemented */ -SECURITY_IMPERSONATION_LEVEL STDCALL +SECURITY_IMPERSONATION_LEVEL +STDCALL SeTokenImpersonationLevel(IN PACCESS_TOKEN Token) { - return Token->ImpersonationLevel; + return ((PTOKEN)Token)->ImpersonationLevel; } @@ -1767,7 +1771,7 @@ TOKEN_TYPE STDCALL SeTokenType(IN PACCESS_TOKEN Token) { - return Token->TokenType; + return ((PTOKEN)Token)->TokenType; } @@ -1823,7 +1827,7 @@ OUT PHANDLE TokenHandle) { PETHREAD Thread; - PACCESS_TOKEN Token, NewToken, PrimaryToken; + PTOKEN Token, NewToken, PrimaryToken; BOOLEAN CopyOnOpen, EffectiveOnly; SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; SE_IMPERSONATION_STATE ImpersonationState; _____ Modified: trunk/reactos/subsys/system/services/database.c --- trunk/reactos/subsys/system/services/database.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/subsys/system/services/database.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -390,7 +390,7 @@ UNICODE_STRING DirName; HANDLE DirHandle; NTSTATUS Status; - PDIRECTORY_BASIC_INFORMATION DirInfo; + POBJECT_DIRECTORY_INFORMATION DirInfo; ULONG BufferLength; ULONG DataLength; ULONG Index; @@ -424,7 +424,7 @@ return(Status); } - BufferLength = sizeof(DIRECTORY_BASIC_INFORMATION) + + BufferLength = sizeof(OBJECT_DIRECTORY_INFORMATION) + 2 * MAX_PATH * sizeof(WCHAR); DirInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, _____ Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c --- trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-01-02 23:12:40 UTC (rev 12740) @@ -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: winsta.c,v 1.70 2004/12/24 17:45:58 weiden Exp $ + * $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1004,7 +1004,7 @@ char InitialBuffer[256], *Buffer; ULONG Context, ReturnLength, BufferSize; DWORD EntryCount; - PDIRECTORY_BASIC_INFORMATION DirEntry; + POBJECT_DIRECTORY_INFORMATION DirEntry; WCHAR NullWchar; /* @@ -1090,7 +1090,7 @@ */ ReturnLength = sizeof(DWORD); EntryCount = 0; - for (DirEntry = (PDIRECTORY_BASIC_INFORMATION) Buffer; 0 != DirEntry->ObjectName.Length; + for (DirEntry = (POBJECT_DIRECTORY_INFORMATION) Buffer; 0 != DirEntry->ObjectName.Length; DirEntry++) { ReturnLength += DirEntry->ObjectName.Length + sizeof(WCHAR); @@ -1137,7 +1137,7 @@ lpBuffer = (PVOID) ((PCHAR) lpBuffer + sizeof(DWORD)); NullWchar = L'\0'; - for (DirEntry = (PDIRECTORY_BASIC_INFORMATION) Buffer; 0 != DirEntry->ObjectName.Length; + for (DirEntry = (POBJECT_DIRECTORY_INFORMATION) Buffer; 0 != DirEntry->ObjectName.Length; DirEntry++) { Status = MmCopyToCaller(lpBuffer, DirEntry->ObjectName.Buffer, DirEntry->ObjectName.Length); _____ Modified: trunk/reactos/w32api/include/ddk/ntapi.h --- trunk/reactos/w32api/include/ddk/ntapi.h 2005-01-02 22:17:02 UTC (rev 12739) +++ trunk/reactos/w32api/include/ddk/ntapi.h 2005-01-02 23:12:40 UTC (rev 12740) @@ -943,10 +943,10 @@ IN OUT PULONG Context, OUT PULONG ReturnLength OPTIONAL); -typedef struct _DIRECTORY_BASIC_INFORMATION { +typedef struct _OBJECT_DIRECTORY_INFORMATION { UNICODE_STRING ObjectName; UNICODE_STRING ObjectTypeName; -} DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION; +} OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION; NTOSAPI NTSTATUS
19 years, 10 months
1
0
0
0
[ion] 12738: Fix KeRaiseUserException and rename Object Information Structure
by ion@svn.reactos.com
Fix KeRaiseUserException and rename Object Information Structure Modified: trunk/reactos/config Modified: trunk/reactos/include/ntos/zwtypes.h Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c Modified: trunk/reactos/ntoskrnl/ob/dirobj.c _____ Modified: trunk/reactos/config --- trunk/reactos/config 2005-01-02 20:49:00 UTC (rev 12737) +++ trunk/reactos/config 2005-01-02 20:51:02 UTC (rev 12738) @@ -30,7 +30,7 @@ # # Whether to compile with optimizations # -OPTIMIZED := 0 +OPTIMIZED := 0 # # Whether to compile a multiprocessor or single processor version _____ Modified: trunk/reactos/include/ntos/zwtypes.h --- trunk/reactos/include/ntos/zwtypes.h 2005-01-02 20:49:00 UTC (rev 12737) +++ trunk/reactos/include/ntos/zwtypes.h 2005-01-02 20:51:02 UTC (rev 12738) @@ -1659,11 +1659,11 @@ // directory information -typedef struct _DIRECTORY_BASIC_INFORMATION +typedef struct _OBJECT_DIRECTORY_INFORMATION { UNICODE_STRING ObjectName; UNICODE_STRING ObjectTypeName; // Directory, Device ... -} DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION; +} OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION; // power information levels _____ Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c --- trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-01-02 20:49:00 UTC (rev 12737) +++ trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-01-02 20:51:02 UTC (rev 12738) @@ -857,18 +857,20 @@ /* * @implemented */ - NTSTATUS STDCALL KeRaiseUserException(IN NTSTATUS ExceptionCode) { - /* FIXME: This needs SEH */ ULONG OldEip; PKTHREAD Thread = KeGetCurrentThread(); - ProbeForWrite(&Thread->Teb->ExceptionCode, sizeof(NTSTATUS), sizeof(NTSTATUS)); /* NT doesn't check this -- bad? */ + _SEH_TRY { + Thread->Teb->ExceptionCode = ExceptionCode; + } _SEH_HANDLE { + return(ExceptionCode); + } _SEH_END; + OldEip = Thread->TrapFrame->Eip; Thread->TrapFrame->Eip = (ULONG_PTR)LdrpGetSystemDllRaiseExceptionDispatcher(); - Thread->Teb->ExceptionCode = ExceptionCode; return((NTSTATUS)OldEip); } _____ Modified: trunk/reactos/ntoskrnl/ob/dirobj.c --- trunk/reactos/ntoskrnl/ob/dirobj.c 2005-01-02 20:49:00 UTC (rev 12737) +++ trunk/reactos/ntoskrnl/ob/dirobj.c 2005-01-02 20:51:02 UTC (rev 12738) @@ -1,4 +1,4 @@ -/* $Id: dirobj.c,v 1.26 2004/09/05 22:26:17 hbirr Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -179,8 +179,8 @@ NTSTATUS Status = STATUS_SUCCESS; ULONG DirectoryCount = 0; ULONG DirectoryIndex = 0; - PDIRECTORY_BASIC_INFORMATION current_odi = (PDIRECTORY_BASIC_INFORMATION) Buffer; - DIRECTORY_BASIC_INFORMATION ZeroOdi; + POBJECT_DIRECTORY_INFORMATION current_odi = (POBJECT_DIRECTORY_INFORMATION) Buffer; + OBJECT_DIRECTORY_INFORMATION ZeroOdi; PUCHAR FirstFree = (PUCHAR) Buffer; ULONG Context; ULONG RequiredSize; @@ -248,14 +248,14 @@ */ DirectoryCount = 0; /* For the end sentenil */ - RequiredSize = sizeof(DIRECTORY_BASIC_INFORMATION); + RequiredSize = sizeof(OBJECT_DIRECTORY_INFORMATION); for (current_entry = start_entry; current_entry != &dir->head; current_entry = current_entry->Flink) { current = CONTAINING_RECORD(current_entry, OBJECT_HEADER, Entry); - RequiredSize += sizeof(DIRECTORY_BASIC_INFORMATION) + + RequiredSize += sizeof(OBJECT_DIRECTORY_INFORMATION) + current->Name.Length + sizeof(WCHAR) + current->ObjectType->TypeName.Length + sizeof(WCHAR); if (RequiredSize <= BufferLength && @@ -284,7 +284,7 @@ /* * Move FirstFree to point to the Unicode strings area */ - FirstFree += (DirectoryCount + 1) * sizeof(DIRECTORY_BASIC_INFORMATION); + FirstFree += (DirectoryCount + 1) * sizeof(OBJECT_DIRECTORY_INFORMATION); /* Scan the directory */ current_entry = start_entry; @@ -326,8 +326,8 @@ ObDereferenceObject(dir); /* Terminate with all zero entry */ - memset(&ZeroOdi, '\0', sizeof(DIRECTORY_BASIC_INFORMATION)); - Status = MmCopyToCaller(current_odi, &ZeroOdi, sizeof(DIRECTORY_BASIC_INFORMATION)); + memset(&ZeroOdi, '\0', sizeof(OBJECT_DIRECTORY_INFORMATION)); + Status = MmCopyToCaller(current_odi, &ZeroOdi, sizeof(OBJECT_DIRECTORY_INFORMATION)); if (! NT_SUCCESS(Status)) { return Status;
19 years, 10 months
1
0
0
0
[navaraf] 12737: Fix HEAP_free call.
by navaraf@svn.reactos.com
Fix HEAP_free call. Modified: trunk/reactos/lib/gdi32/objects/font.c _____ Modified: trunk/reactos/lib/gdi32/objects/font.c --- trunk/reactos/lib/gdi32/objects/font.c 2005-01-02 20:47:34 UTC (rev 12736) +++ trunk/reactos/lib/gdi32/objects/font.c 2005-01-02 20:49:00 UTC (rev 12737) @@ -1,4 +1,4 @@ -/* $Id: font.c,v 1.11 2004/12/30 02:32:24 navaraf Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -716,7 +716,7 @@ { rc = AddFontResourceExW ( FilenameW, fl, pvReserved ); - HEAP_free ( &FilenameW ); + HEAP_free ( FilenameW ); } return rc; }
19 years, 10 months
1
0
0
0
[hyperion] 12736: Patch to make the End Process Button working, by Michael Fritscher
by hyperion@svn.reactos.com
Patch to make the End Process Button working, by Michael Fritscher Modified: trunk/reactos/subsys/system/taskmgr/procpage.c _____ Modified: trunk/reactos/subsys/system/taskmgr/procpage.c --- trunk/reactos/subsys/system/taskmgr/procpage.c 2005-01-02 20:12:17 UTC (rev 12735) +++ trunk/reactos/subsys/system/taskmgr/procpage.c 2005-01-02 20:47:34 UTC (rev 12736) @@ -34,6 +34,7 @@ #include "column.h" #include "proclist.h" #include "dbgchnl.h" +#include "endproc.h" #include <ctype.h> HWND hProcessPage; /* Process List Property Page */ @@ -110,6 +111,12 @@ break; case WM_COMMAND: + /* Handle the button clicks */ + switch (LOWORD(wParam)) + { + case IDC_ENDPROCESS: + ProcessPage_OnEndProcess(); + } break; case WM_SIZE:
19 years, 10 months
1
0
0
0
[chorns] 12735: Create xmlbuildsystem branch.
by chorns@svn.reactos.com
Create xmlbuildsystem branch. Added: branches/xmlbuildsystem/ _____ Copied: branches/xmlbuildsystem (from rev 12734, trunk)
19 years, 10 months
1
0
0
0
← Newer
1
...
61
62
63
64
65
66
67
...
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