winehq.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
February
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2006
----- 2025 -----
February 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
617 discussions
Start a n
N
ew thread
Alexandre Julliard : msvcrt: Implemented asctime, ctime and strftime instead of using the libc ones.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: f9e5b0f5f03e47d46b05d9fe276ae390fd0ab95f URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=f9e5b0f5f03e47d46b05d9f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 14 17:22:03 2006 +0100 msvcrt: Implemented asctime, ctime and strftime instead of using the libc ones. Make the code thread-safe by using asctime_r if available. --- configure | 2 + configure.ac | 1 + dlls/msvcrt/main.c | 1 + dlls/msvcrt/msvcrt.h | 3 +- dlls/msvcrt/msvcrt.spec | 6 ++- dlls/msvcrt/time.c | 84 +++++++++++++++++++++++++++++++++++++++-------- include/config.h.in | 3 ++ 7 files changed, 81 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 9a49b2c..1880b82 100755 --- a/configure +++ b/configure @@ -14619,6 +14619,7 @@ fi + for ac_func in \ _lwp_create \ _lwp_self \ @@ -14629,6 +14630,7 @@ for ac_func in \ _stricmp \ _strnicmp \ _vsnprintf \ + asctime_r \ chsize \ clone \ epoll_create \ diff --git a/configure.ac b/configure.ac index eebf34c..b458d7d 100644 --- a/configure.ac +++ b/configure.ac @@ -1157,6 +1157,7 @@ AC_CHECK_FUNCS(\ _stricmp \ _strnicmp \ _vsnprintf \ + asctime_r \ chsize \ clone \ epoll_create \ diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c index 779a293..6697c1c 100644 --- a/dlls/msvcrt/main.c +++ b/dlls/msvcrt/main.c @@ -73,6 +73,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, if (tls) { HeapFree(GetProcessHeap(),0,tls->efcvt_buffer); + HeapFree(GetProcessHeap(),0,tls->asctime_buffer); HeapFree(GetProcessHeap(),0,tls->wasctime_buffer); } HeapFree(GetProcessHeap(), 0, tls); diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 68f5ca6..badea9e 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -95,7 +95,8 @@ struct __thread_data { unsigned long thread_doserrno; unsigned char *mbstok_next; /* next ptr for mbstok() */ char *efcvt_buffer; /* buffer for ecvt/fcvt */ - MSVCRT_wchar_t *wasctime_buffer; /* buffer for asctime */ + char *asctime_buffer; /* buffer for asctime */ + MSVCRT_wchar_t *wasctime_buffer; /* buffer for wasctime */ struct MSVCRT_tm time_buffer; /* buffer for localtime/gmtime */ int fpecode; MSVCRT_terminate_function terminate_handler; diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 69aa578..6d496fd 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -570,7 +570,7 @@ @ cdecl abort() MSVCRT_abort @ cdecl abs(long) @ cdecl acos(double) -@ cdecl asctime(ptr) +@ cdecl asctime(ptr) MSVCRT_asctime @ cdecl asin(double) @ cdecl atan(double) @ cdecl atan2(double double) @@ -585,7 +585,7 @@ @ cdecl clock() MSVCRT_clock @ cdecl cos(double) @ cdecl cosh(double) -@ cdecl ctime(ptr) +@ cdecl ctime(ptr) MSVCRT_ctime @ cdecl difftime(long long) MSVCRT_difftime @ cdecl div(long long) MSVCRT_div @ cdecl exit(long) MSVCRT_exit @@ -704,7 +704,7 @@ @ cdecl strcpy(ptr str) @ cdecl strcspn(str str) @ cdecl strerror(long) MSVCRT_strerror -@ cdecl strftime(str long str ptr) +@ cdecl strftime(str long str ptr) MSVCRT_strftime @ cdecl strlen(str) @ cdecl strncat(str str long) @ cdecl strncmp(str str long) diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 9b26770..3c1b0ba 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -47,6 +47,20 @@ static inline int IsLeapYear(int Year) return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0); } +static inline void msvcrt_tm_to_unix( struct tm *dest, const struct MSVCRT_tm *src ) +{ + memset( dest, 0, sizeof(*dest) ); + dest->tm_sec = src->tm_sec; + dest->tm_min = src->tm_min; + dest->tm_hour = src->tm_hour; + dest->tm_mday = src->tm_mday; + dest->tm_mon = src->tm_mon; + dest->tm_year = src->tm_year; + dest->tm_wday = src->tm_wday; + dest->tm_yday = src->tm_yday; + dest->tm_isdst = src->tm_isdst; +} + #define SECSPERDAY 86400 /* 1601 to 1970 is 369 years plus 89 leap days */ #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY) @@ -412,33 +426,73 @@ void MSVCRT__tzset(void) } /********************************************************************* - * _wctime (MSVCRT.@) + * strftime (MSVCRT.@) */ -MSVCRT_wchar_t *MSVCRT__wasctime(const struct MSVCRT_tm *mstm) { +MSVCRT_size_t MSVCRT_strftime( char *str, MSVCRT_size_t max, const char *format, + const struct MSVCRT_tm *mstm ) +{ + struct tm tm; + + msvcrt_tm_to_unix( &tm, mstm ); + return strftime( str, max, format, &tm ); +} + +/********************************************************************* + * asctime (MSVCRT.@) + */ +char *MSVCRT_asctime(const struct MSVCRT_tm *mstm) +{ thread_data_t *data = msvcrt_get_thread_data(); - struct tm xtm; + struct tm tm; + + msvcrt_tm_to_unix( &tm, mstm ); - memset(&xtm,0,sizeof(xtm)); - xtm.tm_sec = mstm->tm_sec; - xtm.tm_min = mstm->tm_min; - xtm.tm_hour = mstm->tm_hour; - xtm.tm_mday = mstm->tm_mday; - xtm.tm_mon = mstm->tm_mon; - xtm.tm_year = mstm->tm_year; - xtm.tm_wday = mstm->tm_wday; - xtm.tm_yday = mstm->tm_yday; - xtm.tm_isdst = mstm->tm_isdst; + if (!data->asctime_buffer) + data->asctime_buffer = MSVCRT_malloc( 30 ); /* ought to be enough */ + + /* FIXME: may want to map from Unix codepage to CP_ACP */ +#ifdef HAVE_ASCTIME_R + asctime_r( &tm, data->asctime_buffer ); +#else + strcpy( data->asctime_buffer, asctime(&tm) ); +#endif + return data->asctime_buffer; +} + +/********************************************************************* + * _wasctime (MSVCRT.@) + */ +MSVCRT_wchar_t *MSVCRT__wasctime(const struct MSVCRT_tm *mstm) +{ + thread_data_t *data = msvcrt_get_thread_data(); + struct tm tm; + char buffer[30]; + + msvcrt_tm_to_unix( &tm, mstm ); if (!data->wasctime_buffer) data->wasctime_buffer = MSVCRT_malloc( 30*sizeof(MSVCRT_wchar_t) ); /* ought to be enough */ - MultiByteToWideChar( CP_UNIXCP, 0, asctime(&xtm), -1, data->wasctime_buffer, 30 ); +#ifdef HAVE_ASCTIME_R + asctime_r( &tm, buffer ); +#else + strcpy( buffer, asctime(&tm) ); +#endif + MultiByteToWideChar( CP_UNIXCP, 0, buffer, -1, data->wasctime_buffer, 30 ); return data->wasctime_buffer; } /********************************************************************* + * ctime (MSVCRT.@) + */ +char *MSVCRT_ctime(const MSVCRT_time_t *time) +{ + return MSVCRT_asctime( MSVCRT_localtime(time) ); +} + +/********************************************************************* * _wctime (MSVCRT.@) */ -MSVCRT_wchar_t *MSVCRT__wctime(MSVCRT_time_t *time) +MSVCRT_wchar_t *MSVCRT__wctime(const MSVCRT_time_t *time) { return MSVCRT__wasctime( MSVCRT_localtime(time) ); } diff --git a/include/config.h.in b/include/config.h.in index d3eedd7..51ecdc5 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -20,6 +20,9 @@ /* Define if you have ARTS sound server */ #undef HAVE_ARTS +/* Define to 1 if you have the `asctime_r' function. */ +#undef HAVE_ASCTIME_R + /* Define to 1 if you have the <asm/types.h> header file. */ #undef HAVE_ASM_TYPES_H
1
0
0
0
Alexandre Julliard : msvcrt: Make strtok and wcstok thread-safe by using the per-thread data.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: 2ec3b961355108176cb806797dc4836068d44c63 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2ec3b961355108176cb8067…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 14 17:24:49 2006 +0100 msvcrt: Make strtok and wcstok thread-safe by using the per-thread data. --- dlls/msvcrt/msvcrt.h | 2 ++ dlls/msvcrt/msvcrt.spec | 4 ++-- dlls/msvcrt/string.c | 21 +++++++++++++++++++++ dlls/msvcrt/wcs.c | 21 +++++++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index badea9e..9923def 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -93,7 +93,9 @@ extern DWORD msvcrt_tls_index; struct __thread_data { int thread_errno; unsigned long thread_doserrno; + char *strtok_next; /* next ptr for strtok() */ unsigned char *mbstok_next; /* next ptr for mbstok() */ + MSVCRT_wchar_t *wcstok_next; /* next ptr for wcstok() */ char *efcvt_buffer; /* buffer for ecvt/fcvt */ char *asctime_buffer; /* buffer for asctime */ MSVCRT_wchar_t *wasctime_buffer; /* buffer for wasctime */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 6d496fd..4620dff 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -714,7 +714,7 @@ @ cdecl strspn(str str) @ cdecl strstr(str str) @ cdecl strtod(str ptr) -@ cdecl strtok(str str) +@ cdecl strtok(str str) MSVCRT_strtok @ cdecl strtol(str ptr long) @ cdecl strtoul(str ptr long) @ cdecl strxfrm(ptr str long) @@ -754,7 +754,7 @@ @ cdecl wcsspn(wstr wstr) ntdll.wcsspn @ cdecl wcsstr(wstr wstr) ntdll.wcsstr @ cdecl wcstod(wstr ptr) MSVCRT_wcstod -@ cdecl wcstok(wstr wstr) ntdll.wcstok +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok @ cdecl wcstol(wstr ptr long) ntdll.wcstol @ cdecl wcstombs(ptr ptr long) ntdll.wcstombs @ cdecl wcstoul(wstr ptr long) ntdll.wcstoul diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 8797ce4..057dbf8 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -97,6 +97,27 @@ char* _strset(char* str, int value) } /********************************************************************* + * strtok (MSVCRT.@) + */ +char *MSVCRT_strtok( char *str, const char *delim ) +{ + thread_data_t *data = msvcrt_get_thread_data(); + char *ret; + + if (!str) + if (!(str = data->strtok_next)) return NULL; + + while (*str && strchr( delim, *str )) str++; + if (!*str) return NULL; + ret = str++; + while (*str && !strchr( delim, *str )) str++; + if (*str) *str++ = 0; + data->strtok_next = str; + return ret; +} + + +/********************************************************************* * _swab (MSVCRT.@) */ void MSVCRT__swab(char* src, char* dst, int len) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index db86437..2a48003 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -825,6 +825,27 @@ MSVCRT_wchar_t* MSVCRT_wcspbrk( const MS } /********************************************************************* + * wcstok (MSVCRT.@) + */ +MSVCRT_wchar_t *MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim ) +{ + thread_data_t *data = msvcrt_get_thread_data(); + MSVCRT_wchar_t *ret; + + if (!str) + if (!(str = data->wcstok_next)) return NULL; + + while (*str && strchrW( delim, *str )) str++; + if (!*str) return NULL; + ret = str++; + while (*str && !strchrW( delim, *str )) str++; + if (*str) *str++ = 0; + data->wcstok_next = str; + return ret; +} + + +/********************************************************************* * wctomb (MSVCRT.@) */ INT MSVCRT_wctomb( char *dst, MSVCRT_wchar_t ch )
1
0
0
0
Alexandre Julliard : msvcrt: Reimplement rand() and srand() to use per-thread data for the
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: ad8cb6133edce109406be63c1425899a90fa6146 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ad8cb6133edce109406be63…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 14 17:27:28 2006 +0100 msvcrt: Reimplement rand() and srand() to use per-thread data for the random seed. --- dlls/msvcrt/misc.c | 16 +++++++++++++++- dlls/msvcrt/msvcrt.h | 2 ++ dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/tests/headers.c | 1 + dlls/msvcrt/thread.c | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index 83f798d..6455e39 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -39,11 +39,25 @@ void _beep( unsigned int freq, unsigned } /********************************************************************* + * srand (MSVCRT.@) + */ +void MSVCRT_srand( unsigned int seed ) +{ + thread_data_t *data = msvcrt_get_thread_data(); + data->random_seed = seed; +} + +/********************************************************************* * rand (MSVCRT.@) */ int MSVCRT_rand(void) { - return (rand() & 0x7fff); + thread_data_t *data = msvcrt_get_thread_data(); + + /* this is the algorithm used by MSVC, according to + *
http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators
*/ + data->random_seed = data->random_seed * 214013 + 2531011; + return (data->random_seed >> 16) & MSVCRT_RAND_MAX; } /********************************************************************* diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 9923def..2502d4b 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -93,6 +93,7 @@ extern DWORD msvcrt_tls_index; struct __thread_data { int thread_errno; unsigned long thread_doserrno; + unsigned int random_seed; /* seed for rand() */ char *strtok_next; /* next ptr for strtok() */ unsigned char *mbstok_next; /* next ptr for mbstok() */ MSVCRT_wchar_t *wcstok_next; /* next ptr for wcstok() */ @@ -375,6 +376,7 @@ struct MSVCRT__stati64 { #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF) #define MSVCRT_EOF (-1) #define MSVCRT_TMP_MAX 0x7fff +#define MSVCRT_RAND_MAX 0x7fff #define MSVCRT_BUFSIZ 512 #define MSVCRT_STDIN_FILENO 0 diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 4620dff..a24f11b 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -695,7 +695,7 @@ @ cdecl sinh(double) @ varargs sprintf(ptr str) MSVCRT_sprintf @ cdecl sqrt(double) -@ cdecl srand(long) +@ cdecl srand(long) MSVCRT_srand @ varargs sscanf(str str) MSVCRT_sscanf @ cdecl strcat(str str) @ cdecl strchr(str long) diff --git a/dlls/msvcrt/tests/headers.c b/dlls/msvcrt/tests/headers.c index a25ce01..840212a 100644 --- a/dlls/msvcrt/tests/headers.c +++ b/dlls/msvcrt/tests/headers.c @@ -303,6 +303,7 @@ static void test_defines(void) CHECK_DEF(WEOF); CHECK_DEF(EOF); CHECK_DEF(TMP_MAX); + CHECK_DEF(RAND_MAX); CHECK_DEF(BUFSIZ); CHECK_DEF(STDIN_FILENO); CHECK_DEF(STDOUT_FILENO); diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c index 262aa57..3362b4f 100644 --- a/dlls/msvcrt/thread.c +++ b/dlls/msvcrt/thread.c @@ -44,6 +44,7 @@ thread_data_t *msvcrt_get_thread_data(vo if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) ))) _amsg_exit( _RT_THREAD ); if (!TlsSetValue( msvcrt_tls_index, ptr )) _amsg_exit( _RT_THREAD ); + ptr->random_seed = 1; } SetLastError( err ); return ptr;
1
0
0
0
Michael Jung : unixfs: Fix ParseDisplayName.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: b52146d95fcf3d761632814955d0967d0ec3790e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b52146d95fcf3d761632814…
Author: Michael Jung <mjung(a)iss.tu-darmstadt.de> Date: Sat Jan 14 17:10:53 2006 +0100 unixfs: Fix ParseDisplayName. Build an absolute pidl to query attributes in UnixFolder::ParseDisplayName. --- dlls/shell32/shfldr_unixfs.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index e5aee56..7ffdb9a 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -905,12 +905,18 @@ static HRESULT WINAPI UnixFolder_IShellF { IShellFolder *pParentSF; LPCITEMIDLIST pidlLast; + LPITEMIDLIST pidlComplete = ILCombine(This->m_pidlLocation, *ppidl); HRESULT hr; - hr = SHBindToParent(*ppidl, &IID_IShellFolder, (LPVOID*)&pParentSF, &pidlLast); - if (FAILED(hr)) return E_FAIL; + hr = SHBindToParent(pidlComplete, &IID_IShellFolder, (LPVOID*)&pParentSF, &pidlLast); + if (FAILED(hr)) { + FIXME("SHBindToParent failed! hr = %08lx\n", hr); + ILFree(pidlComplete); + return E_FAIL; + } IShellFolder_GetAttributesOf(pParentSF, 1, &pidlLast, pdwAttributes); IShellFolder_Release(pParentSF); + ILFree(pidlComplete); } if (!result) TRACE("FAILED!\n"); @@ -1272,7 +1278,7 @@ static HRESULT WINAPI UnixFolder_IShellF } else { - int len = MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, NULL, 0); + int len = MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, NULL, 0); pwszDosDest = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, pwszDosDest, len);
1
0
0
0
James Hawkins : advpack: Remove stub status from implemented functions.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: d582fdd39e7932d6435eb33f0bdb7acacb594a25 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=d582fdd39e7932d6435eb33…
Author: James Hawkins <truiken(a)gmail.com> Date: Sat Jan 14 17:10:31 2006 +0100 advpack: Remove stub status from implemented functions. --- dlls/advpack/files.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/advpack/files.c b/dlls/advpack/files.c index 87a88bb..99741b9 100644 --- a/dlls/advpack/files.c +++ b/dlls/advpack/files.c @@ -117,7 +117,7 @@ HRESULT WINAPI AdvInstallFile(HWND hwnd, HSPFILEQ fileQueue; PVOID pContext; - TRACE("(%p,%p,%p,%p,%p,%ld,%ld) stub\n", hwnd, debugstr_a(lpszSourceDir), + TRACE("(%p,%p,%p,%p,%p,%ld,%ld)\n", hwnd, debugstr_a(lpszSourceDir), debugstr_a(lpszSourceFile), debugstr_a(lpszDestDir), debugstr_a(lpszDestFile), dwFlags, dwReserved); @@ -494,7 +494,7 @@ HRESULT WINAPI ExtractFiles ( LPCSTR Cab DWORD dwFilesFound = 0; LPSTR szConvertedList = NULL; - TRACE("(%p %p %ld %p %p %ld): stub\n", CabName, ExpandDir, Flags, + TRACE("(%p %p %ld %p %p %ld)\n", CabName, ExpandDir, Flags, FileList, LReserved, Reserved); if (!CabName || !ExpandDir)
1
0
0
0
James Hawkins : advpack: Add stubs for CloseINFEngine, OpenINFEngine, and
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: 461904cb6ebc4515141bc846fbed0df7bcab8079 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=461904cb6ebc4515141bc84…
Author: James Hawkins <truiken(a)gmail.com> Date: Sat Jan 14 17:10:16 2006 +0100 advpack: Add stubs for CloseINFEngine, OpenINFEngine, and TranslateInfStringEx. --- dlls/advpack/advpack.c | 94 +++++++++++++++++++++++++++++++++++++++++++++ dlls/advpack/advpack.spec | 6 +-- include/advpub.h | 10 +++++ 3 files changed, 107 insertions(+), 3 deletions(-) diff --git a/dlls/advpack/advpack.c b/dlls/advpack/advpack.c index 9c6ac1a..4fcae96 100644 --- a/dlls/advpack/advpack.c +++ b/dlls/advpack/advpack.c @@ -37,6 +37,27 @@ WINE_DEFAULT_DEBUG_CHANNEL(advpack); typedef HRESULT (WINAPI *DLLREGISTER) (void); /*********************************************************************** + * CloseINFEngine (ADVPACK.@) + * + * + * PARAMS + * hInf [I] + * + * RETURNS + * Success: S_OK. + * Failure: E_FAIL. + * + * BUGS + * Unimplemented. + */ +HRESULT WINAPI CloseINFEngine(HINF hInf) +{ + FIXME("(%p) stub\n", hInf); + + return E_FAIL; +} + +/*********************************************************************** * DllMain (ADVPACK.@) */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) @@ -245,6 +266,35 @@ BOOL WINAPI NeedReboot(DWORD dwRebootChe } /*********************************************************************** + * OpenINFEngine (ADVPACK.@) + * + * Opens and returns a handle to an INF file to be used by + * TranslateInfStringEx to continuously translate the INF file. + * + * PARAMS + * pszInfFilename [I] Filename of the INF to open. + * pszInstallSection [I] Name of the Install section in the INF. + * dwFlags [I] See advpub.h. + * phInf [O] Handle to the loaded INF file. + * pvReserved [I] Reserved. Must be NULL. + * + * RETURNS + * Success: S_OK. + * Failure: E_FAIL. + * + * BUGS + * Unimplemented. + */ +HRESULT WINAPI OpenINFEngine(PCSTR pszInfFilename, PCSTR pszInstallSection, + DWORD dwFlags, HINF *phInf, PVOID pvReserved) +{ + FIXME("(%p, %p, %ld, %p, %p) stub\n", pszInfFilename, pszInstallSection, + dwFlags, phInf, pvReserved); + + return E_FAIL; +} + +/*********************************************************************** * RegisterOCX (ADVPACK.@) */ void WINAPI RegisterOCX( HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show ) @@ -361,3 +411,47 @@ HRESULT WINAPI TranslateInfString(PCSTR return S_OK; } + +/*********************************************************************** + * TranslateInfStringEx (ADVPACK.@) + * + * Using a handle to an INF file opened with OpenINFEngine, translates + * the value of a specified key in an inf file into the current locale + * by expanding string macros. + * + * PARAMS + * hInf [I] Handle to the INF file. + * pszInfFilename [I] Filename of the INF file. + * pszTranslateSection [I] Inf section where the key exists. + * pszTranslateKey [I] Key to translate. + * pszBuffer [O] Contains the translated string on exit. + * dwBufferSize [I] Size on input of pszBuffer. + * pdwRequiredSize [O] Length of the translated key. + * pvReserved [I] Reserved. Must be NULL. + * + * RETURNS + * Success: S_OK. + * Failure: E_FAIL. + * + * NOTES + * To use TranslateInfStringEx to translate an INF file continuously, + * open the INF file with OpenINFEngine, call TranslateInfStringEx as + * many times as needed, then release the handle with CloseINFEngine. + * When translating more than one keys, this method is more efficient + * than calling TranslateInfString, because the INF file is only + * opened once. + * + * BUGS + * Unimplemented. + */ +HRESULT WINAPI TranslateInfStringEx(HINF hInf, PCSTR pszInfFilename, + PCSTR pszTranslateSection, PCSTR pszTranslateKey, + PSTR pszBuffer, DWORD dwBufferSize, + PDWORD pdwRequiredSize, PVOID pvReserved) +{ + FIXME("(%p, %p, %p, %p, %p, %ld, %p, %p) stub\n", hInf, pszInfFilename, + pszTranslateSection, pszTranslateKey, pszBuffer, dwBufferSize, + pdwRequiredSize, pvReserved); + + return E_FAIL; +} diff --git a/dlls/advpack/advpack.spec b/dlls/advpack/advpack.spec index 53790ae..bb8487f 100644 --- a/dlls/advpack/advpack.spec +++ b/dlls/advpack/advpack.spec @@ -1,6 +1,6 @@ @ stdcall AddDelBackupEntry(str str str long) @ stdcall AdvInstallFile(long str str str str long long) -@ stub CloseINFEngine +@ stdcall CloseINFEngine(long) @ stdcall DelNode(str long) @ stdcall DelNodeRunDLL32(ptr ptr str long) @ stdcall -private DllMain(long long ptr) @@ -17,7 +17,7 @@ @ stdcall LaunchINFSectionEx(ptr ptr str long) @ stdcall NeedReboot(long) @ stdcall NeedRebootInit() -@ stub OpenINFEngine +@ stdcall OpenINFEngine(str str long ptr ptr) @ stub RebootCheckOnInstall @ stdcall RegInstall(ptr str ptr) @ stdcall RegRestoreAll(ptr str long) @@ -27,6 +27,6 @@ @ stdcall RunSetupCommand(long str str str str ptr long ptr) @ stub SetPerUserSecValues @ stdcall TranslateInfString(str str str str ptr long ptr ptr) -@ stub TranslateInfStringEx +@ stdcall TranslateInfStringEx(long str str str str long ptr ptr) @ stub UserInstStubWrapper @ stub UserUnInstStubWrapper diff --git a/include/advpub.h b/include/advpub.h index f45c45e..aef373b 100644 --- a/include/advpub.h +++ b/include/advpub.h @@ -46,6 +46,10 @@ typedef struct _StrTable { typedef const STRTABLE CSTRTABLE; typedef CSTRTABLE *LPCSTRTABLE; +#ifndef _INC_SETUPAPI +typedef PVOID HINF; +#endif + /* Flags for AddDelBackupEntry */ #define AADBE_ADD_ENTRY 0x01 #define AADBE_DEL_ENTRY 0x02 @@ -105,6 +109,7 @@ HRESULT WINAPI AddDelBackupEntry(LPCSTR HRESULT WINAPI AdvInstallFile(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile, LPCSTR lpszDestDir, LPCSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved); +HRESULT WINAPI CloseINFEngine(HINF hInf); HRESULT WINAPI DelNode(LPCSTR pszFileOrDirName, DWORD dwFlags); HRESULT WINAPI DelNodeRunDLL32(HWND,HINSTANCE,LPSTR,INT); HRESULT WINAPI ExecuteCab( HWND hwnd, PCABINFO pCab, LPVOID pReserved ); @@ -121,6 +126,8 @@ INT WINAPI LaunchINFSection(HWND,HINSTAN HRESULT WINAPI LaunchINFSectionEx(HWND,HINSTANCE,LPSTR,INT); DWORD WINAPI NeedRebootInit(VOID); BOOL WINAPI NeedReboot(DWORD dwRebootCheck); +HRESULT WINAPI OpenINFEngine(PCSTR pszInfFilename, PCSTR pszInstallSection, + DWORD dwFlags, HINF *phInf, PVOID pvReserved); HRESULT WINAPI RegInstall(HMODULE hm, LPCSTR pszSection, LPCSTRTABLE pstTable); HRESULT WINAPI RegRestoreAll(HWND hWnd, PSTR pszTitleString, HKEY hkBackupKey); HRESULT WINAPI RegSaveRestore(HWND hWnd, PCSTR pszTitleString, HKEY hkBackupKey, @@ -133,6 +140,9 @@ HRESULT WINAPI RunSetupCommand(HWND hWnd HRESULT WINAPI TranslateInfString(PCSTR pszInfFilename, PCSTR pszInstallSection, PCSTR pszTranslateSection, PCSTR pszTranslateKey, PSTR pszBuffer, DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved); +HRESULT WINAPI TranslateInfStringEx(HINF hInf, PCSTR pszInfFilename, + PCSTR pszTranslateSection, PCSTR pszTranslateKey, PSTR pszBuffer, + DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved); #ifdef __cplusplus }
1
0
0
0
James Hawkins : advpack: Add a stub for AddDelBackupEntry.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: 9e9fe39774404a53ca454d649f7244a61dc66370 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=9e9fe39774404a53ca454d6…
Author: James Hawkins <truiken(a)gmail.com> Date: Sat Jan 14 17:09:02 2006 +0100 advpack: Add a stub for AddDelBackupEntry. --- dlls/advpack/advpack.spec | 2 +- dlls/advpack/files.c | 28 ++++++++++++++++++++++++++++ include/advpub.h | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletions(-) diff --git a/dlls/advpack/advpack.spec b/dlls/advpack/advpack.spec index 2fe49fe..53790ae 100644 --- a/dlls/advpack/advpack.spec +++ b/dlls/advpack/advpack.spec @@ -1,4 +1,4 @@ -@ stub AddDelBackupEntry +@ stdcall AddDelBackupEntry(str str str long) @ stdcall AdvInstallFile(long str str str str long long) @ stub CloseINFEngine @ stdcall DelNode(str long) diff --git a/dlls/advpack/files.c b/dlls/advpack/files.c index 6c2d333..87a88bb 100644 --- a/dlls/advpack/files.c +++ b/dlls/advpack/files.c @@ -31,6 +31,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(advpack); +/*********************************************************************** + * AddDelBackupEntry (ADVPACK.@) + * + * Either marks the file in the file list as not existing during file + * save, or deletes the file entry from the INI. + * + * PARAMS + * lpcszFileList [I] NULL-separated list of filenames. + * lpcszBackupDir [I] Path of the backup directory. + * lpcszBaseName [I] Basename of the backup files. + * dwFlags [I] See advpub.h. + * + * RETURNS + * Success: S_OK. + * Failure: E_FAIL. + * + * BUGS + * Unimplemented. + */ +HRESULT WINAPI AddDelBackupEntry(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, + LPCSTR lpcszBaseName, DWORD dwFlags) +{ + FIXME("(%p, %p, %p, %ld) stub\n", lpcszFileList, lpcszBackupDir, + lpcszBaseName, dwFlags); + + return E_FAIL; +} + /* FIXME: this is only for the local case, X:\ */ #define ROOT_LENGTH 3 diff --git a/include/advpub.h b/include/advpub.h index 34893dc..f45c45e 100644 --- a/include/advpub.h +++ b/include/advpub.h @@ -46,6 +46,10 @@ typedef struct _StrTable { typedef const STRTABLE CSTRTABLE; typedef CSTRTABLE *LPCSTRTABLE; +/* Flags for AddDelBackupEntry */ +#define AADBE_ADD_ENTRY 0x01 +#define AADBE_DEL_ENTRY 0x02 + /* Flags for AdvInstallFile */ #define AIF_WARNIFSKIP 0x00000001 #define AIF_NOSKIP 0x00000002 @@ -96,6 +100,8 @@ typedef CSTRTABLE *LPCSTRTABLE; #define AFSR_USEREFCNT IE4_USEREFCNT #define AFSR_EXTRAINCREFCNT IE4_EXTRAINCREFCNT +HRESULT WINAPI AddDelBackupEntry(LPCSTR lpcszFileList, LPCSTR lpcszBackupDir, + LPCSTR lpcszBaseName, DWORD dwFlags); HRESULT WINAPI AdvInstallFile(HWND hwnd, LPCSTR lpszSourceDir, LPCSTR lpszSourceFile, LPCSTR lpszDestDir, LPCSTR lpszDestFile, DWORD dwFlags, DWORD dwReserved);
1
0
0
0
Alexandre Julliard : Get rid of the no longer needed DECL_GLOBAL_CONSTRUCTOR macro.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: cfe45cc130d70cfe037e012e4e4d475cdb87a681 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cfe45cc130d70cfe037e012…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 14 17:08:52 2006 +0100 Get rid of the no longer needed DECL_GLOBAL_CONSTRUCTOR macro. --- include/wine/port.h | 26 -------------------------- loader/kthread.c | 9 ++++++++- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/include/wine/port.h b/include/wine/port.h index 238c696..10be8ce 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -210,32 +210,6 @@ struct statvfs #endif /* __GNUC__ */ -/* Constructor functions */ - -#ifdef __GNUC__ -# define DECL_GLOBAL_CONSTRUCTOR(func) \ - static void func(void) __attribute__((constructor)); \ - static void func(void) -#elif defined(__i386__) -# define DECL_GLOBAL_CONSTRUCTOR(func) \ - static void __dummy_init_##func(void) { \ - asm(".section .init,\"ax\"\n\t" \ - "call " #func "\n\t" \ - ".previous"); } \ - static void func(void) -#elif defined(__sparc__) -# define DECL_GLOBAL_CONSTRUCTOR(func) \ - static void __dummy_init_##func(void) { \ - asm("\t.section \".init\",#alloc,#execinstr\n" \ - "\tcall " #func "\n" \ - "\tnop\n" \ - "\t.section \".text\",#alloc,#execinstr\n" ); } \ - static void func(void) -#else -# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform -#endif - - /* Register functions */ #ifdef __i386__ diff --git a/loader/kthread.c b/loader/kthread.c index ddc9bb3..e27eb2e 100644 --- a/loader/kthread.c +++ b/loader/kthread.c @@ -974,7 +974,14 @@ void __pthread_initialize(void) if (libc_pthread_init) libc_multiple_threads = libc_pthread_init( &libc_pthread_functions ); } } -DECL_GLOBAL_CONSTRUCTOR(init) { __pthread_initialize(); } + +#ifdef __GNUC__ +static void init(void) __attribute__((constructor)); +static void init(void) +{ + __pthread_initialize(); +} +#endif static struct pthread_functions libc_pthread_functions = {
1
0
0
0
Alexandre Julliard : kernel: Make sure the file contains data for the ReadFile test.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: ebe727e56d49a33eb30edd051ee8030e966edd51 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ebe727e56d49a33eb30edd0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 14 17:08:14 2006 +0100 kernel: Make sure the file contains data for the ReadFile test. --- dlls/kernel/tests/file.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/kernel/tests/file.c b/dlls/kernel/tests/file.c index 3b39b5c..3310670 100644 --- a/dlls/kernel/tests/file.c +++ b/dlls/kernel/tests/file.c @@ -1369,6 +1369,10 @@ static void test_read_write(void) bytes == 10, /* Win9x */ "bytes = %ld\n", bytes); + /* make sure the file contains data */ + WriteFile(hFile, "this is the test data", 21, &bytes, NULL); + SetFilePointer(hFile, 0, NULL, FILE_BEGIN); + SetLastError(12345678); bytes = 12345678; ret = ReadFile(hFile, NULL, 0, &bytes, NULL);
1
0
0
0
Alexandre Julliard : rpcrt4: Fixed asm syntax for rep; movsl.
by Alexandre Julliard
14 Jan '06
14 Jan '06
Module: wine Branch: refs/heads/master Commit: 49c7bbe0de8a03919282ea4351a5e6ea4cfac4d7 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=49c7bbe0de8a03919282ea4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 14 17:07:28 2006 +0100 rpcrt4: Fixed asm syntax for rep; movsl. --- dlls/rpcrt4/ndr_stubless.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 32d8766..b083d2a 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -973,7 +973,7 @@ __ASM_GLOBAL_FUNC(call_server_func, "movl 12(%ebp), %esi\n\t" "shrl $2, %ecx\n\t" /* divide by 4 */ "cld\n\t" - "rep movsl\n\t" /* Copy dword blocks */ + "rep; movsl\n\t" /* Copy dword blocks */ "call *8(%ebp)\n\t" /* Call function */ "leal -8(%ebp), %esp\n\t" /* Restore stack */ "popl %esi\n\t" /* Restore registers */
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
62
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
Results per page:
10
25
50
100
200