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
October 2010
----- 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
2 participants
1174 discussions
Start a n
N
ew thread
Andrew Nguyen : msvcrt: Implement _localtime64_s.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: e245cb52c6f4e2dd60a8e4989a2ba79e39039067 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e245cb52c6f4e2dd60a8e4989…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Mon Oct 11 05:24:20 2010 -0500 msvcrt: Implement _localtime64_s. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/msvcrt.h | 2 + dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/tests/time.c | 70 +++++++++++++++++++++++++++++++++++++++++++ dlls/msvcrt/time.c | 45 +++++++++++++++++++++++++++ include/msvcrt/time.h | 1 + 8 files changed, 122 insertions(+), 4 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 79517e5..ace6201 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -849,7 +849,7 @@ @ cdecl _localtime32(ptr) msvcrt._localtime32 @ stub _localtime32_s @ cdecl _localtime64(ptr) msvcrt._localtime64 -@ stub _localtime64_s +@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s @ cdecl _lock(long) msvcrt._lock @ stub _lock_file @ cdecl _locking(long long long) msvcrt._locking diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 3795264..3c03f09 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -695,7 +695,7 @@ @ cdecl _localtime32(ptr) msvcrt._localtime32 @ stub _localtime32_s @ cdecl _localtime64(ptr) msvcrt._localtime64 -@ stub _localtime64_s +@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s @ cdecl _lock(long) msvcrt._lock @ stub _lock_file @ cdecl _locking(long long long) msvcrt._locking diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index c0ed8b6..5917bcc 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -683,7 +683,7 @@ @ cdecl _localtime32(ptr) msvcrt._localtime32 @ stub _localtime32_s @ cdecl _localtime64(ptr) msvcrt._localtime64 -@ stub _localtime64_s +@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s @ cdecl _lock(long) msvcrt._lock @ stub _lock_file @ cdecl _locking(long long long) msvcrt._locking diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 8e0bd43..3d9639e 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -717,6 +717,8 @@ typedef void (__cdecl *MSVCRT___sighandler_t)(int); #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1) +#define _MAX__TIME64_T (((MSVCRT___time64_t)0x00000007 << 32) | 0x93406FFF) + void __cdecl MSVCRT_free(void*); void* __cdecl MSVCRT_malloc(MSVCRT_size_t); void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t); diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 341093b..8f3a318 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -622,7 +622,7 @@ @ cdecl _localtime32(ptr) MSVCRT__localtime32 # stub _localtime32_s @ cdecl _localtime64(ptr) MSVCRT__localtime64 -# stub _localtime64_s +@ cdecl _localtime64_s(ptr ptr) @ cdecl _lock(long) @ cdecl _locking(long long long) MSVCRT__locking @ cdecl _logb( double ) diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index b11ecf7..38e06c2 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -27,6 +27,8 @@ #include <stdio.h> /*printf*/ #include <errno.h> +#define _MAX__TIME64_T (((__time64_t)0x00000007 << 32) | 0x93406FFF) + #define SECSPERDAY 86400 #define SECSPERHOUR 3600 #define SECSPERMIN 60 @@ -38,6 +40,7 @@ static struct tm* (__cdecl *p_gmtime32)(__time32_t*); static errno_t (__cdecl *p_gmtime32_s)(struct tm*, __time32_t*); static errno_t (__cdecl *p_strtime_s)(char*,size_t); static errno_t (__cdecl *p_strdate_s)(char*,size_t); +static errno_t (__cdecl *p_localtime64_s)(struct tm*, __time64_t*); static void init(void) { @@ -48,6 +51,7 @@ static void init(void) p_mkgmtime32 = (void*)GetProcAddress(hmod, "_mkgmtime32"); p_strtime_s = (void*)GetProcAddress(hmod, "_strtime_s"); p_strdate_s = (void*)GetProcAddress(hmod, "_strdate_s"); + p_localtime64_s = (void*)GetProcAddress(hmod, "_localtime64_s"); } static int get_test_year(time_t *start) @@ -421,6 +425,71 @@ static void test_wstrtime(void) ok(count == 3, "Wrong format: count = %d, should be 3\n", count); } +static void test_localtime64_s(void) +{ + struct tm tm; + __time64_t time; + errno_t err; + + if (!p_localtime64_s) + { + win_skip("Skipping _localtime64_s tests\n"); + return; + } + + errno = EBADF; + err = p_localtime64_s(NULL, NULL); + ok(err == EINVAL, "Expected _localtime64_s to return EINVAL, got %d\n", err); + ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); + + errno = EBADF; + time = 0xdeadbeef; + err = p_localtime64_s(NULL, &time); + ok(err == EINVAL, "Expected _localtime64_s to return EINVAL, got %d\n", err); + ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); + + memset(&tm, 0, sizeof(tm)); + errno = EBADF; + err = p_localtime64_s(&tm, NULL); + ok(err == EINVAL, "Expected _localtime64_s to return EINVAL, got %d\n", err); + ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); + ok(tm.tm_sec == -1 && tm.tm_min == -1 && tm.tm_hour == -1 && + tm.tm_mday == -1 && tm.tm_mon == -1 && tm.tm_year == -1 && + tm.tm_wday == -1 && tm.tm_yday == -1 && tm.tm_isdst == -1, + "Expected tm structure members to be initialized to -1, got " + "(%d, %d, %d, %d, %d, %d, %d, %d, %d)\n", tm.tm_sec, tm.tm_min, + tm.tm_hour, tm.tm_mday, tm.tm_mon, tm.tm_year, tm.tm_wday, tm.tm_yday, + tm.tm_isdst); + + memset(&tm, 0, sizeof(tm)); + time = -1; + errno = EBADF; + err = p_localtime64_s(&tm, &time); + ok(err == EINVAL, "Expected _localtime64_s to return EINVAL, got %d\n", err); + ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); + ok(tm.tm_sec == -1 && tm.tm_min == -1 && tm.tm_hour == -1 && + tm.tm_mday == -1 && tm.tm_mon == -1 && tm.tm_year == -1 && + tm.tm_wday == -1 && tm.tm_yday == -1 && tm.tm_isdst == -1, + "Expected tm structure members to be initialized to -1, got " + "(%d, %d, %d, %d, %d, %d, %d, %d, %d)\n", tm.tm_sec, tm.tm_min, + tm.tm_hour, tm.tm_mday, tm.tm_mon, tm.tm_year, tm.tm_wday, tm.tm_yday, + tm.tm_isdst); + + memset(&tm, 0, sizeof(tm)); + time = _MAX__TIME64_T + 1; + errno = EBADF; + err = p_localtime64_s(&tm, &time); + ok(err == EINVAL, "Expected _localtime64_s to return EINVAL, got %d\n", err); + ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); + ok(tm.tm_sec == -1 && tm.tm_min == -1 && tm.tm_hour == -1 && + tm.tm_mday == -1 && tm.tm_mon == -1 && tm.tm_year == -1 && + tm.tm_wday == -1 && tm.tm_yday == -1 && tm.tm_isdst == -1, + "Expected tm structure members to be initialized to -1, got " + "(%d, %d, %d, %d, %d, %d, %d, %d, %d)\n", tm.tm_sec, tm.tm_min, + tm.tm_hour, tm.tm_mday, tm.tm_mon, tm.tm_year, tm.tm_wday, tm.tm_yday, + tm.tm_isdst); +} + START_TEST(time) { init(); @@ -433,4 +502,5 @@ START_TEST(time) test_strtime(); test_wstrdate(); test_wstrtime(); + test_localtime64_s(); } diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index df31593..d0201e2 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -78,6 +78,19 @@ static inline void unix_tm_to_msvcrt( struct MSVCRT_tm *dest, const struct tm *s dest->tm_isdst = src->tm_isdst; } +static inline void write_invalid_msvcrt_tm( struct MSVCRT_tm *tm ) +{ + tm->tm_sec = -1; + tm->tm_min = -1; + tm->tm_hour = -1; + tm->tm_mday = -1; + tm->tm_mon = -1; + tm->tm_year = -1; + tm->tm_wday = -1; + tm->tm_yday = -1; + tm->tm_isdst = -1; +} + #define SECSPERDAY 86400 /* 1601 to 1970 is 369 years plus 89 leap days */ #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY) @@ -206,6 +219,38 @@ struct MSVCRT_tm* CDECL MSVCRT__localtime64(const MSVCRT___time64_t* secs) } /********************************************************************* + * _localtime64_s (MSVCRT.@) + */ +int CDECL _localtime64_s(struct MSVCRT_tm *time, const MSVCRT___time64_t *secs) +{ + struct tm *tm; + time_t seconds; + + if (!time || !secs || *secs < 0 || *secs > _MAX__TIME64_T) + { + if (time) + write_invalid_msvcrt_tm(time); + + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + seconds = *secs; + + _mlock(_TIME_LOCK); + if (!(tm = localtime(&seconds))) + { + _munlock(_TIME_LOCK); + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + unix_tm_to_msvcrt(time, tm); + _munlock(_TIME_LOCK); + return 0; +} + +/********************************************************************* * _localtime32 (MSVCRT.@) */ struct MSVCRT_tm* CDECL MSVCRT__localtime32(const MSVCRT___time32_t* secs) diff --git a/include/msvcrt/time.h b/include/msvcrt/time.h index ebbfbc2..194b47c 100644 --- a/include/msvcrt/time.h +++ b/include/msvcrt/time.h @@ -104,6 +104,7 @@ struct tm* __cdecl _gmtime32(const __time32_t*); struct tm* __cdecl _gmtime64(const __time64_t*); struct tm* __cdecl _localtime32(const __time32_t*); struct tm* __cdecl _localtime64(const __time64_t*); +errno_t __cdecl _localtime64_s(struct tm*, const __time64_t*); __time32_t __cdecl _mktime32(struct tm*); __time64_t __cdecl _mktime64(struct tm*); size_t __cdecl strftime(char*,size_t,const char*,const struct tm*);
1
0
0
0
Henri Verbeet : wined3d: Add traces to IWineD3DDeviceImpl_AcquireFocusWindow() / IWineD3DDeviceImpl_ReleaseFocusWindow().
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: 3c45bba11eb82ef152817bc4710affcdbaecb8d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c45bba11eb82ef152817bc47…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Oct 11 13:06:20 2010 +0200 wined3d: Add traces to IWineD3DDeviceImpl_AcquireFocusWindow() / IWineD3DDeviceImpl_ReleaseFocusWindow(). --- dlls/wined3d/device.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 97acd5f..209f87d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1754,6 +1754,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_AcquireFocusWindow(IWineD3DDevice *ifac { IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface; + TRACE("iface %p, window %p.\n", iface, window); + if (!wined3d_register_window(window, device)) { ERR("Failed to register window %p.\n", window); @@ -1770,6 +1772,8 @@ static void WINAPI IWineD3DDeviceImpl_ReleaseFocusWindow(IWineD3DDevice *iface) { IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface; + TRACE("iface %p.\n", iface); + if (device->focus_window) wined3d_unregister_window(device->focus_window); device->focus_window = NULL; }
1
0
0
0
Henri Verbeet : wined3d: Recognize the SM4 utof opcode.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: ff9c2fcdb2bc03976b7cdd6e111917cc23388607 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff9c2fcdb2bc03976b7cdd6e1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Oct 11 13:06:19 2010 +0200 wined3d: Recognize the SM4 utof opcode. --- dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/shader.c | 1 + dlls/wined3d/shader_sm4.c | 2 ++ dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index e4eb02a..c609291 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5025,6 +5025,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_TEXREG2AR */ pshader_hw_texreg2ar, /* WINED3DSIH_TEXREG2GB */ pshader_hw_texreg2gb, /* WINED3DSIH_TEXREG2RGB */ pshader_hw_texreg2rgb, + /* WINED3DSIH_UTOF */ NULL, }; static inline BOOL get_bool_const(const struct wined3d_shader_instruction *ins, IWineD3DBaseShaderImpl *This, DWORD idx) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index fd0b853..3390848 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -5083,6 +5083,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_TEXREG2AR */ shader_glsl_texreg2ar, /* WINED3DSIH_TEXREG2GB */ shader_glsl_texreg2gb, /* WINED3DSIH_TEXREG2RGB */ shader_glsl_texreg2rgb, + /* WINED3DSIH_UTOF */ NULL, }; static void shader_glsl_handle_instruction(const struct wined3d_shader_instruction *ins) { diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index b7f9a91..f6546c8 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -129,6 +129,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_TEXREG2AR */ "texreg2ar", /* WINED3DSIH_TEXREG2GB */ "texreg2gb", /* WINED3DSIH_TEXREG2RGB */ "texreg2rgb", + /* WINED3DSIH_UTOF */ "utof", }; static const char * const semantic_names[] = diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 9a02830..1b4dbd5 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -79,6 +79,7 @@ enum wined3d_sm4_opcode WINED3D_SM4_OP_SAMPLE = 0x45, WINED3D_SM4_OP_SAMPLE_LOD = 0x48, WINED3D_SM4_OP_SINCOS = 0x4d, + WINED3D_SM4_OP_UTOF = 0x56, }; enum wined3d_sm4_register_type @@ -152,6 +153,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, 1, 3}, {WINED3D_SM4_OP_SAMPLE_LOD, WINED3DSIH_SAMPLE_LOD, 1, 4}, {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, 2, 1}, + {WINED3D_SM4_OP_UTOF, WINED3DSIH_UTOF, 1, 1}, }; static const WINED3DSHADER_PARAM_REGISTER_TYPE register_type_table[] = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3e2596e..b291d43 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -497,6 +497,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_TEXREG2AR, WINED3DSIH_TEXREG2GB, WINED3DSIH_TEXREG2RGB, + WINED3DSIH_UTOF, WINED3DSIH_TABLE_SIZE };
1
0
0
0
Henri Verbeet : wined3d: Recognize the SM4 sample_l opcode.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: 18d7a73af8153de281ad7f3dc8b5f01ba701cd28 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18d7a73af8153de281ad7f3dc…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Oct 11 13:06:18 2010 +0200 wined3d: Recognize the SM4 sample_l opcode. --- dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/shader.c | 1 + dlls/wined3d/shader_sm4.c | 122 +++++++++++++++++++------------------ dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 66 insertions(+), 60 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 46462a3..e4eb02a 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4996,6 +4996,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_RET */ shader_hw_ret, /* WINED3DSIH_RSQ */ shader_hw_scalar_op, /* WINED3DSIH_SAMPLE */ NULL, + /* WINED3DSIH_SAMPLE_LOD */ NULL, /* WINED3DSIH_SETP */ NULL, /* WINED3DSIH_SGE */ shader_hw_map2gl, /* WINED3DSIH_SGN */ shader_hw_sgn, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 3efff9a..fd0b853 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -5054,6 +5054,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_RET */ shader_glsl_ret, /* WINED3DSIH_RSQ */ shader_glsl_rsq, /* WINED3DSIH_SAMPLE */ NULL, + /* WINED3DSIH_SAMPLE_LOD */ NULL, /* WINED3DSIH_SETP */ NULL, /* WINED3DSIH_SGE */ shader_glsl_compare, /* WINED3DSIH_SGN */ shader_glsl_sgn, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index ff967ce..b7f9a91 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -100,6 +100,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_RET */ "ret", /* WINED3DSIH_RSQ */ "rsq", /* WINED3DSIH_SAMPLE */ "sample", + /* WINED3DSIH_SAMPLE_LOD */ "sample_l", /* WINED3DSIH_SETP */ "setp", /* WINED3DSIH_SGE */ "sge", /* WINED3DSIH_SGN */ "sgn", diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index f706b5a..9a02830 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -48,36 +48,37 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); enum wined3d_sm4_opcode { - WINED3D_SM4_OP_ADD = 0x00, - WINED3D_SM4_OP_AND = 0x01, - WINED3D_SM4_OP_BREAK = 0x02, - WINED3D_SM4_OP_BREAKC = 0x03, - WINED3D_SM4_OP_CUT = 0x09, - WINED3D_SM4_OP_DP3 = 0x10, - WINED3D_SM4_OP_DP4 = 0x11, - WINED3D_SM4_OP_EMIT = 0x13, - WINED3D_SM4_OP_ENDIF = 0x15, - WINED3D_SM4_OP_ENDLOOP = 0x16, - WINED3D_SM4_OP_EXP = 0x19, - WINED3D_SM4_OP_FRC = 0x1a, - WINED3D_SM4_OP_IADD = 0x1e, - WINED3D_SM4_OP_IF = 0x1f, - WINED3D_SM4_OP_IGE = 0x21, - WINED3D_SM4_OP_IMUL = 0x26, - WINED3D_SM4_OP_ITOF = 0x2b, - WINED3D_SM4_OP_LOG = 0x2f, - WINED3D_SM4_OP_LOOP = 0x30, - WINED3D_SM4_OP_LT = 0x31, - WINED3D_SM4_OP_MAD = 0x32, - WINED3D_SM4_OP_MIN = 0x33, - WINED3D_SM4_OP_MAX = 0x34, - WINED3D_SM4_OP_MOV = 0x36, - WINED3D_SM4_OP_MOVC = 0x37, - WINED3D_SM4_OP_MUL = 0x38, - WINED3D_SM4_OP_RET = 0x3e, - WINED3D_SM4_OP_RSQ = 0x44, - WINED3D_SM4_OP_SAMPLE = 0x45, - WINED3D_SM4_OP_SINCOS = 0x4d, + WINED3D_SM4_OP_ADD = 0x00, + WINED3D_SM4_OP_AND = 0x01, + WINED3D_SM4_OP_BREAK = 0x02, + WINED3D_SM4_OP_BREAKC = 0x03, + WINED3D_SM4_OP_CUT = 0x09, + WINED3D_SM4_OP_DP3 = 0x10, + WINED3D_SM4_OP_DP4 = 0x11, + WINED3D_SM4_OP_EMIT = 0x13, + WINED3D_SM4_OP_ENDIF = 0x15, + WINED3D_SM4_OP_ENDLOOP = 0x16, + WINED3D_SM4_OP_EXP = 0x19, + WINED3D_SM4_OP_FRC = 0x1a, + WINED3D_SM4_OP_IADD = 0x1e, + WINED3D_SM4_OP_IF = 0x1f, + WINED3D_SM4_OP_IGE = 0x21, + WINED3D_SM4_OP_IMUL = 0x26, + WINED3D_SM4_OP_ITOF = 0x2b, + WINED3D_SM4_OP_LOG = 0x2f, + WINED3D_SM4_OP_LOOP = 0x30, + WINED3D_SM4_OP_LT = 0x31, + WINED3D_SM4_OP_MAD = 0x32, + WINED3D_SM4_OP_MIN = 0x33, + WINED3D_SM4_OP_MAX = 0x34, + WINED3D_SM4_OP_MOV = 0x36, + WINED3D_SM4_OP_MOVC = 0x37, + WINED3D_SM4_OP_MUL = 0x38, + WINED3D_SM4_OP_RET = 0x3e, + WINED3D_SM4_OP_RSQ = 0x44, + WINED3D_SM4_OP_SAMPLE = 0x45, + WINED3D_SM4_OP_SAMPLE_LOD = 0x48, + WINED3D_SM4_OP_SINCOS = 0x4d, }; enum wined3d_sm4_register_type @@ -120,36 +121,37 @@ struct sysval_map static const struct wined3d_sm4_opcode_info opcode_table[] = { - {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, 1, 2}, - {WINED3D_SM4_OP_AND, WINED3DSIH_AND, 1, 2}, - {WINED3D_SM4_OP_BREAK, WINED3DSIH_BREAK, 0, 0}, - {WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, 0, 1}, - {WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, 0, 0}, - {WINED3D_SM4_OP_DP3, WINED3DSIH_DP3, 1, 2}, - {WINED3D_SM4_OP_DP4, WINED3DSIH_DP4, 1, 2}, - {WINED3D_SM4_OP_EMIT, WINED3DSIH_EMIT, 0, 0}, - {WINED3D_SM4_OP_ENDIF, WINED3DSIH_ENDIF, 0, 0}, - {WINED3D_SM4_OP_ENDLOOP,WINED3DSIH_ENDLOOP, 0, 0}, - {WINED3D_SM4_OP_EXP, WINED3DSIH_EXP, 1, 1}, - {WINED3D_SM4_OP_FRC, WINED3DSIH_FRC, 1, 1}, - {WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, 1, 2}, - {WINED3D_SM4_OP_IF, WINED3DSIH_IF, 0, 1}, - {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, 1, 2}, - {WINED3D_SM4_OP_IMUL, WINED3DSIH_IMUL, 2, 2}, - {WINED3D_SM4_OP_ITOF, WINED3DSIH_ITOF, 1, 1}, - {WINED3D_SM4_OP_LOG, WINED3DSIH_LOG, 1, 1}, - {WINED3D_SM4_OP_LOOP, WINED3DSIH_LOOP, 0, 0}, - {WINED3D_SM4_OP_LT, WINED3DSIH_LT, 1, 2}, - {WINED3D_SM4_OP_MAD, WINED3DSIH_MAD, 1, 3}, - {WINED3D_SM4_OP_MIN, WINED3DSIH_MIN, 1, 2}, - {WINED3D_SM4_OP_MAX, WINED3DSIH_MAX, 1, 2}, - {WINED3D_SM4_OP_MOV, WINED3DSIH_MOV, 1, 1}, - {WINED3D_SM4_OP_MOVC, WINED3DSIH_MOVC, 1, 3}, - {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, 1, 2}, - {WINED3D_SM4_OP_RET, WINED3DSIH_RET, 0, 0}, - {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, 1, 1}, - {WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, 1, 3}, - {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, 2, 1}, + {WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, 1, 2}, + {WINED3D_SM4_OP_AND, WINED3DSIH_AND, 1, 2}, + {WINED3D_SM4_OP_BREAK, WINED3DSIH_BREAK, 0, 0}, + {WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, 0, 1}, + {WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, 0, 0}, + {WINED3D_SM4_OP_DP3, WINED3DSIH_DP3, 1, 2}, + {WINED3D_SM4_OP_DP4, WINED3DSIH_DP4, 1, 2}, + {WINED3D_SM4_OP_EMIT, WINED3DSIH_EMIT, 0, 0}, + {WINED3D_SM4_OP_ENDIF, WINED3DSIH_ENDIF, 0, 0}, + {WINED3D_SM4_OP_ENDLOOP, WINED3DSIH_ENDLOOP, 0, 0}, + {WINED3D_SM4_OP_EXP, WINED3DSIH_EXP, 1, 1}, + {WINED3D_SM4_OP_FRC, WINED3DSIH_FRC, 1, 1}, + {WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, 1, 2}, + {WINED3D_SM4_OP_IF, WINED3DSIH_IF, 0, 1}, + {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, 1, 2}, + {WINED3D_SM4_OP_IMUL, WINED3DSIH_IMUL, 2, 2}, + {WINED3D_SM4_OP_ITOF, WINED3DSIH_ITOF, 1, 1}, + {WINED3D_SM4_OP_LOG, WINED3DSIH_LOG, 1, 1}, + {WINED3D_SM4_OP_LOOP, WINED3DSIH_LOOP, 0, 0}, + {WINED3D_SM4_OP_LT, WINED3DSIH_LT, 1, 2}, + {WINED3D_SM4_OP_MAD, WINED3DSIH_MAD, 1, 3}, + {WINED3D_SM4_OP_MIN, WINED3DSIH_MIN, 1, 2}, + {WINED3D_SM4_OP_MAX, WINED3DSIH_MAX, 1, 2}, + {WINED3D_SM4_OP_MOV, WINED3DSIH_MOV, 1, 1}, + {WINED3D_SM4_OP_MOVC, WINED3DSIH_MOVC, 1, 3}, + {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, 1, 2}, + {WINED3D_SM4_OP_RET, WINED3DSIH_RET, 0, 0}, + {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, 1, 1}, + {WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, 1, 3}, + {WINED3D_SM4_OP_SAMPLE_LOD, WINED3DSIH_SAMPLE_LOD, 1, 4}, + {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, 2, 1}, }; static const WINED3DSHADER_PARAM_REGISTER_TYPE register_type_table[] = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7af33ac..3e2596e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -468,6 +468,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_RET, WINED3DSIH_RSQ, WINED3DSIH_SAMPLE, + WINED3DSIH_SAMPLE_LOD, WINED3DSIH_SETP, WINED3DSIH_SGE, WINED3DSIH_SGN,
1
0
0
0
Henri Verbeet : wined3d: Recognize the SM4 sample opcode.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: 407ed1b875293b357a97de8cf3ea7942a291a537 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=407ed1b875293b357a97de8cf…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Oct 11 13:06:17 2010 +0200 wined3d: Recognize the SM4 sample opcode. --- dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/shader.c | 1 + dlls/wined3d/shader_sm4.c | 2 ++ dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index ec13a65..46462a3 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4995,6 +4995,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_REP */ shader_hw_rep, /* WINED3DSIH_RET */ shader_hw_ret, /* WINED3DSIH_RSQ */ shader_hw_scalar_op, + /* WINED3DSIH_SAMPLE */ NULL, /* WINED3DSIH_SETP */ NULL, /* WINED3DSIH_SGE */ shader_hw_map2gl, /* WINED3DSIH_SGN */ shader_hw_sgn, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 4b65d39..3efff9a 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -5053,6 +5053,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_REP */ shader_glsl_rep, /* WINED3DSIH_RET */ shader_glsl_ret, /* WINED3DSIH_RSQ */ shader_glsl_rsq, + /* WINED3DSIH_SAMPLE */ NULL, /* WINED3DSIH_SETP */ NULL, /* WINED3DSIH_SGE */ shader_glsl_compare, /* WINED3DSIH_SGN */ shader_glsl_sgn, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index f3ae897..ff967ce 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -99,6 +99,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_REP */ "rep", /* WINED3DSIH_RET */ "ret", /* WINED3DSIH_RSQ */ "rsq", + /* WINED3DSIH_SAMPLE */ "sample", /* WINED3DSIH_SETP */ "setp", /* WINED3DSIH_SGE */ "sge", /* WINED3DSIH_SGN */ "sgn", diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index b94650c..f706b5a 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -76,6 +76,7 @@ enum wined3d_sm4_opcode WINED3D_SM4_OP_MUL = 0x38, WINED3D_SM4_OP_RET = 0x3e, WINED3D_SM4_OP_RSQ = 0x44, + WINED3D_SM4_OP_SAMPLE = 0x45, WINED3D_SM4_OP_SINCOS = 0x4d, }; @@ -147,6 +148,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_MUL, WINED3DSIH_MUL, 1, 2}, {WINED3D_SM4_OP_RET, WINED3DSIH_RET, 0, 0}, {WINED3D_SM4_OP_RSQ, WINED3DSIH_RSQ, 1, 1}, + {WINED3D_SM4_OP_SAMPLE, WINED3DSIH_SAMPLE, 1, 3}, {WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, 2, 1}, }; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9116687..7af33ac 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -467,6 +467,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_REP, WINED3DSIH_RET, WINED3DSIH_RSQ, + WINED3DSIH_SAMPLE, WINED3DSIH_SETP, WINED3DSIH_SGE, WINED3DSIH_SGN,
1
0
0
0
Henri Verbeet : wined3d: Recognize the SM4 itof opcode.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: b2f520b5f06fdcb8642f39bdaa97e5fc50cd5bb6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b2f520b5f06fdcb8642f39bda…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Oct 11 13:06:16 2010 +0200 wined3d: Recognize the SM4 itof opcode. --- dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/shader.c | 1 + dlls/wined3d/shader_sm4.c | 2 ++ dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index c053e7f..ec13a65 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4967,6 +4967,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_IFC */ shader_hw_ifc, /* WINED3DSIH_IGE */ NULL, /* WINED3DSIH_IMUL */ NULL, + /* WINED3DSIH_ITOF */ NULL, /* WINED3DSIH_LABEL */ shader_hw_label, /* WINED3DSIH_LIT */ shader_hw_map2gl, /* WINED3DSIH_LOG */ shader_hw_log_pow, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 0b5bb36..4b65d39 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -5025,6 +5025,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_IFC */ shader_glsl_ifc, /* WINED3DSIH_IGE */ NULL, /* WINED3DSIH_IMUL */ NULL, + /* WINED3DSIH_ITOF */ NULL, /* WINED3DSIH_LABEL */ shader_glsl_label, /* WINED3DSIH_LIT */ shader_glsl_lit, /* WINED3DSIH_LOG */ shader_glsl_log, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index bc39b3b..f3ae897 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -71,6 +71,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_IFC */ "ifc", /* WINED3DSIH_IGE */ "ige", /* WINED3DSIH_IMUL */ "imul", + /* WINED3DSIH_ITOF */ "itof", /* WINED3DSIH_LABEL */ "label", /* WINED3DSIH_LIT */ "lit", /* WINED3DSIH_LOG */ "log", diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index a438614..b94650c 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -64,6 +64,7 @@ enum wined3d_sm4_opcode WINED3D_SM4_OP_IF = 0x1f, WINED3D_SM4_OP_IGE = 0x21, WINED3D_SM4_OP_IMUL = 0x26, + WINED3D_SM4_OP_ITOF = 0x2b, WINED3D_SM4_OP_LOG = 0x2f, WINED3D_SM4_OP_LOOP = 0x30, WINED3D_SM4_OP_LT = 0x31, @@ -134,6 +135,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM4_OP_IF, WINED3DSIH_IF, 0, 1}, {WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, 1, 2}, {WINED3D_SM4_OP_IMUL, WINED3DSIH_IMUL, 2, 2}, + {WINED3D_SM4_OP_ITOF, WINED3DSIH_ITOF, 1, 1}, {WINED3D_SM4_OP_LOG, WINED3DSIH_LOG, 1, 1}, {WINED3D_SM4_OP_LOOP, WINED3DSIH_LOOP, 0, 0}, {WINED3D_SM4_OP_LT, WINED3DSIH_LT, 1, 2}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3651c32..9116687 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -439,6 +439,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_IFC, WINED3DSIH_IGE, WINED3DSIH_IMUL, + WINED3DSIH_ITOF, WINED3DSIH_LABEL, WINED3DSIH_LIT, WINED3DSIH_LOG,
1
0
0
0
Andrew Nguyen : winex11.drv: Avoid relying on PATH_MAX in X11DRV_FONT_InitX11Metrics helper.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: f340b64fb892c54bc3ccb95b8ff60ab92c3d3025 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f340b64fb892c54bc3ccb95b8…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Mon Oct 11 05:19:52 2010 -0500 winex11.drv: Avoid relying on PATH_MAX in X11DRV_FONT_InitX11Metrics helper. --- dlls/winex11.drv/xfont.c | 67 ++++++++++++++++++++++----------------------- 1 files changed, 33 insertions(+), 34 deletions(-) diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index 374590b..307ee09 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -1824,21 +1824,20 @@ static void XFONT_LoadIgnores( HKEY hkey ) * Returns expanded name for the cachedmetrics file. * Now it also appends the current value of the $DISPLAY variable. */ -static char* XFONT_UserMetricsCache( char* buffer, int* buf_size ) +static char* XFONT_UserMetricsCache(void) { const char *confdir = wine_get_config_dir(); const char *display_name = XDisplayName(NULL); int len = strlen(confdir) + strlen(INIFontMetrics) + strlen(display_name) + 8; + char *buffer; unsigned int display = 0; unsigned int screen = 0; char *p, *ext; - - if ((len > *buf_size) && - !(buffer = HeapReAlloc( GetProcessHeap(), 0, buffer, *buf_size = len ))) + if (!(buffer = HeapAlloc(GetProcessHeap(), 0, len))) { ERR("out of memory\n"); - ExitProcess(1); + return NULL; } sprintf( buffer, "%s/%s", confdir, INIFontMetrics ); @@ -2890,9 +2889,9 @@ static void X11DRV_FONT_InitX11Metrics( void ) { char** x_pattern; unsigned x_checksum; - int i, x_count, buf_size; - char *buffer; - HKEY hkey; + int i, x_count; + char *buffer = NULL; + HKEY hkey = NULL; XFontStruct* x_fs; char fontcheck_name[] = "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1"; @@ -2907,48 +2906,48 @@ static void X11DRV_FONT_InitX11Metrics( void ) for( i = x_checksum = 0; i < x_count; i++ ) { int j; -#if 0 - printf("%i\t: %s\n", i, x_pattern[i] ); -#endif j = strlen( x_pattern[i] ); if( j ) x_checksum ^= __genericCheckSum( x_pattern[i], j ); } x_checksum |= X_PFONT_MAGIC; - buf_size = PATH_MAX; - buffer = HeapAlloc( GetProcessHeap(), 0, buf_size ); /* deal with systemwide font metrics cache */ - buffer[0] = 0; /* @@ Wine registry key: HKCU\Software\Wine\X11 Driver\Fonts */ - if (RegOpenKeyA(HKEY_CURRENT_USER, INIFontSection, &hkey)) hkey = 0; - if (hkey) + if (RegOpenKeyA(HKEY_CURRENT_USER, INIFontSection, &hkey) == ERROR_SUCCESS) { - DWORD type, count = buf_size; - RegQueryValueExA(hkey, INIGlobalMetrics, 0, &type, (LPBYTE)buffer, &count); + DWORD type, count = 0; + if (RegQueryValueExA(hkey, INIGlobalMetrics, NULL, &type, NULL, &count) == ERROR_SUCCESS && + type == REG_SZ) + { + buffer = HeapAlloc(GetProcessHeap(), 0, count + 1); + if (RegQueryValueExA(hkey, INIGlobalMetrics, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS) + { + buffer[count] = '\0'; + TRACE("system fontcache is '%s'\n", buffer); + XFONT_ReadCachedMetrics(buffer, DefResolution, x_checksum, x_count); + } + HeapFree(GetProcessHeap(), 0, buffer); + buffer = NULL; + } } - if( buffer[0] ) - { - TRACE("system fontcache is '%s'\n", buffer); - XFONT_ReadCachedMetrics(buffer, DefResolution, x_checksum, x_count); - } if (fontList == NULL) { - /* try per-user */ - buffer = XFONT_UserMetricsCache( buffer, &buf_size ); - if( buffer[0] ) - { - TRACE("user fontcache is '%s'\n", buffer); - XFONT_ReadCachedMetrics(buffer, DefResolution, x_checksum, x_count); - } + /* try per-user */ + buffer = XFONT_UserMetricsCache(); + if (buffer) + { + TRACE("user fontcache is '%s'\n", buffer); + XFONT_ReadCachedMetrics(buffer, DefResolution, x_checksum, x_count); + } } - if( fontList == NULL ) /* build metrics from scratch */ + if (fontList == NULL) /* build metrics from scratch */ { int n_ff = XFONT_BuildMetrics(x_pattern, DefResolution, x_checksum, x_count); - if( buffer[0] ) /* update cached metrics */ + if( buffer ) /* update cached metrics */ { int fd = open( buffer, O_CREAT | O_TRUNC | O_RDWR, 0666 ); if ( fd < 0 ) @@ -2963,6 +2962,8 @@ static void X11DRV_FONT_InitX11Metrics( void ) } } + HeapFree(GetProcessHeap(), 0, buffer); + wine_tsx11_lock(); XFreeFontNames(x_pattern); @@ -2975,8 +2976,6 @@ static void X11DRV_FONT_InitX11Metrics( void ) wine_tsx11_unlock(); - HeapFree(GetProcessHeap(), 0, buffer); - XFONT_WindowsNames(); XFONT_LoadAliases( hkey ); if (hkey) XFONT_LoadDefaults( hkey );
1
0
0
0
Andrew Nguyen : winex11.drv: Use a separate string buffer for X11R6 font check.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: 093ae8b691a9fc295eb806164d377a072477a810 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=093ae8b691a9fc295eb806164…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Mon Oct 11 05:19:19 2010 -0500 winex11.drv: Use a separate string buffer for X11R6 font check. --- dlls/winex11.drv/xfont.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index aa3eb76..374590b 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -2893,7 +2893,8 @@ static void X11DRV_FONT_InitX11Metrics( void ) int i, x_count, buf_size; char *buffer; HKEY hkey; - + XFontStruct* x_fs; + char fontcheck_name[] = "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1"; wine_tsx11_lock(); x_pattern = XListFonts(gdi_display, "*", MAX_FONTS, &x_count ); @@ -2966,15 +2967,12 @@ static void X11DRV_FONT_InitX11Metrics( void ) XFreeFontNames(x_pattern); /* check if we're dealing with X11 R6 server */ + if( (x_fs = safe_XLoadQueryFont(gdi_display, fontcheck_name)) ) { - XFontStruct* x_fs; - strcpy(buffer, "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1"); - if( (x_fs = safe_XLoadQueryFont(gdi_display, buffer)) ) - { - text_caps |= TC_SF_X_YINDEP; - XFreeFont(gdi_display, x_fs); - } + text_caps |= TC_SF_X_YINDEP; + XFreeFont(gdi_display, x_fs); } + wine_tsx11_unlock(); HeapFree(GetProcessHeap(), 0, buffer);
1
0
0
0
Andrew Nguyen : kernel32: Make the return type of LoadModule match the Windows SDK.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: 6d605e68f4366ab06f33732a344cebdcf73c72c6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d605e68f4366ab06f33732a3…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Mon Oct 11 05:16:51 2010 -0500 kernel32: Make the return type of LoadModule match the Windows SDK. --- dlls/kernel32/process.c | 20 ++++++++++---------- include/winbase.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index d4c2063..fdd19db 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -2297,25 +2297,25 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow ) /********************************************************************** * LoadModule (KERNEL32.@) */ -HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) +DWORD WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) { LOADPARMS32 *params = paramBlock; PROCESS_INFORMATION info; STARTUPINFOA startup; - HINSTANCE hInstance; + DWORD ret; LPSTR cmdline, p; char filename[MAX_PATH]; BYTE len; - if (!name) return (HINSTANCE)ERROR_FILE_NOT_FOUND; + if (!name) return ERROR_FILE_NOT_FOUND; if (!SearchPathA( NULL, name, ".exe", sizeof(filename), filename, NULL ) && !SearchPathA( NULL, name, NULL, sizeof(filename), filename, NULL )) - return ULongToHandle(GetLastError()); + return GetLastError(); len = (BYTE)params->lpCmdLine[0]; if (!(cmdline = HeapAlloc( GetProcessHeap(), 0, strlen(filename) + len + 2 ))) - return (HINSTANCE)ERROR_NOT_ENOUGH_MEMORY; + return ERROR_NOT_ENOUGH_MEMORY; strcpy( cmdline, filename ); p = cmdline + strlen(cmdline); @@ -2337,19 +2337,19 @@ HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) /* Give 30 seconds to the app to come up */ if (wait_input_idle( info.hProcess, 30000 ) == WAIT_FAILED) WARN("WaitForInputIdle failed: Error %d\n", GetLastError() ); - hInstance = (HINSTANCE)33; + ret = 33; /* Close off the handles */ CloseHandle( info.hThread ); CloseHandle( info.hProcess ); } - else if ((hInstance = ULongToHandle(GetLastError())) >= (HINSTANCE)32) + else if ((ret = GetLastError()) >= 32) { - FIXME("Strange error set by CreateProcess: %p\n", hInstance ); - hInstance = (HINSTANCE)11; + FIXME("Strange error set by CreateProcess: %u\n", ret ); + ret = 11; } HeapFree( GetProcessHeap(), 0, cmdline ); - return hInstance; + return ret; } diff --git a/include/winbase.h b/include/winbase.h index 05f3a2a..a233a0a 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1887,7 +1887,7 @@ WINBASEAPI HMODULE WINAPI LoadLibraryW(LPCWSTR); WINBASEAPI HMODULE WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD); WINBASEAPI HMODULE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD); #define LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx) -WINBASEAPI HINSTANCE WINAPI LoadModule(LPCSTR,LPVOID); +WINBASEAPI DWORD WINAPI LoadModule(LPCSTR,LPVOID); WINBASEAPI HGLOBAL WINAPI LoadResource(HMODULE,HRSRC); WINBASEAPI HLOCAL WINAPI LocalAlloc(UINT,SIZE_T) __WINE_ALLOC_SIZE(2); WINBASEAPI SIZE_T WINAPI LocalCompact(UINT);
1
0
0
0
Andrew Nguyen : kernel32: Implement GetSystemRegistryQuota as a semi-stub.
by Alexandre Julliard
11 Oct '10
11 Oct '10
Module: wine Branch: master Commit: 43e99d6e0c5c34ea61b48a745ae1d0dc86ef9bd8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43e99d6e0c5c34ea61b48a745…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Mon Oct 11 05:16:16 2010 -0500 kernel32: Implement GetSystemRegistryQuota as a semi-stub. --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/kernel_main.c | 16 ++++++++++++++++ dlls/kernel32/tests/process.c | 31 +++++++++++++++++++++++++++++++ include/winbase.h | 1 + 4 files changed, 49 insertions(+), 1 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index e4ce77e..8381ae8 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -630,7 +630,7 @@ @ stdcall GetSystemDirectoryW(ptr long) @ stdcall GetSystemInfo(ptr) @ stdcall GetSystemPowerStatus(ptr) -# @ stub GetSystemRegistryQuota +@ stdcall GetSystemRegistryQuota(ptr ptr) @ stdcall GetSystemTime(ptr) @ stdcall GetSystemTimeAdjustment(ptr ptr ptr) @ stdcall GetSystemTimeAsFileTime(ptr) diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c index 42d038e..8bdd1d3 100644 --- a/dlls/kernel32/kernel_main.c +++ b/dlls/kernel32/kernel_main.c @@ -207,3 +207,19 @@ DWORD WINAPI GetTickCount(void) { return GetTickCount64(); } + +/****************************************************************************** + * GetSystemRegistryQuota (KERNEL32.@) + */ +BOOL WINAPI GetSystemRegistryQuota(PDWORD pdwQuotaAllowed, PDWORD pdwQuotaUsed) +{ + FIXME("(%p, %p) faking reported quota values\n", pdwQuotaAllowed, pdwQuotaUsed); + + if (pdwQuotaAllowed) + *pdwQuotaAllowed = 2 * 1000 * 1000 * 1000; /* 2 GB */ + + if (pdwQuotaUsed) + *pdwQuotaUsed = 100 * 1000 * 1000; /* 100 MB */ + + return TRUE; +} diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 77a303c..76cc3ed 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -56,6 +56,7 @@ static HINSTANCE hkernel32; static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO); +static BOOL (WINAPI *pGetSystemRegistryQuota)(PDWORD, PDWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL); static LPVOID (WINAPI *pVirtualAllocEx)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD); static BOOL (WINAPI *pVirtualFreeEx)(HANDLE, LPVOID, SIZE_T, DWORD); @@ -197,6 +198,7 @@ static int init(void) hkernel32 = GetModuleHandleA("kernel32"); pGetNativeSystemInfo = (void *) GetProcAddress(hkernel32, "GetNativeSystemInfo"); + pGetSystemRegistryQuota = (void *) GetProcAddress(hkernel32, "GetSystemRegistryQuota"); pIsWow64Process = (void *) GetProcAddress(hkernel32, "IsWow64Process"); pVirtualAllocEx = (void *) GetProcAddress(hkernel32, "VirtualAllocEx"); pVirtualFreeEx = (void *) GetProcAddress(hkernel32, "VirtualFreeEx"); @@ -1831,6 +1833,34 @@ static void test_SystemInfo(void) } } +static void test_RegistryQuota(void) +{ + BOOL ret; + DWORD max_quota, used_quota; + + if (!pGetSystemRegistryQuota) + { + win_skip("GetSystemRegistryQuota is not available\n"); + return; + } + + ret = pGetSystemRegistryQuota(NULL, NULL); + ok(ret == TRUE, + "Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret); + + ret = pGetSystemRegistryQuota(&max_quota, NULL); + ok(ret == TRUE, + "Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret); + + ret = pGetSystemRegistryQuota(NULL, &used_quota); + ok(ret == TRUE, + "Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret); + + ret = pGetSystemRegistryQuota(&max_quota, &used_quota); + ok(ret == TRUE, + "Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret); +} + START_TEST(process) { int b = init(); @@ -1856,6 +1886,7 @@ START_TEST(process) test_ProcessName(); test_Handles(); test_SystemInfo(); + test_RegistryQuota(); /* things that can be tested: * lookup: check the way program to be executed is searched * handles: check the handle inheritance stuff (+sec options) diff --git a/include/winbase.h b/include/winbase.h index 24f6f33..05f3a2a 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1755,6 +1755,7 @@ WINBASEAPI UINT WINAPI GetSystemDirectoryW(LPWSTR,UINT); #define GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory) WINBASEAPI VOID WINAPI GetSystemInfo(LPSYSTEM_INFO); WINBASEAPI BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS); +WINBASEAPI BOOL WINAPI GetSystemRegistryQuota(PDWORD,PDWORD); WINBASEAPI VOID WINAPI GetSystemTime(LPSYSTEMTIME); WINBASEAPI BOOL WINAPI GetSystemTimeAdjustment(PDWORD,PDWORD,PBOOL); WINBASEAPI VOID WINAPI GetSystemTimeAsFileTime(LPFILETIME);
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
118
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200