ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2007
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
888 discussions
Start a n
N
ew thread
[hpoussin] 30439: No need to display function name and file/line twice
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Nov 14 15:25:53 2007 New Revision: 30439 URL:
http://svn.reactos.org/svn/reactos?rev=30439&view=rev
Log: No need to display function name and file/line twice Modified: trunk/reactos/drivers/network/ndis/include/debug.h Modified: trunk/reactos/drivers/network/ndis/include/debug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/inclu…
============================================================================== --- trunk/reactos/drivers/network/ndis/include/debug.h (original) +++ trunk/reactos/drivers/network/ndis/include/debug.h Wed Nov 14 15:25:53 2007 @@ -59,21 +59,12 @@ #define assert_irql(x) ASSERT_IRQL(x) -#ifdef _MSC_VER - #define UNIMPLEMENTED \ - NDIS_DbgPrint(MIN_TRACE, ("The function at (%s:%d) is unimplemented.\n", __FILE__, __LINE__)); - -#else /* _MSC_VER */ - -#define UNIMPLEMENTED \ - NDIS_DbgPrint(MIN_TRACE, ("(%s) at (%s:%d) is unimplemented.\n", __FUNCTION__, __FILE__, __LINE__)); - -#endif /* _MSC_VER */ + NDIS_DbgPrint(MIN_TRACE, ("Unimplemented.\n", __FUNCTION__)); #define CHECKPOINT \ - do { NDIS_DbgPrint(MIN_TRACE, ("(%s:%d)\n", __FILE__, __LINE__)); } while(0); + do { NDIS_DbgPrint(MIN_TRACE, ("\n")); } while(0); #define CP CHECKPOINT
17 years, 1 month
1
0
0
0
[hpoussin] 30438: Use Wine debug channel infrastructure. I modified it a bit to match our debug message format To test it, set DEBUGCHANNEL environment variable to what you want to see, and run your program. Syntax: set DEBUGCHANNEL = [[fixme|err|warn|trace]+|-{channel}|all]*
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Nov 14 15:18:37 2007 New Revision: 30438 URL:
http://svn.reactos.org/svn/reactos?rev=30438&view=rev
Log: Use Wine debug channel infrastructure. I modified it a bit to match our debug message format To test it, set DEBUGCHANNEL environment variable to what you want to see, and run your program. Syntax: set DEBUGCHANNEL = [[fixme|err|warn|trace]+|-{channel}|all]* Modified: trunk/reactos/include/reactos/wine/debug.h (contents, props changed) trunk/reactos/lib/3rdparty/libwine/debug.c Modified: trunk/reactos/include/reactos/wine/debug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/debug…
============================================================================== --- trunk/reactos/include/reactos/wine/debug.h (original) +++ trunk/reactos/include/reactos/wine/debug.h Wed Nov 14 15:18:37 2007 @@ -1,68 +1,193 @@ +/* + * Wine debugging interface + * + * Copyright 1999 Patrik Stridvall + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + #ifndef __WINE_DEBUG_H #define __WINE_DEBUG_H -#include "../roscfg.h" #include <stdarg.h> #include <windef.h> -#if !defined(_MSC_VER) -#include <winnt.h> -#endif - -/* Add ROS Master debug functions if not added yet */ -#ifndef __INTERNAL_DEBUG +#ifndef GUID_DEFINED +#include <guiddef.h> +#endif + +#ifdef __WINE_WINE_TEST_H +#error This file should not be used in Wine tests +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct _GUID; + +/* + * Internal definitions (do not use these directly) + */ + +enum __wine_debug_class +{ + __WINE_DBCL_FIXME = 0, /* 0x1 */ + __WINE_DBCL_ERR = 1, /* 0x2 */ + __WINE_DBCL_WARN = 2, /* 0x4 */ + __WINE_DBCL_TRACE = 3, /* 0x8 */ + + /* lazy init flag */ #ifdef YDEBUG -#undef NDEBUG + __WINE_DBCL_INIT = 0xf #else -#define NDEBUG -#endif -#include <reactos/debug.h> -#endif - -#ifndef __GNUC__ -#if !defined(_MSC_VER) || _MSC_VER < 8 -#define __FUNCTION__ "" -#endif//_MSC_VER -#define inline __inline -#endif - -ULONG DbgPrint(const char *Format,...); - -struct _GUID; - -/* Exported definitions and macros */ - -/* These function return a printable version of a string, including + __WINE_DBCL_INIT = 0x7 +#endif +}; + +struct __wine_debug_channel +{ + unsigned char flags; + char name[15]; +}; + +#define UNIMPLEMENTED WINE_FIXME(" is unimplemented") + +#ifndef WINE_NO_TRACE_MSGS +# define __WINE_GET_DEBUGGING_TRACE(dbch) ((dbch)->flags & (1 << __WINE_DBCL_TRACE)) +#else +# define __WINE_GET_DEBUGGING_TRACE(dbch) 0 +#endif + +#ifndef WINE_NO_DEBUG_MSGS +# define __WINE_GET_DEBUGGING_WARN(dbch) ((dbch)->flags & (1 << __WINE_DBCL_WARN)) +# define __WINE_GET_DEBUGGING_FIXME(dbch) ((dbch)->flags & (1 << __WINE_DBCL_FIXME)) +#else +# define __WINE_GET_DEBUGGING_WARN(dbch) 0 +# define __WINE_GET_DEBUGGING_FIXME(dbch) 0 +#endif + +/* define error macro regardless of what is configured */ +#define __WINE_GET_DEBUGGING_ERR(dbch) ((dbch)->flags & (1 << __WINE_DBCL_ERR)) + +#define __WINE_GET_DEBUGGING(dbcl,dbch) __WINE_GET_DEBUGGING##dbcl(dbch) + +#define __WINE_IS_DEBUG_ON(dbcl,dbch) \ + (__WINE_GET_DEBUGGING##dbcl(dbch) && (__wine_dbg_get_channel_flags(dbch) & (1 << __WINE_DBCL##dbcl))) + +#ifdef __GNUC__ + +#define __WINE_DPRINTF(dbcl,dbch) \ + do { if(__WINE_GET_DEBUGGING(dbcl,(dbch))) { \ + struct __wine_debug_channel * const __dbch = (dbch); \ + const enum __wine_debug_class __dbcl = __WINE_DBCL##dbcl; \ + __WINE_DBG_LOG + +#define __WINE_DBG_LOG(args...) \ + wine_dbg_log( __dbcl, __dbch, __FILE__, __FUNCTION__, __LINE__, args); } } while(0) + +#define __WINE_PRINTF_ATTR(fmt,args) /*__attribute__((format (printf,fmt,args)))*/ + + +#ifdef WINE_NO_TRACE_MSGS +#define WINE_TRACE(args...) do { } while(0) +#define WINE_TRACE_(ch) WINE_TRACE +#endif + +#ifdef WINE_NO_DEBUG_MSGS +#define WINE_WARN(args...) do { } while(0) +#define WINE_WARN_(ch) WINE_WARN +#define WINE_FIXME(args...) do { } while(0) +#define WINE_FIXME_(ch) WINE_FIXME +#endif + +#elif defined(__SUNPRO_C) + +#define __WINE_DPRINTF(dbcl,dbch) \ + do { if(__WINE_GET_DEBUGGING(dbcl,(dbch))) { \ + struct __wine_debug_channel * const __dbch = (dbch); \ + const enum __WINE_DEBUG_CLASS __dbcl = __WINE_DBCL##dbcl; \ + __WINE_DBG_LOG + +#define __WINE_DBG_LOG(...) \ + wine_dbg_log( __dbcl, __dbch, __func__, __VA_ARGS__); } } while(0) + +#define __WINE_PRINTF_ATTR(fmt,args) + +#ifdef WINE_NO_TRACE_MSGS +#define WINE_TRACE(...) do { } while(0) +#define WINE_TRACE_(ch) WINE_TRACE +#endif + +#ifdef WINE_NO_DEBUG_MSGS +#define WINE_WARN(...) do { } while(0) +#define WINE_WARN_(ch) WINE_WARN +#define WINE_FIXME(...) do { } while(0) +#define WINE_FIXME_(ch) WINE_FIXME +#endif + +#else /* !__GNUC__ && !__SUNPRO_C */ + +#define __WINE_DPRINTF(dbcl,dbch) \ + (!__WINE_GET_DEBUGGING(dbcl,(dbch)) || \ + (wine_dbg_log(__WINE_DBCL##dbcl,(dbch),__FILE__,"",__LINE__,"") == -1)) ? \ + (void)0 : (void)wine_dbg_printf + +#define __WINE_PRINTF_ATTR(fmt, args) + +#endif /* !__GNUC__ && !__SUNPRO_C */ + +struct __wine_debug_functions +{ + char * (*get_temp_buffer)( size_t n ); + void (*release_temp_buffer)( char *buffer, size_t n ); + const char * (*dbgstr_an)( const char * s, int n ); + const char * (*dbgstr_wn)( const WCHAR *s, int n ); + int (*dbg_vprintf)( const char *format, va_list args ); + int (*dbg_vlog)( enum __wine_debug_class cls, struct __wine_debug_channel *channel, + const char *file, const char *function, const int line, const char *format, va_list args ); +}; + +extern unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ); +extern int __wine_dbg_set_channel_flags( struct __wine_debug_channel *channel, + unsigned char set, unsigned char clear ); +extern void __wine_dbg_set_functions( const struct __wine_debug_functions *new_funcs, + struct __wine_debug_functions *old_funcs, size_t size ); + +/* + * Exported definitions and macros + */ + +/* These functions return a printable version of a string, including quotes. The string will be valid for some time, but not indefinitely as strings are re-used. */ -extern const char *wine_dbgstr_w( const WCHAR *s ); 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_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 ); } -inline static const char *debugstr_wn( const wchar_t *s, int n ) { return wine_dbgstr_wn( s, n ); } -inline static const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, 80 ); } -inline static const char *debugstr_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); } -inline static const char *debugres_a( const char *s ) { return wine_dbgstr_an( s, 80 ); } -inline static const char *debugres_w( const wchar_t *s ) { return wine_dbgstr_wn( s, 80 ); } - -static inline const char *wine_dbgstr_point( const POINT *pt ) -{ - if (!pt) return "(null)"; - return wine_dbg_sprintf( "(%ld,%ld)", pt->x, pt->y ); -} - -static inline const char *wine_dbgstr_size( const SIZE *size ) -{ - if (!size) return "(null)"; - return wine_dbg_sprintf( "(%ld,%ld)", size->cx, size->cy ); -} - -static inline const char *wine_dbgstr_rect( const RECT *rect ) -{ - if (!rect) return "(null)"; - return wine_dbg_sprintf( "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom ); +extern const char *wine_dbgstr_wn( const WCHAR *s, int n ); +extern const char *wine_dbg_sprintf( const char *format, ... ) __WINE_PRINTF_ATTR(1,2); + +extern int wine_dbg_printf( const char *format, ... ) __WINE_PRINTF_ATTR(1,2); +extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *file, + const char *func, const int line, const char *format, ... ) __WINE_PRINTF_ATTR(6,7); + +static inline const char *wine_dbgstr_a( const char *s ) +{ + return wine_dbgstr_an( s, -1 ); +} + +static inline const char *wine_dbgstr_w( const WCHAR *s ) +{ + return wine_dbgstr_wn( s, -1 ); } static inline const char *wine_dbgstr_guid( const GUID *id ) @@ -75,85 +200,93 @@ id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] ); } +static inline const char *wine_dbgstr_point( const POINT *pt ) +{ + if (!pt) return "(null)"; + return wine_dbg_sprintf( "(%ld,%ld)", pt->x, pt->y ); +} + +static inline const char *wine_dbgstr_size( const SIZE *size ) +{ + if (!size) return "(null)"; + return wine_dbg_sprintf( "(%ld,%ld)", size->cx, size->cy ); +} + +static inline const char *wine_dbgstr_rect( const RECT *rect ) +{ + if (!rect) return "(null)"; + return wine_dbg_sprintf( "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, + rect->right, rect->bottom ); +} + +static inline const char *wine_dbgstr_longlong( ULONGLONG ll ) +{ + if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) + return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll ); + else return wine_dbg_sprintf( "%lx", (unsigned long)ll ); +} + +#ifndef WINE_TRACE +#define WINE_TRACE __WINE_DPRINTF(_TRACE,__wine_dbch___default) +#define WINE_TRACE_(ch) __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch) +#endif +#define WINE_TRACE_ON(ch) __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch) + +#ifndef WINE_WARN +#define WINE_WARN __WINE_DPRINTF(_WARN,__wine_dbch___default) +#define WINE_WARN_(ch) __WINE_DPRINTF(_WARN,&__wine_dbch_##ch) +#endif +#define WINE_WARN_ON(ch) __WINE_IS_DEBUG_ON(_WARN,&__wine_dbch_##ch) + +#ifndef WINE_FIXME +#define WINE_FIXME __WINE_DPRINTF(_FIXME,__wine_dbch___default) +#define WINE_FIXME_(ch) __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch) +#endif +#define WINE_FIXME_ON(ch) __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch) + +#define WINE_ERR __WINE_DPRINTF(_ERR,__wine_dbch___default) +#define WINE_ERR_(ch) __WINE_DPRINTF(_ERR,&__wine_dbch_##ch) +#define WINE_ERR_ON(ch) __WINE_IS_DEBUG_ON(_ERR,&__wine_dbch_##ch) + +#define WINE_DECLARE_DEBUG_CHANNEL(ch) \ + static struct __wine_debug_channel __wine_dbch_##ch = { ~0, #ch } +#define WINE_DEFAULT_DEBUG_CHANNEL(ch) \ + static struct __wine_debug_channel __wine_dbch_##ch = { ~0, #ch }; \ + static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch + +#define WINE_DPRINTF wine_dbg_printf +#define WINE_MESSAGE wine_dbg_printf + +/* Wine uses shorter names that are very likely to conflict with other software */ + +static inline const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); } +static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); } static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); } - -#define TRACE DPRINT -#define TRACE_(ch) DPRINT -#ifdef NDEBUG -#define TRACE_ON(ch) 0 -#else -#define TRACE_ON(ch) 1 -#endif - -#define WINE_TRACE DPRINT -#define WINE_TRACE_(ch) DPRINT -#ifdef NDEBUG -#define WINE_TRACE_ON(ch) 0 -#else -#define WINE_TRACE_ON(ch) 1 -#endif - -#define WARN DPRINT -#define WARN_(ch) DPRINT -#ifdef NDEBUG -#define WARN_ON(ch) 0 -#else -#define WARN_ON(ch) 1 -#endif - -#define WINE_WARN DPRINT -#define WINE_WARN_(ch) DPRINT -#ifdef NDEBUG -#define WINE_WARN_ON(ch) 0 -#else -#define WINE_WARN_ON(ch) 1 -#endif - -#ifdef FIXME -#undef FIXME -#endif -#define FIXME DPRINT1 -#define FIXME_(ch) DPRINT1 -#ifdef NDEBUG -#define FIXME_ON(ch) 0 -#else -#define FIXME_ON(ch) 1 -#endif - -#ifdef WINE_FIXME -#undef WINE_FIXME -#endif -#define WINE_FIXME DPRINT1 -#define WINE_FIXME_(ch) DPRINT1 -#ifdef NDEBUG -#define WINE_FIXME_ON(ch) 0 -#else -#define WINE_FIXME_ON(ch) 1 -#endif - -#define ERR DPRINT1 -#define ERR_(ch) DPRINT1 -#ifdef NDEBUG -#define ERR_ON(ch) 0 -#else -#define ERR_ON(ch) 1 -#endif - -#define WINE_ERR DPRINT1 -#define WINE_ERR_(ch) DPRINT1 -#ifdef NDEBUG -#define WINE_ERR_ON(ch) 0 -#else -#define WINE_ERR_ON(ch) 1 -#endif - -#define DECLARE_DEBUG_CHANNEL(ch) -#define DEFAULT_DEBUG_CHANNEL(ch) - -#define WINE_DECLARE_DEBUG_CHANNEL(ch) DECLARE_DEBUG_CHANNEL(ch) -#define WINE_DEFAULT_DEBUG_CHANNEL(ch) DEFAULT_DEBUG_CHANNEL(ch) - -#define DPRINTF DPRINT -#define MESSAGE DPRINT +static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); } +static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } + +#define TRACE WINE_TRACE +#define TRACE_(ch) WINE_TRACE_(ch) +#define TRACE_ON(ch) WINE_TRACE_ON(ch) + +#define WARN WINE_WARN +#define WARN_(ch) WINE_WARN_(ch) +#define WARN_ON(ch) WINE_WARN_ON(ch) + +#define FIXME WINE_FIXME +#define FIXME_(ch) WINE_FIXME_(ch) +#define FIXME_ON(ch) WINE_FIXME_ON(ch) + +#undef ERR /* Solaris got an 'ERR' define in <sys/reg.h> */ +#define ERR WINE_ERR +#define ERR_(ch) WINE_ERR_(ch) +#define ERR_ON(ch) WINE_ERR_ON(ch) + +#define DPRINTF WINE_DPRINTF +#define MESSAGE WINE_MESSAGE + +#ifdef __cplusplus +} +#endif #endif /* __WINE_DEBUG_H */ Propchange: trunk/reactos/include/reactos/wine/debug.h ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/lib/3rdparty/libwine/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwine/debug…
============================================================================== --- trunk/reactos/lib/3rdparty/libwine/debug.c (original) +++ trunk/reactos/lib/3rdparty/libwine/debug.c Wed Nov 14 15:18:37 2007 @@ -15,125 +15,289 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <windows.h> +#include "wine/config.h" +#include "wine/port.h" + #include <stdlib.h> #include <stdio.h> -#include <tchar.h> - -#include <wine/config.h> -#include <wine/port.h> -#include <wine/debug.h> - -/* ---------------------------------------------------------------------- */ - -static CRITICAL_SECTION WineDebugCS; -static CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &WineDebugCS, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { 0, 0 } -}; -static CRITICAL_SECTION WineDebugCS = { &critsect_debug, -1, 0, 0, 0, 0 }; -static DWORD WineDebugTlsIndex = TLS_OUT_OF_INDEXES; - -/* ---------------------------------------------------------------------- */ - -struct debug_info -{ - char *str_pos; /* current position in strings buffer */ - char *out_pos; /* current position in output buffer */ - char strings[1024]; /* buffer for temporary strings */ - char output[1024]; /* current output line */ -}; - -static struct debug_info tmp = { tmp.strings, tmp.output }; - -/* get the debug info pointer for the current thread */ -static inline struct debug_info *get_info(void) -{ - struct debug_info *info; - - if (WineDebugTlsIndex == TLS_OUT_OF_INDEXES) - { - EnterCriticalSection(&WineDebugCS); - if (WineDebugTlsIndex == TLS_OUT_OF_INDEXES) - { - DWORD NewTlsIndex = TlsAlloc(); - if (NewTlsIndex == TLS_OUT_OF_INDEXES) +#include <stdarg.h> +#include <string.h> +#include <ctype.h> +#include <excpt.h> + +#define WIN32_NO_STATUS +#include "wine/debug.h" +#include "wine/library.h" + +#include <rtlfuncs.h> +#include <cmfuncs.h> + +#define KEY_QUERY_VALUE 1 +#define REG_SZ 1 + +ULONG +__cdecl +DbgPrint( + IN PCCH Format, + IN ... +); + +static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" }; + +#define MAX_DEBUG_OPTIONS 256 + +static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME); +static int nb_debug_options = -1; +static struct __wine_debug_channel debug_options[MAX_DEBUG_OPTIONS]; + +static struct __wine_debug_functions funcs; + +static void debug_init(void); + +static int cmp_name( const void *p1, const void *p2 ) +{ + const char *name = p1; + const struct __wine_debug_channel *chan = p2; + return strcmp( name, chan->name ); +} + +/* get the flags to use for a given channel, possibly setting them too in case of lazy init */ +unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ) +{ + if (nb_debug_options == -1) debug_init(); + + if (nb_debug_options) + { + struct __wine_debug_channel *opt = bsearch( channel->name, debug_options, nb_debug_options, + sizeof(debug_options[0]), cmp_name ); + if (opt) return opt->flags; + } + /* no option for this channel */ + if (channel->flags & (1 << __WINE_DBCL_INIT)) channel->flags = default_flags; + return default_flags; +} + +/* set the flags to use for a given channel; return 0 if the channel is not available to set */ +int __wine_dbg_set_channel_flags( struct __wine_debug_channel *channel, + unsigned char set, unsigned char clear ) +{ + if (nb_debug_options == -1) debug_init(); + + if (nb_debug_options) + { + struct __wine_debug_channel *opt = bsearch( channel->name, debug_options, nb_debug_options, + sizeof(debug_options[0]), cmp_name ); + if (opt) + { + opt->flags = (opt->flags & ~clear) | set; + return 1; + } + } + return 0; +} + +/* add a new debug option at the end of the option list */ +static void add_option( const char *name, unsigned char set, unsigned char clear ) +{ + int min = 0, max = nb_debug_options - 1, pos, res; + + if (!name[0]) /* "all" option */ + { + default_flags = (default_flags & ~clear) | set; + return; + } + if (strlen(name) >= sizeof(debug_options[0].name)) return; + + while (min <= max) + { + pos = (min + max) / 2; + res = strcmp( name, debug_options[pos].name ); + if (!res) + { + debug_options[pos].flags = (debug_options[pos].flags & ~clear) | set; + return; + } + if (res < 0) max = pos - 1; + else min = pos + 1; + } + if (nb_debug_options >= MAX_DEBUG_OPTIONS) return; + + pos = min; + if (pos < nb_debug_options) memmove( &debug_options[pos + 1], &debug_options[pos], + (nb_debug_options - pos) * sizeof(debug_options[0]) ); + strcpy( debug_options[pos].name, name ); + debug_options[pos].flags = (default_flags & ~clear) | set; + nb_debug_options++; +} + +/* parse a set of debugging option specifications and add them to the option list */ +static void parse_options( char *options ) +{ + char *opt, *next; + unsigned int i; + + for (opt = options; opt; opt = next) + { + const char *p; + unsigned char set = 0, clear = 0; + + if ((next = strchr( opt, ',' ))) *next++ = 0; + + p = opt + strcspn( opt, "+-" ); + if (!p[0]) p = opt; /* assume it's a debug channel name */ + + if (p > opt) + { + for (i = 0; i < sizeof(debug_classes)/sizeof(debug_classes[0]); i++) { - LeaveCriticalSection(&WineDebugCS); - return &tmp; + int len = strlen(debug_classes[i]); + if (len != (p - opt)) continue; + if (!memcmp( opt, debug_classes[i], len )) /* found it */ + { + if (*p == '+') set |= 1 << i; + else clear |= 1 << i; + break; + } } - info = HeapAlloc(GetProcessHeap(), 0, sizeof(*info)); - if (!info) - { - LeaveCriticalSection(&WineDebugCS); - TlsFree(NewTlsIndex); - return &tmp; - } - info->str_pos = info->strings; - info->out_pos = info->output; - TlsSetValue(NewTlsIndex, info); - WineDebugTlsIndex = NewTlsIndex; - } - LeaveCriticalSection(&WineDebugCS); - } - - return TlsGetValue(WineDebugTlsIndex); -} - -/* allocate some tmp space for a string */ -static void *gimme1(int n) -{ - struct debug_info *info = get_info(); - char *res = info->str_pos; - - if (res + n >= &info->strings[sizeof(info->strings)]) res = info->strings; - info->str_pos = res + n; - return res; -} - -/* release extra space that we requested in gimme1() */ -static inline void release(void *ptr) -{ - struct debug_info *info; - if (WineDebugTlsIndex == TLS_OUT_OF_INDEXES) - info = &tmp; - else - info = TlsGetValue(WineDebugTlsIndex); - info->str_pos = ptr; -} - -/*********************************************************************** - * wine_dbgstr_an - */ -const char *wine_dbgstr_an(const char *src, int n) -{ + if (i == sizeof(debug_classes)/sizeof(debug_classes[0])) /* bad class name, skip it */ + continue; + } + else + { + if (*p == '-') clear = ~0; + else set = ~0; + } + if (*p == '+' || *p == '-') p++; + if (!p[0]) continue; + + if (!strcmp( p, "all" )) + default_flags = (default_flags & ~clear) | set; + else + add_option( p, set, clear ); + } +} + +/* initialize all options at startup */ +static void debug_init(void) +{ + char *wine_debug; + DWORD dwLength; + + if (nb_debug_options != -1) return; /* already initialized */ + nb_debug_options = 0; + + dwLength = GetEnvironmentVariableA("DEBUGCHANNEL", NULL, 0); + if (dwLength) + { + wine_debug = malloc(dwLength); + if (wine_debug) + { + if (GetEnvironmentVariableA("DEBUGCHANNEL", wine_debug, dwLength) < dwLength) + parse_options(wine_debug); + free(wine_debug); + } + } +} + +/* varargs wrapper for funcs.dbg_vprintf */ +int wine_dbg_printf( const char *format, ... ) +{ + int ret; + va_list valist; + + va_start(valist, format); + ret = funcs.dbg_vprintf( format, valist ); + va_end(valist); + return ret; +} + +/* printf with temp buffer allocation */ +const char *wine_dbg_sprintf( const char *format, ... ) +{ + static const int max_size = 200; + char *ret; + int len; + va_list valist; + + va_start(valist, format); + ret = funcs.get_temp_buffer( max_size ); + len = vsnprintf( ret, max_size, format, valist ); + if (len == -1 || len >= max_size) ret[max_size-1] = 0; + else funcs.release_temp_buffer( ret, len + 1 ); + va_end(valist); + return ret; +} + + +/* varargs wrapper for funcs.dbg_vlog */ +int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *channel, + const char *file, const char *func, const int line, const char *format, ... ) +{ + int ret; + va_list valist; + + if (!(__wine_dbg_get_channel_flags( channel ) & (1 << cls))) return -1; + + va_start(valist, format); + ret = funcs.dbg_vlog( cls, channel, file, func, line, format, valist ); + va_end(valist); + return ret; +} + + +/* allocate some tmp string space */ +/* FIXME: this is not 100% thread-safe */ +static char *get_temp_buffer( size_t size ) +{ + static char *list[32]; + static long pos; + char *ret; + int idx; + + idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0])); + if ((ret = realloc( list[idx], size ))) list[idx] = ret; + return ret; +} + + +/* release unused part of the buffer */ +static void release_temp_buffer( char *buffer, size_t size ) +{ + /* don't bother doing anything */ +} + + +/* default implementation of wine_dbgstr_an */ +static const char *default_dbgstr_an( const char *str, int n ) +{ + static const char hex[16] = "0123456789abcdef"; char *dst, *res; - - if (!HIWORD(src)) - { - if (!src) return "(null)"; - res = gimme1(6); - sprintf(res, "#%04x", (WORD)(DWORD)(src) ); + size_t size; + + if (!((ULONG_PTR)str >> 16)) + { + if (!str) return "(null)"; + res = funcs.get_temp_buffer( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); return res; } + if (n == -1) n = strlen(str); if (n < 0) n = 0; - else if (n > 200) n = 200; - dst = res = gimme1 (n * 4 + 6); + size = 10 + min( 300, n * 4 ); + dst = res = funcs.get_temp_buffer( size ); *dst++ = '"'; - while (n-- > 0 && *src) - { - unsigned char c = *src++; + while (n-- > 0 && dst <= res + size - 9) + { + unsigned char c = *str++; switch (c) { case '\n': *dst++ = '\\'; *dst++ = 'n'; break; case '\r': *dst++ = '\\'; *dst++ = 'r'; break; case '\t': *dst++ = '\\'; *dst++ = 't'; break; - case '"': *dst++ = '\\'; *dst++ = '"'; break; + case '"': *dst++ = '\\'; *dst++ = '"'; break; case '\\': *dst++ = '\\'; *dst++ = '\\'; break; default: if (c >= ' ' && c <= 126) @@ -141,52 +305,58 @@ else { *dst++ = '\\'; - *dst++ = '0' + ((c >> 6) & 7); - *dst++ = '0' + ((c >> 3) & 7); - *dst++ = '0' + ((c >> 0) & 7); + *dst++ = 'x'; + *dst++ = hex[(c >> 4) & 0x0f]; + *dst++ = hex[c & 0x0f]; } } } *dst++ = '"'; - if (*src) - { - *dst++ = '.'; - *dst++ = '.'; - *dst++ = '.'; - } - *dst++ = '\0'; - release( dst ); + if (n > 0) + { + *dst++ = '.'; + *dst++ = '.'; + *dst++ = '.'; + } + *dst++ = 0; + funcs.release_temp_buffer( res, dst - res ); return res; } -/*********************************************************************** - * wine_dbgstr_wn - */ -const char *wine_dbgstr_wn(const WCHAR *src, int n) + +/* default implementation of wine_dbgstr_wn */ +static const char *default_dbgstr_wn( const WCHAR *str, int n ) { char *dst, *res; - - if (!HIWORD(src)) - { - if (!src) return "(null)"; - res = gimme1(6); - sprintf(res, "#%04x", (WORD)(DWORD)(src) ); + size_t size; + + if (!((ULONG_PTR)str >> 16)) + { + if (!str) return "(null)"; + res = funcs.get_temp_buffer( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); return res; } + if (n == -1) + { + const WCHAR *end = str; + while (*end) end++; + n = end - str; + } if (n < 0) n = 0; - else if (n > 200) n = 200; - dst = res = gimme1(n * 5 + 7); + size = 12 + min( 300, n * 5 ); + dst = res = funcs.get_temp_buffer( n * 5 + 7 ); *dst++ = 'L'; *dst++ = '"'; - while (n-- > 0 && *src) - { - WCHAR c = *src++; + while (n-- > 0 && dst <= res + size - 10) + { + WCHAR c = *str++; switch (c) { case '\n': *dst++ = '\\'; *dst++ = 'n'; break; case '\r': *dst++ = '\\'; *dst++ = 'r'; break; case '\t': *dst++ = '\\'; *dst++ = 't'; break; - case '"': *dst++ = '\\'; *dst++ = '"'; break; + case '"': *dst++ = '\\'; *dst++ = '"'; break; case '\\': *dst++ = '\\'; *dst++ = '\\'; break; default: if (c >= ' ' && c <= 126) @@ -200,37 +370,67 @@ } } *dst++ = '"'; - if (*src) - { - *dst++ = '.'; - *dst++ = '.'; - *dst++ = '.'; - } - *dst++ = '\0'; - release(dst); + if (n > 0) + { + *dst++ = '.'; + *dst++ = '.'; + *dst++ = '.'; + } + *dst++ = 0; + funcs.release_temp_buffer( res, dst - res ); return res; } -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, ... ) -{ - char* buffer = gimme1(1024); - va_list ap; - - va_start(ap, format); - release(buffer+vsnprintf(buffer, 1024, format, ap)); - va_end(ap); - - return buffer; -} - -const char *wine_dbgstr_w( const WCHAR *s ) -{ - return wine_dbgstr_wn( s, -1 ); -} + +/* default implementation of wine_dbg_vprintf */ +static int default_dbg_vprintf( const char *format, va_list args ) +{ + char buffer[512]; + vsnprintf( buffer, sizeof(buffer), format, args ); + buffer[sizeof(buffer) - 1] = '\0'; + return DbgPrint( buffer ); +} + + +/* default implementation of wine_dbg_vlog */ +static int default_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_channel *channel, + const char *file, const char *func, const int line, const char *format, va_list args ) +{ + int ret = 0; + + if (cls < sizeof(debug_classes)/sizeof(debug_classes[0])) + ret += wine_dbg_printf( "%s:", debug_classes[cls] ); + ret += wine_dbg_printf ( "(%s:%d) ", file, line ); + if (format) + ret += funcs.dbg_vprintf( format, args ); + return ret; +} + +/* wrappers to use the function pointers */ + +const char *wine_dbgstr_an( const char * s, int n ) +{ + return funcs.dbgstr_an(s, n); +} + +const char *wine_dbgstr_wn( const WCHAR *s, int n ) +{ + return funcs.dbgstr_wn(s, n); +} + +void __wine_dbg_set_functions( const struct __wine_debug_functions *new_funcs, + struct __wine_debug_functions *old_funcs, size_t size ) +{ + if (old_funcs) memcpy( old_funcs, &funcs, min(sizeof(funcs),size) ); + if (new_funcs) memcpy( &funcs, new_funcs, min(sizeof(funcs),size) ); +} + +static struct __wine_debug_functions funcs = +{ + get_temp_buffer, + release_temp_buffer, + default_dbgstr_an, + default_dbgstr_wn, + default_dbg_vprintf, + default_dbg_vlog +};
17 years, 1 month
1
0
0
0
[gedmurphy] 30437: I thought these changes were in the last commit..
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed Nov 14 14:43:10 2007 New Revision: 30437 URL:
http://svn.reactos.org/svn/reactos?rev=30437&view=rev
Log: I thought these changes were in the last commit.. Modified: trunk/reactos/base/applications/mstsc/connectdialog.c Modified: trunk/reactos/base/applications/mstsc/connectdialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/co…
============================================================================== --- trunk/reactos/base/applications/mstsc/connectdialog.c (original) +++ trunk/reactos/base/applications/mstsc/connectdialog.c Wed Nov 14 14:43:10 2007 @@ -1093,7 +1093,7 @@ HDC hdcMem = CreateCompatibleDC(hdc); if (hdcMem) { - WCHAR lpBuffer[32]; + WCHAR szBuffer[32]; RECT bmpRc, txtRc; LOGFONTW lf; HFONT hFont; @@ -1120,7 +1120,10 @@ ZeroMemory(&lf, sizeof(LOGFONT)); - if (LoadStringW(hInst, IDS_HEADERTEXT1, lpBuffer, 32)) + if (LoadStringW(hInst, + IDS_HEADERTEXT1, + szBuffer, + sizeof(szBuffer) / sizeof(WCHAR))) { lf.lfHeight = 24; lf.lfCharSet = OEM_CHARSET; @@ -1136,7 +1139,11 @@ DPtoLP(hdc, (PPOINT)&txtRc, 2); SetTextColor(hdc, RGB(255,255,255)); SetBkMode(hdc, TRANSPARENT); - DrawTextW(hdc, lpBuffer, -1, &txtRc, DT_BOTTOM | DT_SINGLELINE); + DrawTextW(hdc, + szBuffer, + -1, + &txtRc, + DT_BOTTOM | DT_SINGLELINE); DeleteObject(hFont); } } @@ -1146,7 +1153,10 @@ txtRc.right = bmpRc.right * 0.75; txtRc.bottom = pInfo->headerbitmap.bmHeight * 0.9; - if (LoadStringW(hInst, IDS_HEADERTEXT2, lpBuffer, 32)) + if (LoadStringW(hInst, + IDS_HEADERTEXT2, + szBuffer, + sizeof(szBuffer) / sizeof(WCHAR))) { lf.lfHeight = 30; lf.lfCharSet = OEM_CHARSET; @@ -1162,7 +1172,11 @@ DPtoLP(hdc, (PPOINT)&txtRc, 2); SetTextColor(hdc, RGB(255,255,255)); SetBkMode(hdc, TRANSPARENT); - DrawTextW(hdc, lpBuffer, -1, &txtRc, DT_TOP | DT_SINGLELINE); + DrawTextW(hdc, + szBuffer, + -1, + &txtRc, + DT_TOP | DT_SINGLELINE); } }
17 years, 1 month
1
0
0
0
[cwittich] 30436: add stub for Wow64EnableWow64FsRedirection
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Nov 14 14:39:32 2007 New Revision: 30436 URL:
http://svn.reactos.org/svn/reactos?rev=30436&view=rev
Log: add stub for Wow64EnableWow64FsRedirection Modified: trunk/reactos/dll/win32/kernel32/kernel32.def trunk/reactos/dll/win32/kernel32/misc/stubs.c Modified: trunk/reactos/dll/win32/kernel32/kernel32.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.def (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.def Wed Nov 14 14:39:32 2007 @@ -972,6 +972,7 @@ WaitNamedPipeW@8 WideCharToMultiByte@32 WinExec@8 +Wow64EnableWow64FsRedirection@4 Wow64DisableWow64FsRedirection@4 Wow64RevertWow64FsRedirection@4 WriteConsoleA@20 Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/st…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/kernel32/misc/stubs.c Wed Nov 14 14:39:32 2007 @@ -1344,6 +1344,14 @@ BOOL STDCALL +Wow64EnableWow64FsRedirection (BOOL Wow64EnableWow64FsRedirection) +{ + STUB; + return FALSE; +} + +BOOL +STDCALL Wow64DisableWow64FsRedirection (VOID ** pv) { STUB;
17 years, 1 month
1
0
0
0
[gedmurphy] 30435: load the header text from the resources
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed Nov 14 14:34:10 2007 New Revision: 30435 URL:
http://svn.reactos.org/svn/reactos?rev=30435&view=rev
Log: load the header text from the resources Modified: trunk/reactos/base/applications/mstsc/connectdialog.c trunk/reactos/base/applications/mstsc/lang/en-US.rc trunk/reactos/base/applications/mstsc/res/header.bmp trunk/reactos/base/applications/mstsc/res/header.pdn trunk/reactos/base/applications/mstsc/resource.h trunk/reactos/base/applications/mstsc/rsrc.rc Modified: trunk/reactos/base/applications/mstsc/connectdialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/co…
============================================================================== --- trunk/reactos/base/applications/mstsc/connectdialog.c (original) +++ trunk/reactos/base/applications/mstsc/connectdialog.c Wed Nov 14 14:34:10 2007 @@ -52,6 +52,7 @@ ReLoadDisplayPage(pInfo); } } + static VOID DoSaveAs(PINFO pInfo) @@ -932,6 +933,8 @@ GWLP_USERDATA, (LONG_PTR)pInfo); + pInfo->hSelf = hwnd; + /* add main settings pointer */ pInfo->pRdpSettings = pRdpSettings; @@ -1090,16 +1093,79 @@ HDC hdcMem = CreateCompatibleDC(hdc); if (hdcMem) { + WCHAR lpBuffer[32]; + RECT bmpRc, txtRc; + LOGFONTW lf; + HFONT hFont; + + GetClientRect(pInfo->hSelf, &bmpRc); + SelectObject(hdcMem, pInfo->hHeader); - BitBlt(hdc, - 0, - 0, - pInfo->headerbitmap.bmWidth, - pInfo->headerbitmap.bmHeight, - hdcMem, - 0, - 0, - SRCCOPY); + StretchBlt(hdc, + 0, + 0, + bmpRc.right, + pInfo->headerbitmap.bmHeight, + hdcMem, + 0, + 0, + pInfo->headerbitmap.bmWidth, + pInfo->headerbitmap.bmHeight, + SRCCOPY); + + txtRc.left = bmpRc.right * 0.25; + txtRc.top = 10; + txtRc.right = bmpRc.right * 0.75; + txtRc.bottom = pInfo->headerbitmap.bmHeight * 0.5; + + ZeroMemory(&lf, sizeof(LOGFONT)); + + if (LoadStringW(hInst, IDS_HEADERTEXT1, lpBuffer, 32)) + { + lf.lfHeight = 24; + lf.lfCharSet = OEM_CHARSET; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfWeight = FW_MEDIUM; + wcscpy(lf.lfFaceName, L"Tahoma"); + + hFont = CreateFontIndirectW(&lf); + if (hFont) + { + SelectObject(hdc, hFont); + + DPtoLP(hdc, (PPOINT)&txtRc, 2); + SetTextColor(hdc, RGB(255,255,255)); + SetBkMode(hdc, TRANSPARENT); + DrawTextW(hdc, lpBuffer, -1, &txtRc, DT_BOTTOM | DT_SINGLELINE); + DeleteObject(hFont); + } + } + + txtRc.left = bmpRc.right * 0.25; + txtRc.top = txtRc.bottom - 5; + txtRc.right = bmpRc.right * 0.75; + txtRc.bottom = pInfo->headerbitmap.bmHeight * 0.9; + + if (LoadStringW(hInst, IDS_HEADERTEXT2, lpBuffer, 32)) + { + lf.lfHeight = 30; + lf.lfCharSet = OEM_CHARSET; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfWeight = FW_EXTRABOLD; + wcscpy(lf.lfFaceName, L"Tahoma"); + + hFont = CreateFontIndirectW(&lf); + if (hFont) + { + SelectObject(hdc, hFont); + + DPtoLP(hdc, (PPOINT)&txtRc, 2); + SetTextColor(hdc, RGB(255,255,255)); + SetBkMode(hdc, TRANSPARENT); + DrawTextW(hdc, lpBuffer, -1, &txtRc, DT_TOP | DT_SINGLELINE); + } + } + DeleteDC(hdcMem); } Modified: trunk/reactos/base/applications/mstsc/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/la…
============================================================================== --- trunk/reactos/base/applications/mstsc/lang/en-US.rc (original) +++ trunk/reactos/base/applications/mstsc/lang/en-US.rc Wed Nov 14 14:34:10 2007 @@ -38,14 +38,14 @@ LTEXT "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 120, 10, SS_CENTER END -IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 267 +IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 262 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Remote Desktop Connection" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "Connect",IDOK,147,249,50,14 - PUSHBUTTON "Cancel",IDCANCEL,203,249,50,14 - CONTROL "",IDC_TAB,"SysTabControl32",0x0,7,54,246,190 + DEFPUSHBUTTON "Connect",IDOK,147,245,50,14 + PUSHBUTTON "Cancel",IDCANCEL,203,245,50,14 + CONTROL "",IDC_TAB,"SysTabControl32",0x0,7,50,246,190 END @@ -60,4 +60,6 @@ IDS_PIXEL "%lux%lu Pixels" IDS_FULLSCREEN "Full Screen" IDS_BROWSESERVER "<Browse for more...>" + IDS_HEADERTEXT1 "Remote Desktop" + IDS_HEADERTEXT2 "Connection" END Modified: trunk/reactos/base/applications/mstsc/res/header.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/re…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/base/applications/mstsc/res/header.pdn URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/re…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/base/applications/mstsc/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/re…
============================================================================== --- trunk/reactos/base/applications/mstsc/resource.h (original) +++ trunk/reactos/base/applications/mstsc/resource.h Wed Nov 14 14:34:10 2007 @@ -26,14 +26,17 @@ #define IDB_HEADER 1100 #define IDB_SPECT 1101 -#define IDI_LOGON 2000 -#define IDI_CONN 2001 -#define IDI_REMOTE 2002 -#define IDI_COLORS 2003 -#define IDI_MSTSC 2004 +#define IDI_MSTSC 2000 +#define IDI_LOGON 2001 +#define IDI_CONN 2002 +#define IDI_REMOTE 2003 +#define IDI_COLORS 2004 + #define IDS_TAB_DISPLAY 3000 #define IDS_TAB_GENERAL 3001 #define IDS_PIXEL 3006 #define IDS_FULLSCREEN 3007 #define IDS_BROWSESERVER 3008 +#define IDS_HEADERTEXT1 3009 +#define IDS_HEADERTEXT2 3010 Modified: trunk/reactos/base/applications/mstsc/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rs…
============================================================================== --- trunk/reactos/base/applications/mstsc/rsrc.rc (original) +++ trunk/reactos/base/applications/mstsc/rsrc.rc Wed Nov 14 14:34:10 2007 @@ -14,7 +14,7 @@ IDB_HEADER BITMAP "res/header.bmp" IDB_SPECT BITMAP "res/spectrum.bmp" -#include "lang/de-DE.rc" +//#include "lang/de-DE.rc" #include "lang/en-US.rc" -#include "lang/fr-FR.rc" -#include "lang/ru-RU.rc" +//#include "lang/fr-FR.rc" +//#include "lang/ru-RU.rc"
17 years, 1 month
1
0
0
0
[hpoussin] 30434: Let Wine library use kernel32 functions
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Nov 14 13:56:17 2007 New Revision: 30434 URL:
http://svn.reactos.org/svn/reactos?rev=30434&view=rev
Log: Let Wine library use kernel32 functions Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.rb…
============================================================================== --- trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild (original) +++ trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild Wed Nov 14 13:56:17 2007 @@ -21,8 +21,8 @@ <define name="__MINGW_IMPORT">"extern __attribute__ ((dllexport))"</define> <library>crt</library> + <library>wine</library> <library>kernel32</library> - <library>wine</library> <library>ntdll</library> <pch>precomp.h</pch> <file>dllmain.c</file>
17 years, 1 month
1
0
0
0
[hpoussin] 30433: Add missing debug channel declarations
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Nov 14 12:02:53 2007 New Revision: 30433 URL:
http://svn.reactos.org/svn/reactos?rev=30433&view=rev
Log: Add missing debug channel declarations Modified: trunk/reactos/base/system/winlogon/sas.c trunk/reactos/base/system/winlogon/wlx.c trunk/reactos/dll/win32/iphlpapi/media.c trunk/reactos/dll/win32/kernel32/file/lock.c trunk/reactos/dll/win32/kernel32/kernel32.rbuild trunk/reactos/dll/win32/msgina/stubs.c trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild trunk/reactos/dll/win32/newdev/stubs.c trunk/reactos/dll/win32/user32/misc/stubs.c trunk/reactos/dll/win32/user32/windows/cursor.c trunk/reactos/dll/win32/user32/windows/draw.c trunk/reactos/dll/win32/user32/windows/hook.c trunk/reactos/dll/win32/user32/windows/messagebox.c trunk/reactos/dll/win32/user32/windows/paint.c Modified: trunk/reactos/base/system/winlogon/sas.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/sas.c…
============================================================================== --- trunk/reactos/base/system/winlogon/sas.c (original) +++ trunk/reactos/base/system/winlogon/sas.c Wed Nov 14 12:02:53 2007 @@ -112,7 +112,7 @@ } else if (dwType != REG_SZ) { - TRACE("Wrong type for %S\\%S registry entry (got 0x%lx, expected 0x%lx)\n", + TRACE("Wrong type for %S\\%S registry entry (got 0x%lx, expected 0x%x)\n", SubKey, ValueName, dwType, REG_SZ); goto cleanup; } @@ -415,7 +415,7 @@ pACL, FALSE)) // not a default DACL { - ERR("SetSecurityDescriptorDacl Error %u\n", GetLastError()); + ERR("SetSecurityDescriptorDacl Error %lu\n", GetLastError()); HeapFree(GetProcessHeap(), 0, pMem); return STATUS_UNSUCCESSFUL; } @@ -466,7 +466,7 @@ Status = CreateLogoffSecurityAttributes(&psa); if (!NT_SUCCESS(Status)) { - ERR("Failed to create a required security descriptor. Status 0x%08x\n", Status); + ERR("Failed to create a required security descriptor. Status 0x%08lx\n", Status); HeapFree(GetProcessHeap(), 0, LSData); return Status; } Modified: trunk/reactos/base/system/winlogon/wlx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/wlx.c…
============================================================================== --- trunk/reactos/base/system/winlogon/wlx.c (original) +++ trunk/reactos/base/system/winlogon/wlx.c Wed Nov 14 12:02:53 2007 @@ -667,7 +667,7 @@ } else { - TRACE("About to negociate with Gina %S. Winlogon uses version %lx\n", + TRACE("About to negociate with Gina %S. Winlogon uses version %x\n", GinaDll, WLX_CURRENT_VERSION); if (!Functions->WlxNegotiate(WLX_CURRENT_VERSION, DllVersion)) goto cleanup; Modified: trunk/reactos/dll/win32/iphlpapi/media.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/media.c…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/media.c (original) +++ trunk/reactos/dll/win32/iphlpapi/media.c Wed Nov 14 12:02:53 2007 @@ -19,12 +19,14 @@ */ #include "iphlpapi_private.h" +WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); + /* * @unimplemented */ DWORD STDCALL DisableMediaSense(HANDLE *pHandle,OVERLAPPED *pOverLapped) { - UNIMPLEMENTED + UNIMPLEMENTED; return 0L; } @@ -33,7 +35,7 @@ */ DWORD STDCALL RestoreMediaSense(OVERLAPPED* pOverlapped,LPDWORD lpdwEnableCount) { - UNIMPLEMENTED + UNIMPLEMENTED; return 0L; } Modified: trunk/reactos/dll/win32/kernel32/file/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/lo…
============================================================================== --- trunk/reactos/dll/win32/kernel32/file/lock.c (original) +++ trunk/reactos/dll/win32/kernel32/file/lock.c Wed Nov 14 12:02:53 2007 @@ -17,6 +17,8 @@ //#define YDEBUG #include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(kernel32); /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.rbuild (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild Wed Nov 14 12:02:53 2007 @@ -126,6 +126,7 @@ <define name="_DISABLE_TIDENTS" /> <define name="WINVER">0x0500</define> <library>kernel32_base</library> + <library>wine</library> <library>pseh</library> <library>ntdll</library> <linkerflag>-lgcc</linkerflag> Modified: trunk/reactos/dll/win32/msgina/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/stubs.c?r…
============================================================================== --- trunk/reactos/dll/win32/msgina/stubs.c (original) +++ trunk/reactos/dll/win32/msgina/stubs.c Wed Nov 14 12:02:53 2007 @@ -13,6 +13,8 @@ #include <winwlx.h> #include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(msgina); /* * @unimplemented Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.rb…
============================================================================== --- trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild (original) +++ trunk/reactos/dll/win32/msvcrt/msvcrt.rbuild Wed Nov 14 12:02:53 2007 @@ -21,9 +21,9 @@ <define name="__MINGW_IMPORT">"extern __attribute__ ((dllexport))"</define> <library>crt</library> - <library>ntdll</library> <library>kernel32</library> <library>wine</library> + <library>ntdll</library> <pch>precomp.h</pch> <file>dllmain.c</file> <file>msvcrt.rc</file> Modified: trunk/reactos/dll/win32/newdev/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/stubs.c?r…
============================================================================== --- trunk/reactos/dll/win32/newdev/stubs.c (original) +++ trunk/reactos/dll/win32/newdev/stubs.c Wed Nov 14 12:02:53 2007 @@ -19,6 +19,8 @@ */ #include "newdev_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(newdev); /* * @unimplemented Modified: trunk/reactos/dll/win32/user32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/stub…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/user32/misc/stubs.c Wed Nov 14 12:02:53 2007 @@ -14,6 +14,8 @@ #include <wine/debug.h> +WINE_DEFAULT_DEBUG_CHANNEL(user32); + /* * @unimplemented */ Modified: trunk/reactos/dll/win32/user32/windows/cursor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/c…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/cursor.c (original) +++ trunk/reactos/dll/win32/user32/windows/cursor.c Wed Nov 14 12:02:53 2007 @@ -32,6 +32,8 @@ #include <wine/debug.h> +WINE_DEFAULT_DEBUG_CHANNEL(user32); + #undef CopyCursor HBITMAP Modified: trunk/reactos/dll/win32/user32/windows/draw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/draw.c (original) +++ trunk/reactos/dll/win32/user32/windows/draw.c Wed Nov 14 12:02:53 2007 @@ -31,6 +31,8 @@ #include <user32.h> #include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(user32); /* GLOBALS *******************************************************************/ Modified: trunk/reactos/dll/win32/user32/windows/hook.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/h…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/hook.c (original) +++ trunk/reactos/dll/win32/user32/windows/hook.c Wed Nov 14 12:02:53 2007 @@ -31,6 +31,8 @@ #include <user32.h> #include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(user32); /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/dll/win32/user32/windows/messagebox.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/messagebox.c (original) +++ trunk/reactos/dll/win32/user32/windows/messagebox.c Wed Nov 14 12:02:53 2007 @@ -34,6 +34,8 @@ #include <user32.h> #include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(user32); /* DEFINES *******************************************************************/ Modified: trunk/reactos/dll/win32/user32/windows/paint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/p…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/paint.c (original) +++ trunk/reactos/dll/win32/user32/windows/paint.c Wed Nov 14 12:02:53 2007 @@ -31,6 +31,8 @@ #include <user32.h> #include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(user32); static HBRUSH FrameBrushes[13]; static HBITMAP hHatch;
17 years, 1 month
1
0
0
0
[hpoussin] 30432: Don't mix ReactOS and Wine debug style
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Nov 14 10:53:01 2007 New Revision: 30432 URL:
http://svn.reactos.org/svn/reactos?rev=30432&view=rev
Log: Don't mix ReactOS and Wine debug style Modified: trunk/reactos/dll/win32/advapi32/token/token.c Modified: trunk/reactos/dll/win32/advapi32/token/token.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/token/t…
============================================================================== --- trunk/reactos/dll/win32/advapi32/token/token.c (original) +++ trunk/reactos/dll/win32/advapi32/token/token.c Wed Nov 14 10:53:01 2007 @@ -11,10 +11,7 @@ #include <advapi32.h> #define NDEBUG -#include <wine/debug.h> #include <debug.h> - -WINE_DEFAULT_DEBUG_CHANNEL(advapi32); /* * @implemented @@ -591,7 +588,7 @@ PHANDLE NewTokenHandle ) { - FIXME("unimplemented!\n", __FUNCTION__); + UNIMPLEMENTED; return FALSE; }
17 years, 1 month
1
0
0
0
[janderwald] 30431: - implement _ILIsMyDocuments - halfplement MyDocuments shell folder based on desktop code - insert MyDocuments folder before MyComputer pidl - setup still needs to create the MyDocuments folder
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Nov 14 03:45:08 2007 New Revision: 30431 URL:
http://svn.reactos.org/svn/reactos?rev=30431&view=rev
Log: - implement _ILIsMyDocuments - halfplement MyDocuments shell folder based on desktop code - insert MyDocuments folder before MyComputer pidl - setup still needs to create the MyDocuments folder Added: trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c (with props) Modified: trunk/reactos/dll/win32/shell32/pidl.c trunk/reactos/dll/win32/shell32/pidl.h trunk/reactos/dll/win32/shell32/regsvr.c trunk/reactos/dll/win32/shell32/shell32.rbuild trunk/reactos/dll/win32/shell32/shell32_main.h trunk/reactos/dll/win32/shell32/shellole.c trunk/reactos/dll/win32/shell32/shfldr_desktop.c Modified: trunk/reactos/dll/win32/shell32/pidl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.c?r…
============================================================================== --- trunk/reactos/dll/win32/shell32/pidl.c (original) +++ trunk/reactos/dll/win32/shell32/pidl.c Wed Nov 14 03:45:08 2007 @@ -1623,6 +1623,17 @@ return pidl && pidl->mkid.cb ? 0 : 1; } +BOOL _ILIsMyDocuments(LPCITEMIDLIST pidl) +{ + REFIID iid = _ILGetGUIDPointer(pidl); + + TRACE("(%p)\n",pidl); + + if (iid) + return IsEqualIID(iid, &CLSID_MyDocuments); + return FALSE; +} + BOOL _ILIsMyComputer(LPCITEMIDLIST pidl) { REFIID iid = _ILGetGUIDPointer(pidl); @@ -1633,6 +1644,7 @@ return IsEqualIID(iid, &CLSID_MyComputer); return FALSE; } + BOOL _ILIsBitBucket(LPCITEMIDLIST pidl) { REFIID iid = _ILGetGUIDPointer(pidl); Modified: trunk/reactos/dll/win32/shell32/pidl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.h?r…
============================================================================== --- trunk/reactos/dll/win32/shell32/pidl.h (original) +++ trunk/reactos/dll/win32/shell32/pidl.h Wed Nov 14 03:45:08 2007 @@ -204,6 +204,7 @@ BOOL _ILIsUnicode (LPCITEMIDLIST pidl); BOOL _ILIsDesktop (LPCITEMIDLIST pidl); BOOL _ILIsMyComputer (LPCITEMIDLIST pidl); +BOOL _ILIsMyDocuments (LPCITEMIDLIST pidl); BOOL _ILIsBitBucket (LPCITEMIDLIST pidl); BOOL _ILIsDrive (LPCITEMIDLIST pidl); BOOL _ILIsFolder (LPCITEMIDLIST pidl); Modified: trunk/reactos/dll/win32/shell32/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/regsvr.c…
============================================================================== --- trunk/reactos/dll/win32/shell32/regsvr.c (original) +++ trunk/reactos/dll/win32/shell32/regsvr.c Wed Nov 14 03:45:08 2007 @@ -714,12 +714,12 @@ wszDesktop, wszSlash }, +#endif { &CLSID_MyDocuments, wszDesktop, wszMyDocuments }, -#endif { &CLSID_RecycleBin, wszDesktop, Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.rbuild (original) +++ trunk/reactos/dll/win32/shell32/shell32.rbuild Wed Nov 14 03:45:08 2007 @@ -52,6 +52,7 @@ <file>shfldr_desktop.c</file> <file>shfldr_fs.c</file> <file>shfldr_mycomp.c</file> + <file> shlfldr_mydocuments.c</file> <file>shfldr_printers.c</file> <file>shlexec.c</file> <file>shlfileop.c</file> Modified: trunk/reactos/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.h (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.h Wed Nov 14 03:45:08 2007 @@ -93,6 +93,7 @@ HRESULT WINAPI ISF_Desktop_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI ISF_Printers_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); +HRESULT WINAPI ISF_MyDocuments_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV); HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); Modified: trunk/reactos/dll/win32/shell32/shellole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
============================================================================== --- trunk/reactos/dll/win32/shell32/shellole.c (original) +++ trunk/reactos/dll/win32/shell32/shellole.c Wed Nov 14 03:45:08 2007 @@ -73,8 +73,8 @@ {&CLSID_UnixFolder, &UnixFolder_Constructor}, {&CLSID_UnixDosFolder, &UnixDosFolder_Constructor}, {&CLSID_FolderShortcut, &FolderShortcut_Constructor}, - {&CLSID_MyDocuments, &MyDocuments_Constructor}, #endif + {&CLSID_MyDocuments, &ISF_MyDocuments_Constructor}, {&CLSID_Printers, &ISF_Printers_Constructor}, {&CLSID_RecycleBin, &RecycleBin_Constructor}, {&CLSID_OpenWith, &SHEOW_Constructor}, Modified: trunk/reactos/dll/win32/shell32/shfldr_desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_d…
============================================================================== --- trunk/reactos/dll/win32/shell32/shfldr_desktop.c (original) +++ trunk/reactos/dll/win32/shell32/shfldr_desktop.c Wed Nov 14 03:45:08 2007 @@ -262,6 +262,7 @@ UINT i; /* create the pidl for This item */ + ret = AddToEnumList(list, _ILCreateMyDocuments()); ret = AddToEnumList(list, _ILCreateMyComputer()); for (i=0; i<2; i++) { @@ -269,6 +270,7 @@ Desktop_NameSpaceW, 0, KEY_READ, &hkey)) { WCHAR iid[50]; + LPITEMIDLIST pidl; int i=0; while (ret) @@ -280,7 +282,15 @@ r = RegEnumKeyExW(hkey, i, iid, &size, 0, NULL, NULL, NULL); if (ERROR_SUCCESS == r) { - ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid)); + pidl = _ILCreateGuidFromStrW(iid); + if (_ILIsMyDocuments(pidl)) + { + SHFree(pidl); + } + else + { + ret = AddToEnumList(list, _ILCreateGuidFromStrW(iid)); + } i++; } else if (ERROR_NO_MORE_ITEMS == r) Added: trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfldr_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c (added) +++ trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c Wed Nov 14 03:45:08 2007 @@ -1,0 +1,930 @@ + +/* + * Virtual MyDocuments Folder + * + * Copyright 2007 Johannes Anderwald + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "wingdi.h" +#include "winuser.h" + +#include "ole2.h" +#include "shlguid.h" + +#include "enumidlist.h" +#include "pidl.h" +#include "undocshell.h" +#include "shell32_main.h" +#include "shresdef.h" +#include "shlwapi.h" +#include "shellfolder.h" +#include "wine/debug.h" +#include "debughlp.h" +#include "shfldr.h" + +WINE_DEFAULT_DEBUG_CHANNEL (shell); + +/*********************************************************************** +* MyDocumentsfolder implementation +*/ + +typedef struct { + const IShellFolder2Vtbl *lpVtbl; + const IPersistFolder2Vtbl *lpPF2; + LONG ref; + + /* both paths are parsible from the MyDocuments */ + LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */ + LPITEMIDLIST pidlRoot; /* absolute pidl */ + + UINT cfShellIDList; /* clipboardformat for IDropTarget */ + BOOL fAcceptFmt; /* flag for pending Drop */ +} IGenericSFImpl; + +#define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl) +#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) + +static const shvheader MyDocumentsSFHeader[] = { + {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, + {IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, + {IDS_SHV_COLUMN3, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10}, + {IDS_SHV_COLUMN4, SHCOLSTATE_TYPE_DATE | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 12}, + {IDS_SHV_COLUMN5, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 5} +}; + +#define MYDOCUMENTSSHELLVIEWCOLUMNS 5 + +/************************************************************************** + * ISF_MyDocuments_fnQueryInterface + * + * NOTES supports not IPersist/IPersistFolder + */ +static HRESULT WINAPI ISF_MyDocuments_fnQueryInterface( + IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj); + + *ppvObj = NULL; + + if (IsEqualIID (riid, &IID_IUnknown) || + IsEqualIID (riid, &IID_IShellFolder) || + IsEqualIID (riid, &IID_IShellFolder2)) + { + *ppvObj = This; + } + else if (IsEqualIID (riid, &IID_IPersistFolder) || + IsEqualIID (riid, &IID_IPersistFolder2)) + { + *ppvObj = &This->lpPF2; + } + if (*ppvObj) + { + IUnknown_AddRef ((IUnknown *) (*ppvObj)); + TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); + return S_OK; + } + TRACE ("-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ISF_MyDocuments_fnAddRef (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + TRACE ("(%p)->(count=%u)\n", This, refCount - 1); + + return refCount; +} + +static ULONG WINAPI ISF_MyDocuments_fnRelease (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE ("(%p)->(count=%u)\n", This, refCount + 1); + + if (!refCount) + { + TRACE ("-- destroying IShellFolder(%p)\n", This); + SHFree (This->pidlRoot); + HeapFree(GetProcessHeap(), 0, This->sPathTarget); + HeapFree(GetProcessHeap(), 0, This); + } + return refCount; +} + +static +HRESULT +WINAPI ISF_MyDocuments_fnParseDisplayName (IShellFolder2 * iface, + HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, + DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + WCHAR szElement[MAX_PATH]; + LPCWSTR szNext = NULL; + LPITEMIDLIST pidlTemp = NULL; + HRESULT hr = S_OK; + CLSID clsid; + + TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", + This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), + pchEaten, ppidl, pdwAttributes); + + if (!lpszDisplayName || !ppidl) + return E_INVALIDARG; + + *ppidl = 0; + + if (pchEaten) + *pchEaten = 0; /* strange but like the original */ + + if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') + { + szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH); + TRACE ("-- element: %s\n", debugstr_w (szElement)); + SHCLSIDFromStringW (szElement + 2, &clsid); + pidlTemp = _ILCreateGuid (PT_GUID, &clsid); + } + else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) ) + { + *ppidl = pidlTemp; + return S_OK; + } + else + { + /* it's a filesystem path on the desktop. Let a FSFolder parse it */ + + if (*lpszDisplayName) + { + WCHAR szPath[MAX_PATH]; + LPWSTR pathPtr; + + /* build a complete path to create a simple pidl */ + lstrcpynW(szPath, This->sPathTarget, MAX_PATH); + pathPtr = PathAddBackslashW(szPath); + if (pathPtr) + { + lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath)); + hr = _ILCreateFromPathW(szPath, &pidlTemp); + } + else + { + /* should never reach here, but for completeness */ + hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + } + } + else + pidlTemp = _ILCreateMyComputer(); + + szNext = NULL; + } + + if (SUCCEEDED(hr) && pidlTemp) + { + if (szNext && *szNext) + { + hr = SHELL32_ParseNextElement(iface, hwndOwner, pbc, + &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); + } + else + { + if (pdwAttributes && *pdwAttributes) + hr = SHELL32_GetItemAttributes(_IShellFolder_ (This), + pidlTemp, pdwAttributes); + } + } + + *ppidl = pidlTemp; + + TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr); + + return hr; +} + +/************************************************************************** + * CreateDesktopEnumList() + */ +static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) +{ + BOOL ret = TRUE; + WCHAR szPath[MAX_PATH]; + + TRACE("(%p)->(flags=0x%08x)\n", list, dwFlags); + + /* enumerate the elements in %windir%\desktop */ + SHGetSpecialFolderPathW(0, szPath, CSIDL_MYDOCUMENTS, FALSE); + ret = ret && CreateFolderEnumList(list, szPath, dwFlags); + + return ret; +} + +/************************************************************************** + * ISF_MyDocuments_fnEnumObjects + */ +static HRESULT WINAPI ISF_MyDocuments_fnEnumObjects (IShellFolder2 * iface, + HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", + This, hwndOwner, dwFlags, ppEnumIDList); + + *ppEnumIDList = IEnumIDList_Constructor(); + if (*ppEnumIDList) + CreateDesktopEnumList(*ppEnumIDList, dwFlags); + + TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList); + + return *ppEnumIDList ? S_OK : E_OUTOFMEMORY; +} + +/************************************************************************** + * ISF_MyDocuments_fnBindToObject + */ +static HRESULT WINAPI ISF_MyDocuments_fnBindToObject (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", + This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); + + return SHELL32_BindToChild( This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut ); +} + +/************************************************************************** + * ISF_MyDocuments_fnBindToStorage + */ +static +HRESULT +WINAPI +ISF_MyDocuments_fnBindToStorage (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", + This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); + + *ppvOut = NULL; + return E_NOTIMPL; +} + +/************************************************************************** + * ISF_MyDocuments_fnCompareIDs + */ +static HRESULT WINAPI ISF_MyDocuments_fnCompareIDs (IShellFolder2 * iface, + LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + int nReturn; + + TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); + nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2); + TRACE ("-- %i\n", nReturn); + return nReturn; +} + +/************************************************************************** + * ISF_MyDocuments_fnCreateViewObject + */ +static HRESULT WINAPI ISF_MyDocuments_fnCreateViewObject (IShellFolder2 * iface, + HWND hwndOwner, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + LPSHELLVIEW pShellView; + HRESULT hr = E_INVALIDARG; + + TRACE ("(%p)->(hwnd=%p,%s,%p)\n", + This, hwndOwner, shdebugstr_guid (riid), ppvOut); + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IDropTarget)) + { + WARN ("IDropTarget not implemented\n"); + hr = E_NOTIMPL; + } + else if (IsEqualIID (riid, &IID_IContextMenu)) + { + WARN ("IContextMenu not implemented\n"); + hr = E_NOTIMPL; + } + else if (IsEqualIID (riid, &IID_IShellView)) + { + pShellView = IShellView_Constructor ((IShellFolder *) iface); + if (pShellView) + { + hr = IShellView_QueryInterface (pShellView, riid, ppvOut); + IShellView_Release (pShellView); + } + } + TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut); + return hr; +} + +/************************************************************************** + * ISF_MyDocuments_fnGetAttributesOf + */ +static HRESULT WINAPI ISF_MyDocuments_fnGetAttributesOf (IShellFolder2 * iface, + UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + HRESULT hr = S_OK; + static const DWORD dwDesktopAttributes = + SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | + SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER; + static const DWORD dwMyComputerAttributes = + SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | + SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER; + + TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", + This, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); + + if (!rgfInOut) + return E_INVALIDARG; + if (cidl && !apidl) + return E_INVALIDARG; + + if (*rgfInOut == 0) + *rgfInOut = ~0; + + if(cidl == 0) { + *rgfInOut &= dwDesktopAttributes; + } else { + while (cidl > 0 && *apidl) { + pdump (*apidl); + if (_ILIsDesktop(*apidl)) { + *rgfInOut &= dwDesktopAttributes; + } else if (_ILIsMyComputer(*apidl)) { + *rgfInOut &= dwMyComputerAttributes; + } else { + SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut); + } + apidl++; + cidl--; + } + } + /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ + *rgfInOut &= ~SFGAO_VALIDATE; + + TRACE ("-- result=0x%08x\n", *rgfInOut); + + return hr; +} + +/************************************************************************** + * ISF_MyDocuments_fnGetUIObjectOf + * + * PARAMETERS + * HWND hwndOwner, //[in ] Parent window for any output + * UINT cidl, //[in ] array size + * LPCITEMIDLIST* apidl, //[in ] simple pidl array + * REFIID riid, //[in ] Requested Interface + * UINT* prgfInOut, //[ ] reserved + * LPVOID* ppvObject) //[out] Resulting Interface + * + */ +static HRESULT WINAPI ISF_MyDocuments_fnGetUIObjectOf (IShellFolder2 * iface, + HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, + REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + LPITEMIDLIST pidl; + IUnknown *pObj = NULL; + HRESULT hr = E_INVALIDARG; + + TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", + This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut); + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IContextMenu)) + { + if (cidl > 0) + pObj = (LPUNKNOWN) ISvItemCm_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl); + else + pObj = (LPUNKNOWN) ISvBgCm_Constructor( (IShellFolder *) iface, TRUE); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) + { + pObj = (LPUNKNOWN) IDataObject_Constructor( hwndOwner, + This->pidlRoot, apidl, cidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) + { + hr = IShellFolder_QueryInterface (iface, + &IID_IDropTarget, (LPVOID *) & pObj); + } + else if ((IsEqualIID(riid,&IID_IShellLinkW) || + IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj); + SHFree (pidl); + } + else + hr = E_NOINTERFACE; + + if (SUCCEEDED(hr) && !pObj) + hr = E_OUTOFMEMORY; + + *ppvOut = pObj; + TRACE ("(%p)->hr=0x%08x\n", This, hr); + return hr; +} + +static +HRESULT +WINAPI ISF_MyDocuments_fnGetDisplayNameOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + HRESULT hr = S_OK; + LPWSTR pszPath; + + TRACE ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet); + pdump (pidl); + + if (!strRet) + return E_INVALIDARG; + + pszPath = CoTaskMemAlloc((MAX_PATH +1) * sizeof(WCHAR)); + if (!pszPath) + return E_OUTOFMEMORY; + + if (_ILIsMyDocuments (pidl)) + { + if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && + (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING)) + strcpyW(pszPath, This->sPathTarget); + else + HCR_GetClassNameW(&CLSID_ShellDesktop, pszPath, MAX_PATH); + } + else if (_ILIsPidlSimple (pidl)) + { + GUID const *clsid; + + if ((clsid = _ILGetGUIDPointer (pidl))) + { + if (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING) + { + int bWantsForParsing; + + /* + * We can only get a filesystem path from a shellfolder if the + * value WantsFORPARSING in CLSID\\{...}\\shellfolder exists. + * + * Exception: The MyComputer folder doesn't have this key, + * but any other filesystem backed folder it needs it. + */ + if (IsEqualIID (clsid, &CLSID_MyComputer)) + { + bWantsForParsing = TRUE; + } + else + { + /* get the "WantsFORPARSING" flag from the registry */ + static const WCHAR clsidW[] = + { 'C','L','S','I','D','\\',0 }; + static const WCHAR shellfolderW[] = + { '\\','s','h','e','l','l','f','o','l','d','e','r',0 }; + static const WCHAR wantsForParsingW[] = + { 'W','a','n','t','s','F','o','r','P','a','r','s','i','n', + 'g',0 }; + WCHAR szRegPath[100]; + LONG r; + + lstrcpyW (szRegPath, clsidW); + SHELL32_GUIDToStringW (clsid, &szRegPath[6]); + lstrcatW (szRegPath, shellfolderW); + r = SHGetValueW(HKEY_CLASSES_ROOT, szRegPath, + wantsForParsingW, NULL, NULL, NULL); + if (r == ERROR_SUCCESS) + bWantsForParsing = TRUE; + else + bWantsForParsing = FALSE; + } + + if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && + bWantsForParsing) + { + /* + * we need the filesystem path to the destination folder. + * Only the folder itself can know it + */ + hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, + pszPath, + MAX_PATH); + } + else + { + /* parsing name like ::{...} */ + pszPath[0] = ':'; + pszPath[1] = ':'; + SHELL32_GUIDToStringW (clsid, &pszPath[2]); + } + } + else + { + /* user friendly name */ + HCR_GetClassNameW (clsid, pszPath, MAX_PATH); + } + } + else + { + int cLen = 0; + + /* file system folder or file rooted at the desktop */ + if ((GET_SHGDN_FOR(dwFlags) == SHGDN_FORPARSING) && + (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER)) + { + lstrcpynW(pszPath, This->sPathTarget, MAX_PATH - 1); + PathAddBackslashW(pszPath); + cLen = lstrlenW(pszPath); + } + + _ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen); + + if (!_ILIsFolder(pidl)) + SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags); + } + } + else + { + /* a complex pidl, let the subfolder do the work */ + hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, + pszPath, MAX_PATH); + } + + if (SUCCEEDED(hr)) + { + /* Win9x always returns ANSI strings, NT always returns Unicode strings */ + if (GetVersion() & 0x80000000) + { + strRet->uType = STRRET_CSTR; + if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->u.cStr, MAX_PATH, + NULL, NULL)) + strRet->u.cStr[0] = '\0'; + CoTaskMemFree(pszPath); + } + else + { + strRet->uType = STRRET_WSTR; + strRet->u.pOleStr = pszPath; + } + } + else + CoTaskMemFree(pszPath); + + TRACE ("-- (%p)->(%s,0x%08x)\n", This, + strRet->uType == STRRET_CSTR ? strRet->u.cStr : + debugstr_w(strRet->u.pOleStr), hr); + return hr; +} + +static HRESULT WINAPI ISF_MyDocuments_fnSetNameOf (IShellFolder2 * iface, + HWND hwndOwner, LPCITEMIDLIST pidl, /* simple pidl */ + LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, hwndOwner, pidl, + debugstr_w (lpName), dwFlags, pPidlOut); + + return E_FAIL; +} + +static HRESULT WINAPI ISF_MyDocuments_fnGetDefaultSearchGUID(IShellFolder2 *iface, + GUID * pguid) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_MyDocuments_fnEnumSearches (IShellFolder2 *iface, + IEnumExtraSearch ** ppenum) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +ISF_MyDocuments_fnGetDefaultColumn (IShellFolder2 * iface, + DWORD dwRes, ULONG * pSort, ULONG * pDisplay) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)\n", This); + + if (pSort) + *pSort = 0; + if (pDisplay) + *pDisplay = 0; + + return S_OK; +} +static +HRESULT +WINAPI +ISF_MyDocuments_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)\n", This); + + if (!pcsFlags || iColumn >= MYDOCUMENTSSHELLVIEWCOLUMNS) + return E_INVALIDARG; + + *pcsFlags = MyDocumentsSFHeader[iColumn].pcsFlags; + + return S_OK; +} + +static +HRESULT +WINAPI +ISF_MyDocuments_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + + return E_NOTIMPL; +} + +static +HRESULT +WINAPI +ISF_MyDocuments_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + HRESULT hr = S_OK; + + TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); + + if (!psd || iColumn >= MYDOCUMENTSSHELLVIEWCOLUMNS) + return E_INVALIDARG; + + if (!pidl) + { + psd->fmt = MyDocumentsSFHeader[iColumn].fmt; + psd->cxChar = MyDocumentsSFHeader[iColumn].cxChar; + psd->str.uType = STRRET_CSTR; + LoadStringA (shell32_hInstance, MyDocumentsSFHeader[iColumn].colnameid, + psd->str.u.cStr, MAX_PATH); + return S_OK; + } + + /* the data from the pidl */ + psd->str.uType = STRRET_CSTR; + switch (iColumn) + { + case 0: /* name */ + hr = IShellFolder_GetDisplayNameOf(iface, pidl, + SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str); + break; + case 1: /* size */ + _ILGetFileSize (pidl, psd->str.u.cStr, MAX_PATH); + break; + case 2: /* type */ + _ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH); + break; + case 3: /* date */ + _ILGetFileDate (pidl, psd->str.u.cStr, MAX_PATH); + break; + case 4: /* attributes */ + _ILGetFileAttributes (pidl, psd->str.u.cStr, MAX_PATH); + break; + } + + return hr; +} + +static +HRESULT +WINAPI +ISF_MyDocuments_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static const IShellFolder2Vtbl vt_MCFldr_ShellFolder2 = +{ + ISF_MyDocuments_fnQueryInterface, + ISF_MyDocuments_fnAddRef, + ISF_MyDocuments_fnRelease, + ISF_MyDocuments_fnParseDisplayName, + ISF_MyDocuments_fnEnumObjects, + ISF_MyDocuments_fnBindToObject, + ISF_MyDocuments_fnBindToStorage, + ISF_MyDocuments_fnCompareIDs, + ISF_MyDocuments_fnCreateViewObject, + ISF_MyDocuments_fnGetAttributesOf, + ISF_MyDocuments_fnGetUIObjectOf, + ISF_MyDocuments_fnGetDisplayNameOf, + ISF_MyDocuments_fnSetNameOf, + /* ShellFolder2 */ + ISF_MyDocuments_fnGetDefaultSearchGUID, + ISF_MyDocuments_fnEnumSearches, + ISF_MyDocuments_fnGetDefaultColumn, + ISF_MyDocuments_fnGetDefaultColumnState, + ISF_MyDocuments_fnGetDetailsEx, + ISF_MyDocuments_fnGetDetailsOf, + ISF_MyDocuments_fnMapColumnToSCID +}; + +static inline IGenericSFImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface ) +{ + return (IGenericSFImpl *)((char*)iface - FIELD_OFFSET(IGenericSFImpl, lpPF2)); +} + +static HRESULT WINAPI +ISF_MyDocuments_PersistFolder2_fnQueryInterface (IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj) +{ + IGenericSFImpl *This = impl_from_IPersistFolder2(iface); + + TRACE ("(%p)\n", This); + + return ISF_MyDocuments_fnQueryInterface ((IShellFolder2*)This, iid, ppvObj); +} + +static ULONG WINAPI +ISF_MyDocuments_PersistFolder2_fnAddRef (IPersistFolder2 * iface) +{ + IGenericSFImpl *This = impl_from_IPersistFolder2(iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return ISF_MyDocuments_fnAddRef((IShellFolder2*)This); +} + +static ULONG WINAPI +ISF_MyDocuments_PersistFolder2_fnRelease (IPersistFolder2 * iface) +{ + IGenericSFImpl *This = impl_from_IPersistFolder2(iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return ISF_MyDocuments_fnRelease ((IShellFolder2*)This); +} + +static HRESULT WINAPI +ISF_MyDocuments_PersistFolder2_fnGetClassID (IPersistFolder2 * iface, CLSID * lpClassId) +{ + IGenericSFImpl *This = impl_from_IPersistFolder2(iface); + + static GUID const CLSID_MyDocuments = + { 0x450d8fba, 0xad25, 0x11d0, {0x98,0xa8,0x08,0x00,0x36,0x1b,0x11,0x03} }; + + TRACE ("(%p)\n", This); + + if (!lpClassId) + return E_POINTER; + + memcpy(lpClassId, &CLSID_MyDocuments, sizeof(GUID)); + + return S_OK; +} +static HRESULT WINAPI +ISF_MyDocuments_PersistFolder2_fnInitialize (IPersistFolder2 * iface, LPCITEMIDLIST pidl) +{ + IGenericSFImpl *This = impl_from_IPersistFolder2(iface); + + TRACE ("(%p)->(%p)\n", This, pidl); + + return E_NOTIMPL; +} + +static HRESULT WINAPI +ISF_MyDocuments_PersistFolder2_fnGetCurFolder (IPersistFolder2 * iface, + LPITEMIDLIST * pidl) +{ + IGenericSFImpl *This = impl_from_IPersistFolder2(iface); + + TRACE ("(%p)->(%p)\n", This, pidl); + + if (!pidl) return E_POINTER; + *pidl = ILClone (This->pidlRoot); + return S_OK; +} + +static const IPersistFolder2Vtbl vt_FSFldr_PersistFolder2 = +{ + ISF_MyDocuments_PersistFolder2_fnQueryInterface, + ISF_MyDocuments_PersistFolder2_fnAddRef, + ISF_MyDocuments_PersistFolder2_fnRelease, + ISF_MyDocuments_PersistFolder2_fnGetClassID, + ISF_MyDocuments_PersistFolder2_fnInitialize, + ISF_MyDocuments_PersistFolder2_fnGetCurFolder, +}; + + +/************************************************************************** + * ISF_MyDocuments_Constructor + */ +HRESULT WINAPI ISF_MyDocuments_Constructor ( + IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + static IGenericSFImpl *cached_sf; + WCHAR szMyPath[MAX_PATH]; + + TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid)); + + if (!ppv) + return E_POINTER; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + if (!cached_sf) + { + IGenericSFImpl *sf; + + if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE )) + return E_UNEXPECTED; + + sf = LocalAlloc( LMEM_ZEROINIT, sizeof (IGenericSFImpl) ); + if (!sf) + return E_OUTOFMEMORY; + + sf->ref = 1; + sf->lpVtbl = &vt_MCFldr_ShellFolder2; + sf->lpPF2 = &vt_FSFldr_PersistFolder2; + sf->pidlRoot = _ILCreateMyDocuments(); /* my qualified pidl */ + sf->sPathTarget = SHAlloc( (lstrlenW(szMyPath) + 1)*sizeof(WCHAR) ); + lstrcpyW( sf->sPathTarget, szMyPath ); + + if (InterlockedCompareExchangePointer((void *)&cached_sf, sf, NULL) != NULL) + { + /* some other thread already been here */ + SHFree( sf->pidlRoot ); + SHFree( sf->sPathTarget ); + LocalFree( sf ); + } + } + + return IUnknown_QueryInterface( _IUnknown_(cached_sf), riid, ppv ); +} Propchange: trunk/reactos/dll/win32/shell32/shlfldr_mydocuments.c ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 1 month
1
0
0
0
[weiden] 30430: Make initializing the ICD in ROSGL_ICDForHDC thread-safe
by weiden@svn.reactos.org
Author: weiden Date: Wed Nov 14 03:01:36 2007 New Revision: 30430 URL:
http://svn.reactos.org/svn/reactos?rev=30430&view=rev
Log: Make initializing the ICD in ROSGL_ICDForHDC thread-safe Modified: trunk/reactos/dll/win32/opengl32/wgl.c Modified: trunk/reactos/dll/win32/opengl32/wgl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/wgl.c?r…
============================================================================== --- trunk/reactos/dll/win32/opengl32/wgl.c (original) +++ trunk/reactos/dll/win32/opengl32/wgl.c Wed Nov 14 03:01:36 2007 @@ -294,6 +294,7 @@ ROSGL_ICDForHDC( HDC hdc ) { GLDCDATA *dcdata; + GLDRIVERDATA *drvdata; dcdata = ROSGL_GetPrivateDCData( hdc ); if (dcdata == NULL) @@ -303,6 +304,9 @@ { LPCWSTR driverName; OPENGL_INFO info; + + /* NOTE: This might be done by multiple threads simultaneously, but only the fastest + actually gets to set the ICD! */ driverName = _wgetenv( L"OPENGL32_DRIVER" ); if (driverName == NULL) @@ -336,7 +340,7 @@ } /* open registry key */ - ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, OPENGL_DRIVERS_SUBKEY, 0, KEY_READ, &hKey ); + ret = RegOpenKeyExW( HKEY_LOCAL_MACHINE, OPENGL_DRIVERS_SUBKEY, 0, KEY_QUERY_VALUE, &hKey ); if (ret != ERROR_SUCCESS) { DBGPRINT( "Error: Couldn't open registry key '%ws'", OPENGL_DRIVERS_SUBKEY ); @@ -361,8 +365,8 @@ wcsncpy( info.DriverName, driverName, sizeof (info.DriverName) / sizeof (info.DriverName[0]) ); } /* load driver (or get a reference) */ - dcdata->icd = OPENGL32_LoadICD( info.DriverName ); - if (dcdata->icd == NULL) + drvdata = OPENGL32_LoadICD( info.DriverName ); + if (drvdata == NULL) { WCHAR Buffer[256]; snwprintf(Buffer, sizeof(Buffer)/sizeof(WCHAR), @@ -370,6 +374,17 @@ MessageBox(WindowFromDC( hdc ), Buffer, L"OPENGL32.dll: Warning", MB_OK | MB_ICONWARNING); + } + else + { + /* Atomically set the ICD!!! */ + if (InterlockedCompareExchangePointer((PVOID*)&dcdata->icd, + (PVOID)drvdata, + NULL) != NULL) + { + /* Too bad, somebody else was faster... */ + OPENGL32_UnloadICD(drvdata); + } } }
17 years, 1 month
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
89
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Results per page:
10
25
50
100
200