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
January 2009
----- 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
30 participants
755 discussions
Start a n
N
ew thread
[sginsberg] 38922: - Fix more InterlockedCompareExchangePointer warnings in crypt32 -- this to Wine, too - Hack-0-initialize a variable in cryptui to satisfy gcc -- this needed as Wine use a less retarded gcc than we do - Warning fix old and out of sync icmp/inetcomm/odbc32/shdocw - Use _CRT_NONSTDC_NO_DEPRECATE in winhlp32 - Hack MAKEINTATOM definition for Wine
by sginsberg@svn.reactos.org
Author: sginsberg Date: Sun Jan 18 17:31:26 2009 New Revision: 38922 URL:
http://svn.reactos.org/svn/reactos?rev=38922&view=rev
Log: - Fix more InterlockedCompareExchangePointer warnings in crypt32 -- this to Wine, too - Hack-0-initialize a variable in cryptui to satisfy gcc -- this needed as Wine use a less retarded gcc than we do - Warning fix old and out of sync icmp/inetcomm/odbc32/shdocw - Use _CRT_NONSTDC_NO_DEPRECATE in winhlp32 - Hack MAKEINTATOM definition for Wine Added: trunk/reactos/dll/win32/crypt32/warningfixes.diff Modified: trunk/reactos/base/applications/winhlp32/winhlp32.rbuild trunk/reactos/dll/win32/credui/credui.rbuild trunk/reactos/dll/win32/crypt32/chain.c trunk/reactos/dll/win32/crypt32/main.c trunk/reactos/dll/win32/crypt32/rootstore.c trunk/reactos/dll/win32/cryptui/main.c trunk/reactos/dll/win32/icmp/icmp.rbuild trunk/reactos/dll/win32/icmp/icmp_main.c trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild trunk/reactos/dll/win32/inetcomm/mimeintl.c trunk/reactos/dll/win32/odbc32/odbc32.rbuild trunk/reactos/dll/win32/odbc32/proxyodbc.c trunk/reactos/dll/win32/shdocvw/shdocvw.rbuild trunk/reactos/dll/win32/shdocvw/shdocvw_main.c trunk/reactos/include/psdk/winbase.h Modified: trunk/reactos/base/applications/winhlp32/winhlp32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhlp32…
============================================================================== --- trunk/reactos/base/applications/winhlp32/winhlp32.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/winhlp32/winhlp32.rbuild [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="winhlp32" type="win32gui" installbase="system32" installname="winhlp32.exe" unicode="no" allowwarnings="true"> +<module name="winhlp32" type="win32gui" installbase="system32" installname="winhlp32.exe" unicode="no"> <include base="winhlp32">.</include> <include base="ReactOS">include/reactos/wine</include> - <define name="__ROS_LONG64__" /> + <define name="__ROS_LONG64__" /> + <define name="_CRT_NONSTDC_NO_DEPRECATE" /> <library>wine</library> <library>comdlg32</library> <library>comctl32</library> Modified: trunk/reactos/dll/win32/credui/credui.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/credui/credui.rb…
============================================================================== --- trunk/reactos/dll/win32/credui/credui.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/credui/credui.rbuild [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -6,8 +6,6 @@ <include base="credui">.</include> <include base="ReactOS">include/reactos/wine</include> <define name="__WINESRC__" /> - <define name="WINVER">0x600</define> - <define name="_WIN32_WINNT">0x600</define> <file>credui_main.c</file> <file>credui.rc</file> <library>wine</library> Modified: trunk/reactos/dll/win32/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/chain.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -205,7 +205,7 @@ config.cbSize = sizeof(config); CertCreateCertificateChainEngine(&config, &engine); - InterlockedCompareExchangePointer(&CRYPT_defaultChainEngine, engine, + (void)InterlockedCompareExchangePointer(&CRYPT_defaultChainEngine, engine, NULL); if (CRYPT_defaultChainEngine != engine) CertFreeCertificateChainEngine(engine); Modified: trunk/reactos/dll/win32/crypt32/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/crypt32/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/main.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -66,7 +66,7 @@ CryptAcquireContextW(&prov, NULL, MS_ENHANCED_PROV_W, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - InterlockedCompareExchangePointer((PVOID *)&hDefProv, (PVOID)prov, + (void)InterlockedCompareExchangePointer((PVOID *)&hDefProv, (PVOID)prov, NULL); if (hDefProv != prov) CryptReleaseContext(prov, 0); Modified: trunk/reactos/dll/win32/crypt32/rootstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/rootstor…
============================================================================== --- trunk/reactos/dll/win32/crypt32/rootstore.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/rootstore.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -759,7 +759,7 @@ { HCERTSTORE root = create_root_store(); - InterlockedCompareExchangePointer((PVOID *)&CRYPT_rootStore, root, + (void)InterlockedCompareExchangePointer((PVOID *)&CRYPT_rootStore, root, NULL); if (CRYPT_rootStore != root) CertCloseStore(root, 0); Added: trunk/reactos/dll/win32/crypt32/warningfixes.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/warningf…
============================================================================== --- trunk/reactos/dll/win32/crypt32/warningfixes.diff (added) +++ trunk/reactos/dll/win32/crypt32/warningfixes.diff [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1,0 +1,39 @@ +Index: chain.c +=================================================================== +--- chain.c (revision 38919) ++++ chain.c (working copy) +@@ -205,7 +205,7 @@ + + config.cbSize = sizeof(config); + CertCreateCertificateChainEngine(&config, &engine); +- InterlockedCompareExchangePointer(&CRYPT_defaultChainEngine, engine, ++ (void)InterlockedCompareExchangePointer(&CRYPT_defaultChainEngine, engine, + NULL); + if (CRYPT_defaultChainEngine != engine) + CertFreeCertificateChainEngine(engine); +Index: main.c +=================================================================== +--- main.c (revision 38919) ++++ main.c (working copy) +@@ -66,7 +66,7 @@ + + CryptAcquireContextW(&prov, NULL, MS_ENHANCED_PROV_W, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT); +- InterlockedCompareExchangePointer((PVOID *)&hDefProv, (PVOID)prov, ++ (void)InterlockedCompareExchangePointer((PVOID *)&hDefProv, (PVOID)prov, + NULL); + if (hDefProv != prov) + CryptReleaseContext(prov, 0); +Index: rootstore.c +=================================================================== +--- rootstore.c (revision 38919) ++++ rootstore.c (working copy) +@@ -759,7 +759,7 @@ + { + HCERTSTORE root = create_root_store(); + +- InterlockedCompareExchangePointer((PVOID *)&CRYPT_rootStore, root, ++ (void)InterlockedCompareExchangePointer((PVOID *)&CRYPT_rootStore, root, + NULL); + if (CRYPT_rootStore != root) + CertCloseStore(root, 0); Modified: trunk/reactos/dll/win32/cryptui/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptui/main.c?r…
============================================================================== --- trunk/reactos/dll/win32/cryptui/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/cryptui/main.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -3277,6 +3277,9 @@ LVCOLUMNW column; PurposeSelection purposeSelection; + /* hack for retarded gcc */ + purposeSelection = 0; + GetWindowRect(lv, &rc); column.mask = LVCF_WIDTH; column.cx = rc.right - rc.left; Modified: trunk/reactos/dll/win32/icmp/icmp.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/icmp/icmp.rbuild…
============================================================================== --- trunk/reactos/dll/win32/icmp/icmp.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/icmp/icmp.rbuild [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1,4 +1,4 @@ -<module name="icmp" type="win32dll" baseaddress="${BASEADDRESS_ICMP}" installbase="system32" installname="icmp.dll" allowwarnings="true"> +<module name="icmp" type="win32dll" baseaddress="${BASEADDRESS_ICMP}" installbase="system32" installname="icmp.dll"> <importlibrary definition="icmp.spec" /> <include base="icmp">.</include> <include base="ReactOS">include/reactos/wine</include> Modified: trunk/reactos/dll/win32/icmp/icmp_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/icmp/icmp_main.c…
============================================================================== --- trunk/reactos/dll/win32/icmp/icmp_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/icmp/icmp_main.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -273,7 +273,7 @@ if (RequestOptions!=NULL) { int val; if (icp->default_opts.OptionsSize==IP_OPTS_UNKNOWN) { - unsigned int len; + int len; /* Before we mess with the options, get the default values */ len=sizeof(val); getsockopt(icp->sid,IPPROTO_IP,IP_TTL,(char *)&val,&len); @@ -332,7 +332,7 @@ #endif send_time = GetTickCount(); - res=sendto(icp->sid, reqbuf, reqsize, 0, (struct sockaddr*)&addr, sizeof(addr)); + res=sendto(icp->sid, (const char*)reqbuf, reqsize, 0, (struct sockaddr*)&addr, sizeof(addr)); HeapFree(GetProcessHeap (), 0, reqbuf); if (res<0) { if (WSAGetLastError()==WSAEMSGSIZE) @@ -357,7 +357,7 @@ ip_header_len=0; /* because gcc was complaining */ while ((res=select(icp->sid+1,&fdr,NULL,NULL,&timeout))>0) { recv_time = GetTickCount(); - res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,&addrlen); + res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,(int*)&addrlen); TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr)); ier->Status=IP_REQ_TIMED_OUT; Modified: trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <group> -<module name="inetcomm" type="win32dll" baseaddress="${BASEADDRESS_INETCOMM}" installbase="system32" installname="inetcomm.dll" allowwarnings="true"> +<module name="inetcomm" type="win32dll" baseaddress="${BASEADDRESS_INETCOMM}" installbase="system32" installname="inetcomm.dll"> <autoregister infsection="OleControlDlls" type="DllRegisterServer" /> <importlibrary definition="inetcomm.spec" /> <include base="inetcomm">.</include> Modified: trunk/reactos/dll/win32/inetcomm/mimeintl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeint…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/mimeintl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/mimeintl.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -119,7 +119,7 @@ if(hCharset == NULL) return E_INVALIDARG; /* FIXME check hCharset is valid */ - InterlockedExchangePointer(&This->default_charset, hCharset); + (void)InterlockedExchangePointer(&This->default_charset, hCharset); return S_OK; } @@ -136,7 +136,7 @@ HCHARSET hcs; hr = IMimeInternational_GetCodePageCharset(iface, GetACP(), CHARSET_BODY, &hcs); if(SUCCEEDED(hr)) - InterlockedCompareExchangePointer(&This->default_charset, hcs, NULL); + (void)InterlockedCompareExchangePointer(&This->default_charset, hcs, NULL); } *phCharset = This->default_charset; Modified: trunk/reactos/dll/win32/odbc32/odbc32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/odbc32.rb…
============================================================================== --- trunk/reactos/dll/win32/odbc32/odbc32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/odbc32/odbc32.rbuild [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <group> -<module name="odbc32" type="win32dll" baseaddress="${BASEADDRESS_ODBC32}" installbase="system32" installname="odbc32.dll" allowwarnings="true" crt="msvcrt"> +<module name="odbc32" type="win32dll" baseaddress="${BASEADDRESS_ODBC32}" installbase="system32" installname="odbc32.dll" crt="msvcrt"> <importlibrary definition="odbc32.spec" /> <include base="odbc32">.</include> <include base="ReactOS">include/reactos/wine</include> Modified: trunk/reactos/dll/win32/odbc32/proxyodbc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/proxyodbc…
============================================================================== --- trunk/reactos/dll/win32/odbc32/proxyodbc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/odbc32/proxyodbc.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -38,6 +38,8 @@ #include "winbase.h" #include "wine/debug.h" //#include "wine/library.h" + +#undef TRACE_ON #include "sql.h" #include "sqltypes.h" @@ -221,7 +223,9 @@ static BOOL ODBC_LoadDriverManager(void) { const char *s = getenv("LIB_ODBC_DRIVER_MANAGER"); +#ifndef __REACTOS__ char error[256]; +#endif TRACE("\n"); @@ -269,8 +273,10 @@ static BOOL ODBC_LoadDMFunctions(void) { +#ifndef __REACTOS__ int i; char error[256]; +#endif if (gProxyHandle.dmHandle == NULL) return FALSE; @@ -554,8 +560,8 @@ CHECK_READY_AND_dmHandle(); - strcpy(gProxyHandle.ServerName, ServerName); - strcpy(gProxyHandle.UserName, UserName); + strcpy(gProxyHandle.ServerName, (const char*)ServerName); + strcpy(gProxyHandle.UserName, (const char*)UserName); assert(gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].func); ret=(gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].func) @@ -606,9 +612,7 @@ (EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, BufferLength2, NameLength2); -#ifndef __REACTOS__ - if (TRACE_ON(odbc)) -#endif + if (WINE_TRACE_ON(odbc)) { TRACE("returns: %d \t", ret); if (*NameLength1 > 0) Modified: trunk/reactos/dll/win32/shdocvw/shdocvw.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw.…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/shdocvw.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/shdocvw.rbuild [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1,4 +1,4 @@ -<module name="shdocvw" type="win32dll" baseaddress="${BASEADDRESS_SHDOCVW}" installbase="system32" installname="shdocvw.dll" allowwarnings="true"> +<module name="shdocvw" type="win32dll" baseaddress="${BASEADDRESS_SHDOCVW}" installbase="system32" installname="shdocvw.dll"> <autoregister infsection="OleControlDlls" type="Both" /> <importlibrary definition="shdocvw.spec" /> <include base="shdocvw">.</include> Modified: trunk/reactos/dll/win32/shdocvw/shdocvw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw_…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/shdocvw_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/shdocvw_main.c [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -69,7 +69,7 @@ { char str[40]; - sprintf(str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + sprintf(str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); Modified: trunk/reactos/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Sun Jan 18 17:31:26 2009 @@ -1090,7 +1090,13 @@ #if (_WIN32_WINNT >= 0x0600) typedef DWORD (WINAPI *APPLICATION_RECOVERY_CALLBACK)(PVOID); #endif + +#ifdef WINE_NO_UNICODE_MACROS /* force using a cast */ +#define MAKEINTATOM(atom) ((ULONG_PTR)((WORD)(atom))) +#else #define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i))) +#endif + /* Functions */ #ifndef UNDER_CE int APIENTRY WinMain(HINSTANCE,HINSTANCE,LPSTR,int);
15 years, 11 months
1
0
0
0
[tkreuzer] 38921: ok, better test changes before comitting them ; -)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Jan 18 16:35:17 2009 New Revision: 38921 URL:
http://svn.reactos.org/svn/reactos?rev=38921&view=rev
Log: ok, better test changes before comitting them ;-) Modified: branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h Modified: branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h [iso-8859-1] Sun Jan 18 16:35:17 2009 @@ -220,7 +220,7 @@ // // DBGKD Structure for State Change // -#ifdef defined(_M_X86) +#if defined(_M_X86) typedef struct _DBGKD_CONTROL_REPORT {
15 years, 11 months
1
0
0
0
[tkreuzer] 38920: Tracing the data exchanged between Windows64 and WinDbg shows that DBGKD_CONTROL_REPORT is a bit different to x86 version.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Jan 18 15:55:59 2009 New Revision: 38920 URL:
http://svn.reactos.org/svn/reactos?rev=38920&view=rev
Log: Tracing the data exchanged between Windows64 and WinDbg shows that DBGKD_CONTROL_REPORT is a bit different to x86 version. Modified: branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h Modified: branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/reactos/windbgkd.h [iso-8859-1] Sun Jan 18 15:55:59 2009 @@ -200,7 +200,13 @@ } DBGKD_ANY_CONTROL_SET, *PDBGKD_ANY_CONTROL_SET; #include <poppack.h> +#if defined(_M_X86) typedef X86_DBGKD_CONTROL_SET DBGKD_CONTROL_SET; +#elif defined(_M_AMD64) +typedef AMD64_DBGKD_CONTROL_SET DBGKD_CONTROL_SET; +#else +#error unsupported architecture +#endif // // DBGKM Structure for Exceptions @@ -214,6 +220,8 @@ // // DBGKD Structure for State Change // +#ifdef defined(_M_X86) + typedef struct _DBGKD_CONTROL_REPORT { ULONG Dr6; @@ -227,6 +235,24 @@ USHORT SegFs; ULONG EFlags; } DBGKD_CONTROL_REPORT, *PDBGKD_CONTROL_REPORT; + +#elif defined(_M_AMD64) + +typedef struct _DBGKD_CONTROL_REPORT +{ + ULONG64 Dr6; + ULONG64 Dr7; + ULONG EFlags; + USHORT InstructionCount; + USHORT ReportFlags; + UCHAR InstructionStream[DBGKD_MAXSTREAM]; + USHORT SegCs; + USHORT SegDs; + USHORT SegEs; + USHORT SegFs; +} DBGKD_CONTROL_REPORT, *PDBGKD_CONTROL_REPORT; + +#endif // // DBGKD Structure for Debug I/O Type Print String
15 years, 11 months
1
0
0
0
[mkupfer] 38919: Maciej Bialas <bjauy AT tlen DOT pl> - Polish translation of recently added resource strings
by mkupfer@svn.reactos.org
Author: mkupfer Date: Sun Jan 18 15:40:12 2009 New Revision: 38919 URL:
http://svn.reactos.org/svn/reactos?rev=38919&view=rev
Log: Maciej Bialas <bjauy AT tlen DOT pl> - Polish translation of recently added resource strings Modified: trunk/reactos/dll/cpl/desk/lang/pl-PL.rc Modified: trunk/reactos/dll/cpl/desk/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/pl-PL.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/pl-PL.rc [iso-8859-1] Sun Jan 18 15:40:12 2009 @@ -232,7 +232,7 @@ STRINGTABLE DISCARDABLE BEGIN - IDS_DISPLAY_SETTINGS "Display settings" - IDS_APPLY_FAILED "Failed to apply new settings..." - IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." -END + IDS_DISPLAY_SETTINGS "Ustawienia ekranu" + IDS_APPLY_FAILED "Nie uda³o siê zastosowaæ nowych ustawieñ..." + IDS_APPLY_NEEDS_RESTART "Musisz ponownie uruchomiæ komputer aby zastosowaæ zmiany." +END
15 years, 11 months
1
0
0
0
[sginsberg] 38918: - Remove outdated msvcrt Winetest compilation hack, add _CRT_NONSTDC_NO_DEPRECATE to silence the 'unlink' warnings
by sginsberg@svn.reactos.org
Author: sginsberg Date: Sun Jan 18 15:35:18 2009 New Revision: 38918 URL:
http://svn.reactos.org/svn/reactos?rev=38918&view=rev
Log: - Remove outdated msvcrt Winetest compilation hack, add _CRT_NONSTDC_NO_DEPRECATE to silence the 'unlink' warnings Modified: trunk/rostests/winetests/msvcrt/msvcrt.rbuild trunk/rostests/winetests/msvcrt/string.c Modified: trunk/rostests/winetests/msvcrt/msvcrt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msvcrt/msvcrt.r…
============================================================================== --- trunk/rostests/winetests/msvcrt/msvcrt.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/msvcrt/msvcrt.rbuild [iso-8859-1] Sun Jan 18 15:35:18 2009 @@ -7,6 +7,7 @@ <include base="msvcrt">include/reactos/wine/msvcrt</include> <define name="__USE_W32API" /> <define name="__ROS_LONG64__" /> + <define name="_CRT_NONSTDC_NO_DEPRECATE" /> <library>kernel32</library> <library>msvcrt</library> <file>cpp.c</file> Modified: trunk/rostests/winetests/msvcrt/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msvcrt/string.c…
============================================================================== --- trunk/rostests/winetests/msvcrt/string.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msvcrt/string.c [iso-8859-1] Sun Jan 18 15:35:18 2009 @@ -28,8 +28,6 @@ #include <locale.h> #include <errno.h> -size_t _mbstrlen(const char*); - static char *buf_to_string(const unsigned char *bin, int len, int nr) { static char buf[2][1024];
15 years, 11 months
1
0
0
0
[mkupfer] 38917: Add new resource strings for translation.
by mkupfer@svn.reactos.org
Author: mkupfer Date: Sun Jan 18 15:21:09 2009 New Revision: 38917 URL:
http://svn.reactos.org/svn/reactos?rev=38917&view=rev
Log: Add new resource strings for translation. Modified: trunk/reactos/dll/cpl/desk/lang/bg-BG.rc trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc trunk/reactos/dll/cpl/desk/lang/el-GR.rc trunk/reactos/dll/cpl/desk/lang/es-ES.rc trunk/reactos/dll/cpl/desk/lang/fr-FR.rc trunk/reactos/dll/cpl/desk/lang/hu-HU.rc trunk/reactos/dll/cpl/desk/lang/id-ID.rc trunk/reactos/dll/cpl/desk/lang/it-IT.rc trunk/reactos/dll/cpl/desk/lang/ja-JP.rc trunk/reactos/dll/cpl/desk/lang/nl-NL.rc trunk/reactos/dll/cpl/desk/lang/no-NO.rc trunk/reactos/dll/cpl/desk/lang/pl-PL.rc trunk/reactos/dll/cpl/desk/lang/ru-RU.rc trunk/reactos/dll/cpl/desk/lang/sk-SK.rc trunk/reactos/dll/cpl/desk/lang/sv-SE.rc trunk/reactos/dll/cpl/desk/lang/uk-UA.rc trunk/reactos/dll/cpl/desk/lang/zh-CN.rc Modified: trunk/reactos/dll/cpl/desk/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/bg-BG.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/bg-BG.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -223,3 +223,10 @@ IDS_ELEMENT_21 "Áúðçè ñâåäåíèÿ" IDS_ELEMENT_22 "Ñèìâîë" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/cs-CZ.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -226,3 +226,10 @@ IDS_ELEMENT_21 "Popis tlaèítek" IDS_ELEMENT_22 "Ikona" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/el-GR.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/el-GR.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -219,3 +219,10 @@ IDS_ELEMENT_21 "ÃñÞãïñç åðåîÞãçóç" IDS_ELEMENT_22 "Åéêïíßäéï" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/es-ES.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/es-ES.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -227,3 +227,10 @@ IDS_ELEMENT_21 "Barra de estado" IDS_ELEMENT_22 "Icono" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/fr-FR.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/fr-FR.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -222,3 +222,10 @@ IDS_ELEMENT_21 "Info rapide" IDS_ELEMENT_22 "Symbole" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/hu-HU.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/hu-HU.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -220,3 +220,10 @@ IDS_ELEMENT_21 "Quickinfo" IDS_ELEMENT_22 "Symbol" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/id-ID.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/id-ID.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/id-ID.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -219,3 +219,10 @@ IDS_ELEMENT_21 "InfoCepat" IDS_ELEMENT_22 "Simbol" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/it-IT.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/it-IT.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -219,3 +219,10 @@ IDS_ELEMENT_21 "Informazioni rapide" IDS_ELEMENT_22 "Simbolo" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/ja-JP.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/ja-JP.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -219,3 +219,10 @@ IDS_ELEMENT_21 "Quickinfo" IDS_ELEMENT_22 "Symbol" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/nl-NL.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/nl-NL.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -221,3 +221,10 @@ IDS_ELEMENT_21 "Quickinfo" IDS_ELEMENT_22 "Symbool" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/no-NO.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/no-NO.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -221,3 +221,10 @@ IDS_ELEMENT_21 "Quickinfo" IDS_ELEMENT_22 "Symbol" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/pl-PL.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/pl-PL.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -229,3 +229,10 @@ IDS_ELEMENT_21 "Etykieta narzêdzia" IDS_ELEMENT_22 "Ikona" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/ru-RU.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/ru-RU.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -219,3 +219,10 @@ IDS_ELEMENT_21 "Âñïëûâàþùàÿ ïîäñêàçêà" IDS_ELEMENT_22 "Çíà÷îê" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/sk-SK.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/sk-SK.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -229,3 +229,10 @@ IDS_ELEMENT_21 "Popis tlaèidiel" IDS_ELEMENT_22 "Ikona" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/sv-SE.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/sv-SE.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -222,3 +222,10 @@ IDS_ELEMENT_21 "Quickinfo" IDS_ELEMENT_22 "Symbol" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/uk-UA.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/uk-UA.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -227,3 +227,10 @@ IDS_ELEMENT_21 "Âèðèíàþ÷à ï³äêàçêà" IDS_ELEMENT_22 "Çíà÷îê" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END Modified: trunk/reactos/dll/cpl/desk/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/lang/zh-CN.rc…
============================================================================== --- trunk/reactos/dll/cpl/desk/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/lang/zh-CN.rc [iso-8859-1] Sun Jan 18 15:21:09 2009 @@ -227,3 +227,10 @@ IDS_ELEMENT_21 "¹¤¾ßÌáʾ" IDS_ELEMENT_22 "ͼ±ê" END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DISPLAY_SETTINGS "Display settings" + IDS_APPLY_FAILED "Failed to apply new settings..." + IDS_APPLY_NEEDS_RESTART "You need to restart your computer to apply changes." +END
15 years, 11 months
1
0
0
0
[khornicek] 38916: - sync d3d9 with wine HEAD
by khornicek@svn.reactos.org
Author: khornicek Date: Sun Jan 18 15:11:53 2009 New Revision: 38916 URL:
http://svn.reactos.org/svn/reactos?rev=38916&view=rev
Log: - sync d3d9 with wine HEAD Modified: trunk/reactos/dll/directx/wine/d3d9/cubetexture.c trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h trunk/reactos/dll/directx/wine/d3d9/device.c trunk/reactos/dll/directx/wine/d3d9/directx.c trunk/reactos/dll/directx/wine/d3d9/pixelshader.c trunk/reactos/dll/directx/wine/d3d9/query.c trunk/reactos/dll/directx/wine/d3d9/stateblock.c trunk/reactos/dll/directx/wine/d3d9/surface.c trunk/reactos/dll/directx/wine/d3d9/swapchain.c trunk/reactos/dll/directx/wine/d3d9/texture.c trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c trunk/reactos/dll/directx/wine/d3d9/vertexshader.c trunk/reactos/dll/directx/wine/d3d9/volume.c trunk/reactos/dll/directx/wine/d3d9/volumetexture.c Modified: trunk/reactos/dll/directx/wine/d3d9/cubetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/cube…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/cubetexture.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/cubetexture.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -348,21 +348,20 @@ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (NULL == object) { - FIXME("(%p) allocation of CubeTexture failed\n", This); + ERR("(%p) allocation of CubeTexture failed\n", This); return D3DERR_OUTOFVIDEOMEMORY; } object->lpVtbl = &Direct3DCubeTexture9_Vtbl; object->ref = 1; EnterCriticalSection(&d3d9_cs); hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage, - (WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DCubeTexture, pSharedHandle, (IUnknown*)object, - D3D9CB_CreateSurface); + Format, Pool, &object->wineD3DCubeTexture, pSharedHandle, (IUnknown*)object); LeaveCriticalSection(&d3d9_cs); if (hr != D3D_OK){ /* free up object */ - FIXME("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This); + WARN("(%p) call to IWineD3DDevice_CreateCubeTexture failed\n", This); HeapFree(GetProcessHeap(), 0, object); } else { IDirect3DDevice9Ex_AddRef(iface); Modified: trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/d3d9…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -167,6 +167,7 @@ * Predeclare the interface implementation structures */ extern const IDirect3DDevice9ExVtbl Direct3DDevice9_Vtbl; +extern const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl; /***************************************************************************** * IDirect3DDevice9 implementation structure @@ -175,6 +176,7 @@ { /* IUnknown fields */ const IDirect3DDevice9ExVtbl *lpVtbl; + const IWineD3DDeviceParentVtbl *device_parent_vtbl; LONG ref; /* IDirect3DDevice9 fields */ @@ -233,6 +235,7 @@ /***************************************************************************** * IDirect3DVolume9 implementation structure */ +extern const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl; typedef struct IDirect3DVolume9Impl { /* IUnknown fields */ @@ -551,34 +554,10 @@ /* Callbacks */ -extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - WINED3DCUBEMAP_FACES Face, IWineD3DSurface** ppSurface, - HANDLE* pSharedHandle); - -extern HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth, - WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage, - IWineD3DVolume **ppVolume, - HANDLE * pSharedHandle); - -extern HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Discard, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle); - -extern HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Lockable, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle); - extern ULONG WINAPI D3D9CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain); - extern ULONG WINAPI D3D9CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface); - extern ULONG WINAPI D3D9CB_DestroyRenderTarget (IWineD3DSurface *pSurface); - extern ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface); - extern ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume); #endif /* __WINE_D3D9_PRIVATE_H */ Modified: trunk/reactos/dll/directx/wine/d3d9/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/devi…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/device.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -59,6 +59,13 @@ } } + if (IsEqualGUID(riid, &IID_IWineD3DDeviceParent)) + { + IUnknown_AddRef((IUnknown *)&This->device_parent_vtbl); + *ppobj = &This->device_parent_vtbl; + return S_OK; + } + WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj); *ppobj = NULL; return E_NOINTERFACE; @@ -1008,13 +1015,50 @@ return hr; } +static const WINED3DTEXTURESTAGESTATETYPE tss_lookup[] = +{ + WINED3DTSS_FORCE_DWORD, /* 0, unused */ + WINED3DTSS_COLOROP, /* 1, D3DTSS_COLOROP */ + WINED3DTSS_COLORARG1, /* 2, D3DTSS_COLORARG1 */ + WINED3DTSS_COLORARG2, /* 3, D3DTSS_COLORARG2 */ + WINED3DTSS_ALPHAOP, /* 4, D3DTSS_ALPHAOP */ + WINED3DTSS_ALPHAARG1, /* 5, D3DTSS_ALPHAARG1 */ + WINED3DTSS_ALPHAARG2, /* 6, D3DTSS_ALPHAARG2 */ + WINED3DTSS_BUMPENVMAT00, /* 7, D3DTSS_BUMPENVMAT00 */ + WINED3DTSS_BUMPENVMAT01, /* 8, D3DTSS_BUMPENVMAT01 */ + WINED3DTSS_BUMPENVMAT10, /* 9, D3DTSS_BUMPENVMAT10 */ + WINED3DTSS_BUMPENVMAT11, /* 10, D3DTSS_BUMPENVMAT11 */ + WINED3DTSS_TEXCOORDINDEX, /* 11, D3DTSS_TEXCOORDINDEX */ + WINED3DTSS_FORCE_DWORD, /* 12, unused */ + WINED3DTSS_FORCE_DWORD, /* 13, unused */ + WINED3DTSS_FORCE_DWORD, /* 14, unused */ + WINED3DTSS_FORCE_DWORD, /* 15, unused */ + WINED3DTSS_FORCE_DWORD, /* 16, unused */ + WINED3DTSS_FORCE_DWORD, /* 17, unused */ + WINED3DTSS_FORCE_DWORD, /* 18, unused */ + WINED3DTSS_FORCE_DWORD, /* 19, unused */ + WINED3DTSS_FORCE_DWORD, /* 20, unused */ + WINED3DTSS_FORCE_DWORD, /* 21, unused */ + WINED3DTSS_BUMPENVLSCALE, /* 22, D3DTSS_BUMPENVLSCALE */ + WINED3DTSS_BUMPENVLOFFSET, /* 23, D3DTSS_BUMPENVLOFFSET */ + WINED3DTSS_TEXTURETRANSFORMFLAGS, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */ + WINED3DTSS_FORCE_DWORD, /* 25, unused */ + WINED3DTSS_COLORARG0, /* 26, D3DTSS_COLORARG0 */ + WINED3DTSS_ALPHAARG0, /* 27, D3DTSS_ALPHAARG0 */ + WINED3DTSS_RESULTARG, /* 28, D3DTSS_RESULTARG */ + WINED3DTSS_FORCE_DWORD, /* 29, unused */ + WINED3DTSS_FORCE_DWORD, /* 30, unused */ + WINED3DTSS_FORCE_DWORD, /* 31, unused */ + WINED3DTSS_CONSTANT, /* 32, D3DTSS_CONSTANT */ +}; + static HRESULT WINAPI IDirect3DDevice9Impl_GetTextureStageState(LPDIRECT3DDEVICE9EX iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); EnterCriticalSection(&d3d9_cs); - hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, Type, pValue); + hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, tss_lookup[Type], pValue); LeaveCriticalSection(&d3d9_cs); return hr; } @@ -1025,7 +1069,7 @@ TRACE("(%p) Relay\n" , This); EnterCriticalSection(&d3d9_cs); - hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, Type, Value); + hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, tss_lookup[Type], Value); LeaveCriticalSection(&d3d9_cs); return hr; } @@ -1314,7 +1358,6 @@ return hr; } } - hr = IWineD3DDevice_SetFVF(This->WineD3DDevice, FVF); LeaveCriticalSection(&d3d9_cs); return hr; @@ -1322,12 +1365,30 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWORD* pFVF) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; - HRESULT hr; - TRACE("(%p) Relay\n" , This); - - EnterCriticalSection(&d3d9_cs); - hr = IWineD3DDevice_GetFVF(This->WineD3DDevice, pFVF); - LeaveCriticalSection(&d3d9_cs); + IDirect3DVertexDeclaration9 *decl; + HRESULT hr; + TRACE("(%p) Relay\n" , This); + + hr = IDirect3DDevice9_GetVertexDeclaration(iface, &decl); + if (FAILED(hr)) + { + WARN("Failed to get vertex declaration, %#x\n", hr); + *pFVF = 0; + return hr; + } + + if (decl) + { + *pFVF = ((IDirect3DVertexDeclaration9Impl *)decl)->convFVF; + IDirect3DVertexDeclaration9_Release(decl); + } + else + { + *pFVF = 0; + } + + TRACE("Returning FVF %#x\n", *pFVF); + return hr; } @@ -1694,37 +1755,6 @@ IDirect3DDevice9ExImpl_GetDisplayModeEx }; - -/* Internal function called back during the CreateDevice to create a render target */ -HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - WINED3DCUBEMAP_FACES Face,IWineD3DSurface** ppSurface, - HANDLE* pSharedHandle) { - - HRESULT res = D3D_OK; - IDirect3DSurface9Impl *d3dSurface = NULL; - BOOL Lockable = TRUE; - - if((Pool == D3DPOOL_DEFAULT && Usage != D3DUSAGE_DYNAMIC)) - Lockable = FALSE; - - TRACE("relay\n"); - res = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)device, Width, Height, (D3DFORMAT)Format, - Lockable, FALSE/*Discard*/, Level, (IDirect3DSurface9 **)&d3dSurface, D3DRTYPE_SURFACE, - Usage, (D3DPOOL) Pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */, pSharedHandle); - - if (SUCCEEDED(res)) { - *ppSurface = d3dSurface->wineD3DSurface; - d3dSurface->container = pSuperior; - IDirect3DDevice9Ex_Release(d3dSurface->parentDevice); - d3dSurface->parentDevice = NULL; - d3dSurface->forwardReference = pSuperior; - } else { - FIXME("(%p) IDirect3DDevice9_CreateSurface failed\n", device); - } - return res; -} - ULONG WINAPI D3D9CB_DestroySurface(IWineD3DSurface *pSurface) { IDirect3DSurface9Impl* surfaceParent; TRACE("(%p) call back\n", pSurface); @@ -1735,3 +1765,236 @@ surfaceParent->forwardReference = NULL; return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent); } + +/* IWineD3DDeviceParent IUnknown methods */ + +static inline struct IDirect3DDevice9Impl *device_from_device_parent(IWineD3DDeviceParent *iface) +{ + return (struct IDirect3DDevice9Impl *)((char*)iface + - FIELD_OFFSET(struct IDirect3DDevice9Impl, device_parent_vtbl)); +} + +static HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent *iface, REFIID riid, void **object) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + return IDirect3DDevice9Impl_QueryInterface((IDirect3DDevice9Ex *)This, riid, object); +} + +static ULONG STDMETHODCALLTYPE device_parent_AddRef(IWineD3DDeviceParent *iface) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + return IDirect3DDevice9Impl_AddRef((IDirect3DDevice9Ex *)This); +} + +static ULONG STDMETHODCALLTYPE device_parent_Release(IWineD3DDeviceParent *iface) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + return IDirect3DDevice9Impl_Release((IDirect3DDevice9Ex *)This); +} + +/* IWineD3DDeviceParent methods */ + +static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage, + WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + IDirect3DSurface9Impl *d3d_surface; + BOOL lockable = TRUE; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n" + "\tpool %#x, level %u, face %u, surface %p\n", + iface, superior, width, height, format, usage, pool, level, face, surface); + + if (pool == D3DPOOL_DEFAULT && !(usage & D3DUSAGE_DYNAMIC)) lockable = FALSE; + + hr = IDirect3DDevice9Impl_CreateSurface((IDirect3DDevice9Ex *)This, width, height, + format, lockable, FALSE /* Discard */, level, (IDirect3DSurface9 **)&d3d_surface, + D3DRTYPE_SURFACE, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */, NULL); + if (FAILED(hr)) + { + ERR("(%p) CreateSurface failed, returning %#x\n", iface, hr); + return hr; + } + + *surface = d3d_surface->wineD3DSurface; + d3d_surface->container = superior; + IDirect3DDevice9Ex_Release(d3d_surface->parentDevice); + d3d_surface->parentDevice = NULL; + d3d_surface->forwardReference = superior; + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type, + DWORD multisample_quality, BOOL lockable, IWineD3DSurface **surface) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + IDirect3DSurface9Impl *d3d_surface; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n" + "\tmultisample_quality %u, lockable %u, surface %p\n", + iface, superior, width, height, format, multisample_type, multisample_quality, lockable, surface); + + hr = IDirect3DDevice9Impl_CreateRenderTarget((IDirect3DDevice9Ex *)This, width, height, format, + multisample_type, multisample_quality, lockable, (IDirect3DSurface9 **)&d3d_surface, NULL); + if (FAILED(hr)) + { + ERR("(%p) CreateRenderTarget failed, returning %#x\n", iface, hr); + return hr; + } + + *surface = d3d_surface->wineD3DSurface; + d3d_surface->container = superior; + d3d_surface->isImplicit = TRUE; + /* Implicit surfaces are created with an refcount of 0 */ + IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface); + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type, + DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + IDirect3DSurface9Impl *d3d_surface; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n" + "\tmultisample_quality %u, discard %u, surface %p\n", + iface, superior, width, height, format, multisample_type, multisample_quality, discard, surface); + + hr = IDirect3DDevice9Impl_CreateDepthStencilSurface((IDirect3DDevice9Ex *)This, width, height, format, + multisample_type, multisample_quality, discard, (IDirect3DSurface9 **)&d3d_surface, NULL); + if (FAILED(hr)) + { + ERR("(%p) CreateDepthStencilSurface failed, returning %#x\n", iface, hr); + return hr; + } + + *surface = d3d_surface->wineD3DSurface; + d3d_surface->container = (IUnknown *)This; + d3d_surface->isImplicit = TRUE; + /* Implicit surfaces are created with an refcount of 0 */ + IDirect3DSurface9_Release((IDirect3DSurface9 *)d3d_surface); + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, UINT depth, WINED3DFORMAT format, + WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + IDirect3DVolume9Impl *object; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p\n", + iface, superior, width, height, depth, format, pool, usage, volume); + + /* Allocate the storage for the device */ + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + { + FIXME("Allocation of memory failed\n"); + *volume = NULL; + return D3DERR_OUTOFVIDEOMEMORY; + } + + object->lpVtbl = &Direct3DVolume9_Vtbl; + object->ref = 1; + hr = IWineD3DDevice_CreateVolume(This->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK, + format, pool, &object->wineD3DVolume, NULL, (IUnknown *)object); + if (FAILED(hr)) + { + ERR("(%p) CreateVolume failed, returning %#x\n", iface, hr); + HeapFree(GetProcessHeap(), 0, object); + *volume = NULL; + return hr; + } + + *volume = object->wineD3DVolume; + object->container = superior; + object->forwardReference = superior; + + TRACE("(%p) Created volume %p\n", iface, *volume); + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDeviceParent *iface, + WINED3DPRESENT_PARAMETERS *present_parameters, IWineD3DSwapChain **swapchain) +{ + struct IDirect3DDevice9Impl *This = device_from_device_parent(iface); + IDirect3DSwapChain9Impl *d3d_swapchain; + D3DPRESENT_PARAMETERS local_parameters; + HRESULT hr; + + TRACE("iface %p, present_parameters %p, swapchain %p\n", iface, present_parameters, swapchain); + + /* Copy the presentation parameters */ + local_parameters.BackBufferWidth = present_parameters->BackBufferWidth; + local_parameters.BackBufferHeight = present_parameters->BackBufferHeight; + local_parameters.BackBufferFormat = present_parameters->BackBufferFormat; + local_parameters.BackBufferCount = present_parameters->BackBufferCount; + local_parameters.MultiSampleType = present_parameters->MultiSampleType; + local_parameters.MultiSampleQuality = present_parameters->MultiSampleQuality; + local_parameters.SwapEffect = present_parameters->SwapEffect; + local_parameters.hDeviceWindow = present_parameters->hDeviceWindow; + local_parameters.Windowed = present_parameters->Windowed; + local_parameters.EnableAutoDepthStencil = present_parameters->EnableAutoDepthStencil; + local_parameters.AutoDepthStencilFormat = present_parameters->AutoDepthStencilFormat; + local_parameters.Flags = present_parameters->Flags; + local_parameters.FullScreen_RefreshRateInHz = present_parameters->FullScreen_RefreshRateInHz; + local_parameters.PresentationInterval = present_parameters->PresentationInterval; + + hr = IDirect3DDevice9Impl_CreateAdditionalSwapChain((IDirect3DDevice9Ex *)This, + &local_parameters, (IDirect3DSwapChain9 **)&d3d_swapchain); + if (FAILED(hr)) + { + ERR("(%p) CreateAdditionalSwapChain failed, returning %#x\n", iface, hr); + *swapchain = NULL; + return hr; + } + + *swapchain = d3d_swapchain->wineD3DSwapChain; + d3d_swapchain->isImplicit = TRUE; + /* Implicit swap chains are created with an refcount of 0 */ + IDirect3DSwapChain9_Release((IDirect3DSwapChain9 *)d3d_swapchain); + + /* Copy back the presentation parameters */ + present_parameters->BackBufferWidth = local_parameters.BackBufferWidth; + present_parameters->BackBufferHeight = local_parameters.BackBufferHeight; + present_parameters->BackBufferFormat = local_parameters.BackBufferFormat; + present_parameters->BackBufferCount = local_parameters.BackBufferCount; + present_parameters->MultiSampleType = local_parameters.MultiSampleType; + present_parameters->MultiSampleQuality = local_parameters.MultiSampleQuality; + present_parameters->SwapEffect = local_parameters.SwapEffect; + present_parameters->hDeviceWindow = local_parameters.hDeviceWindow; + present_parameters->Windowed = local_parameters.Windowed; + present_parameters->EnableAutoDepthStencil = local_parameters.EnableAutoDepthStencil; + present_parameters->AutoDepthStencilFormat = local_parameters.AutoDepthStencilFormat; + present_parameters->Flags = local_parameters.Flags; + present_parameters->FullScreen_RefreshRateInHz = local_parameters.FullScreen_RefreshRateInHz; + present_parameters->PresentationInterval = local_parameters.PresentationInterval; + + return hr; +} + +const IWineD3DDeviceParentVtbl d3d9_wined3d_device_parent_vtbl = +{ + /* IUnknown methods */ + device_parent_QueryInterface, + device_parent_AddRef, + device_parent_Release, + /* IWineD3DDeviceParent methods */ + device_parent_CreateSurface, + device_parent_CreateRenderTarget, + device_parent_CreateDepthStencilSurface, + device_parent_CreateVolume, + device_parent_CreateSwapChain, +}; Modified: trunk/reactos/dll/directx/wine/d3d9/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/dire…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/directx.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/directx.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -329,30 +329,6 @@ return ret; } -/* Internal function called back during the CreateDevice to create a render target */ -HRESULT WINAPI D3D9CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Lockable, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) { - HRESULT res = D3D_OK; - IDirect3DSurface9Impl *d3dSurface = NULL; - TRACE("(%p) call back\n", device); - res = IDirect3DDevice9_CreateRenderTarget((IDirect3DDevice9 *)device, Width, Height, - (D3DFORMAT)Format, MultiSample, MultisampleQuality, Lockable, - (IDirect3DSurface9 **)&d3dSurface, pSharedHandle); - - if (SUCCEEDED(res)) { - *ppSurface = d3dSurface->wineD3DSurface; - d3dSurface->container = pSuperior; - d3dSurface->isImplicit = TRUE; - /* Implicit surfaces are created with an refcount of 0 */ - IDirect3DSurface9_Release((IDirect3DSurface9 *)d3dSurface); - } else { - *ppSurface = NULL; - } - return res; -} - ULONG WINAPI D3D9CB_DestroyRenderTarget(IWineD3DSurface *pSurface) { IDirect3DSurface9Impl* surfaceParent; TRACE("(%p) call back\n", pSurface); @@ -363,60 +339,6 @@ return IDirect3DSurface9_Release((IDirect3DSurface9*) surfaceParent); } -static HRESULT WINAPI D3D9CB_CreateAdditionalSwapChain(IUnknown *device, - WINED3DPRESENT_PARAMETERS* pPresentationParameters, - IWineD3DSwapChain ** ppSwapChain) { - HRESULT res = D3D_OK; - IDirect3DSwapChain9Impl *d3dSwapChain = NULL; - D3DPRESENT_PARAMETERS localParameters; - TRACE("(%p) call back\n", device); - - /* Copy the presentation parameters */ - localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth; - localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight; - localParameters.BackBufferFormat = pPresentationParameters->BackBufferFormat; - localParameters.BackBufferCount = pPresentationParameters->BackBufferCount; - localParameters.MultiSampleType = pPresentationParameters->MultiSampleType; - localParameters.MultiSampleQuality = pPresentationParameters->MultiSampleQuality; - localParameters.SwapEffect = pPresentationParameters->SwapEffect; - localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow; - localParameters.Windowed = pPresentationParameters->Windowed; - localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil; - localParameters.AutoDepthStencilFormat = pPresentationParameters->AutoDepthStencilFormat; - localParameters.Flags = pPresentationParameters->Flags; - localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; - localParameters.PresentationInterval = pPresentationParameters->PresentationInterval; - - res = IDirect3DDevice9_CreateAdditionalSwapChain((IDirect3DDevice9 *)device, &localParameters, (IDirect3DSwapChain9 **)&d3dSwapChain); - - if (SUCCEEDED(res)) { - *ppSwapChain = d3dSwapChain->wineD3DSwapChain; - d3dSwapChain->isImplicit = TRUE; - /* Implicit swap chains are created with an refcount of 0 */ - IDirect3DSwapChain9_Release((IDirect3DSwapChain9 *)d3dSwapChain); - } else { - *ppSwapChain = NULL; - } - - /* Copy back the presentation parameters */ - pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; - pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight; - pPresentationParameters->BackBufferFormat = localParameters.BackBufferFormat; - pPresentationParameters->BackBufferCount = localParameters.BackBufferCount; - pPresentationParameters->MultiSampleType = localParameters.MultiSampleType; - pPresentationParameters->MultiSampleQuality = localParameters.MultiSampleQuality; - pPresentationParameters->SwapEffect = localParameters.SwapEffect; - pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow; - pPresentationParameters->Windowed = localParameters.Windowed; - pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil; - pPresentationParameters->AutoDepthStencilFormat = localParameters.AutoDepthStencilFormat; - pPresentationParameters->Flags = localParameters.Flags; - pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz; - pPresentationParameters->PresentationInterval = localParameters.PresentationInterval; - - return res; -} - ULONG WINAPI D3D9CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) { IDirect3DSwapChain9Impl* swapChainParent; TRACE("(%p) call back\n", pSwapChain); @@ -425,28 +347,6 @@ swapChainParent->isImplicit = FALSE; /* Swap chain had refcount of 0 GetParent addrefed to 1, so 1 Release is enough */ return IDirect3DSwapChain9_Release((IDirect3DSwapChain9*) swapChainParent); -} - -/* Internal function called back during the CreateDevice to create a render target */ -HRESULT WINAPI D3D9CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Discard, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) { - HRESULT res = D3D_OK; - IDirect3DSurface9Impl *d3dSurface = NULL; - TRACE("(%p) call back\n", device); - - res = IDirect3DDevice9_CreateDepthStencilSurface((IDirect3DDevice9 *)device, Width, Height, - (D3DFORMAT)Format, MultiSample, MultisampleQuality, Discard, - (IDirect3DSurface9 **)&d3dSurface, pSharedHandle); - if (SUCCEEDED(res)) { - *ppSurface = d3dSurface->wineD3DSurface; - d3dSurface->container = device; - d3dSurface->isImplicit = TRUE; - /* Implicit surfaces are created with an refcount of 0 */ - IDirect3DSurface9_Release((IDirect3DSurface9 *)d3dSurface); - } - return res; } ULONG WINAPI D3D9CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) { @@ -485,13 +385,14 @@ } object->lpVtbl = &Direct3DDevice9_Vtbl; + object->device_parent_vtbl = &d3d9_wined3d_device_parent_vtbl; object->ref = 1; *ppReturnedDeviceInterface = (IDirect3DDevice9 *)object; /* Allocate an associated WineD3DDevice object */ EnterCriticalSection(&d3d9_cs); - hr =IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags, &object->WineD3DDevice, (IUnknown *)object); - + hr = IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags, + (IUnknown *)object, (IWineD3DDeviceParent *)&object->device_parent_vtbl, &object->WineD3DDevice); if (hr != D3D_OK) { HeapFree(GetProcessHeap(), 0, object); *ppReturnedDeviceInterface = NULL; @@ -521,7 +422,7 @@ IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); } - hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters, D3D9CB_CreateAdditionalSwapChain); + hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters); pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight; Modified: trunk/reactos/dll/directx/wine/d3d9/pixelshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/pixe…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/pixelshader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/pixelshader.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -170,11 +170,21 @@ EnterCriticalSection(&d3d9_cs); hrc = IWineD3DDevice_GetPixelShader(This->WineD3DDevice, &object); - if (hrc == D3D_OK && object != NULL) { - hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)ppShader); - IWineD3DPixelShader_Release(object); - } else { - *ppShader = NULL; + if (SUCCEEDED(hrc)) + { + if (object) + { + hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)ppShader); + IWineD3DPixelShader_Release(object); + } + else + { + *ppShader = NULL; + } + } + else + { + WARN("(%p) : Call to IWineD3DDevice_GetPixelShader failed %u (device %p)\n", This, hrc, This->WineD3DDevice); } LeaveCriticalSection(&d3d9_cs); Modified: trunk/reactos/dll/directx/wine/d3d9/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/quer…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/query.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/query.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -163,7 +163,7 @@ /* Allocate the storage for the device */ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DQuery9Impl)); if (NULL == object) { - FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n"); + ERR("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n"); return D3DERR_OUTOFVIDEOMEMORY; } @@ -176,7 +176,7 @@ if (FAILED(hr)) { /* free up object */ - FIXME("(%p) call to IWineD3DDevice_CreateQuery failed\n", This); + WARN("(%p) call to IWineD3DDevice_CreateQuery failed\n", This); HeapFree(GetProcessHeap(), 0, object); } else { IDirect3DDevice9Ex_AddRef(iface); Modified: trunk/reactos/dll/directx/wine/d3d9/stateblock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/stat…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/stateblock.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/stateblock.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -175,7 +175,7 @@ hr=IWineD3DDevice_EndStateBlock(This->WineD3DDevice,&wineD3DStateBlock); LeaveCriticalSection(&d3d9_cs); if(hr!= D3D_OK){ - FIXME("IWineD3DDevice_EndStateBlock returned an error\n"); + WARN("IWineD3DDevice_EndStateBlock returned an error\n"); return hr; } /* allocate a new IDirectD3DStateBlock */ @@ -188,6 +188,6 @@ IDirect3DDevice9Ex_AddRef(iface); object->parentDevice = iface; *ppSB=(IDirect3DStateBlock9*)object; - TRACE("(%p)Returning %p %p\n", This, *ppSB, wineD3DStateBlock); + TRACE("(%p) Returning *ppSB %p, wineD3DStateBlock %p\n", This, *ppSB, wineD3DStateBlock); return D3D_OK; } Modified: trunk/reactos/dll/directx/wine/d3d9/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/surf…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/surface.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/surface.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -241,7 +241,11 @@ EnterCriticalSection(&d3d9_cs); hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface); LeaveCriticalSection(&d3d9_cs); - return hr; + switch(hr) + { + case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL; + default: return hr; + } } static HRESULT WINAPI IDirect3DSurface9Impl_GetDC(LPDIRECT3DSURFACE9 iface, HDC* phdc) { @@ -263,7 +267,10 @@ EnterCriticalSection(&d3d9_cs); hr = IWineD3DSurface_ReleaseDC(This->wineD3DSurface, hdc); LeaveCriticalSection(&d3d9_cs); - return hr; + switch(hr) { + case WINEDDERR_NODC: return WINED3DERR_INVALIDCALL; + default: return hr; + } } Modified: trunk/reactos/dll/directx/wine/d3d9/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/swap…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/swapchain.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/swapchain.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -227,9 +227,11 @@ localParameters.Flags = pPresentationParameters->Flags; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.PresentationInterval = pPresentationParameters->PresentationInterval; - - EnterCriticalSection(&d3d9_cs); - hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D9CB_CreateRenderTarget, D3D9CB_CreateDepthStencilSurface, SURFACE_OPENGL); + localParameters.AutoRestoreDisplayMode = TRUE; + + EnterCriticalSection(&d3d9_cs); + hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, + &object->wineD3DSwapChain, (IUnknown*)object, SURFACE_OPENGL); LeaveCriticalSection(&d3d9_cs); pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; Modified: trunk/reactos/dll/directx/wine/d3d9/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/text…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/texture.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/texture.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -339,7 +339,7 @@ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTexture9Impl)); if (NULL == object) { - FIXME("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n"); + ERR("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n"); return D3DERR_OUTOFVIDEOMEMORY; } @@ -347,13 +347,12 @@ object->ref = 1; EnterCriticalSection(&d3d9_cs); hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK, - (WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DTexture, pSharedHandle, (IUnknown *)object, D3D9CB_CreateSurface); - LeaveCriticalSection(&d3d9_cs); - + Format, Pool, &object->wineD3DTexture, pSharedHandle, (IUnknown *)object); + LeaveCriticalSection(&d3d9_cs); if (FAILED(hrc)) { /* free up object */ - FIXME("(%p) call to IWineD3DDevice_CreateTexture failed\n", This); + WARN("(%p) call to IWineD3DDevice_CreateTexture failed\n", This); HeapFree(GetProcessHeap(), 0, object); } else { IDirect3DDevice9Ex_AddRef(iface); Modified: trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/vertexdeclaration.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -96,6 +96,10 @@ elements[idx].Type = D3DDECLTYPE_FLOAT4; elements[idx].Usage = D3DDECLUSAGE_POSITIONT; } + else if (!has_blend && (fvf & D3DFVF_XYZW) == D3DFVF_XYZW) { + elements[idx].Type = D3DDECLTYPE_FLOAT4; + elements[idx].Usage = D3DDECLUSAGE_POSITION; + } else { elements[idx].Type = D3DDECLTYPE_FLOAT3; elements[idx].Usage = D3DDECLUSAGE_POSITION; Modified: trunk/reactos/dll/directx/wine/d3d9/vertexshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/vert…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/vertexshader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/vertexshader.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -166,10 +166,20 @@ TRACE("(%p) : Relay device@%p\n", This, This->WineD3DDevice); EnterCriticalSection(&d3d9_cs); hrc = IWineD3DDevice_GetVertexShader(This->WineD3DDevice, &pShader); - if(hrc == D3D_OK && pShader != NULL){ - hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader); - IWineD3DVertexShader_Release(pShader); - } else { + if (SUCCEEDED(hrc)) + { + if (pShader) + { + hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader); + IWineD3DVertexShader_Release(pShader); + } + else + { + *ppShader = NULL; + } + } + else + { WARN("(%p) : Call to IWineD3DDevice_GetVertexShader failed %u (device %p)\n", This, hrc, This->WineD3DDevice); } LeaveCriticalSection(&d3d9_cs); Modified: trunk/reactos/dll/directx/wine/d3d9/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/volume.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/volume.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -160,7 +160,7 @@ return IWineD3DVolume_UnlockBox(This->wineD3DVolume); } -static const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl = +const IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl = { /* IUnknown */ IDirect3DVolume9Impl_QueryInterface, @@ -177,42 +177,6 @@ IDirect3DVolume9Impl_UnlockBox }; - -/* Internal function called back during the CreateVolumeTexture */ -HRESULT WINAPI D3D9CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth, - WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage, - IWineD3DVolume **ppVolume, - HANDLE * pSharedHandle) { - IDirect3DVolume9Impl *object; - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)pDevice; - HRESULT hrc = D3D_OK; - - /* Allocate the storage for the device */ - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolume9Impl)); - if (NULL == object) { - FIXME("Allocation of memory failed\n"); - *ppVolume = NULL; - return D3DERR_OUTOFVIDEOMEMORY; - } - - object->lpVtbl = &Direct3DVolume9_Vtbl; - object->ref = 1; - hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage & WINED3DUSAGE_MASK, Format, - Pool, &object->wineD3DVolume, pSharedHandle, (IUnknown *)object); - if (hrc != D3D_OK) { - /* free up object */ - FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This); - HeapFree(GetProcessHeap(), 0, object); - *ppVolume = NULL; - } else { - *ppVolume = object->wineD3DVolume; - object->container = pSuperior; - object->forwardReference = pSuperior; - } - TRACE("(%p) Created volume %p\n", This, *ppVolume); - return hrc; -} - ULONG WINAPI D3D9CB_DestroyVolume(IWineD3DVolume *pVolume) { IDirect3DVolume9Impl* volumeParent; Modified: trunk/reactos/dll/directx/wine/d3d9/volumetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d9/volumetexture.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d9/volumetexture.c [iso-8859-1] Sun Jan 18 15:11:53 2009 @@ -252,21 +252,18 @@ /* Allocate the storage for the device */ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolumeTexture9Impl)); if (NULL == object) { - FIXME("(%p) allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n", This); + ERR("(%p) allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n", This); return D3DERR_OUTOFVIDEOMEMORY; } object->lpVtbl = &Direct3DVolumeTexture9_Vtbl; object->ref = 1; - hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage & WINED3DUSAGE_MASK, - (WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DVolumeTexture, pSharedHandle, - (IUnknown *)object, D3D9CB_CreateVolume); - - + hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, + Usage & WINED3DUSAGE_MASK, Format, Pool, &object->wineD3DVolumeTexture, pSharedHandle, (IUnknown *)object); if (hrc != D3D_OK) { /* free up object */ - FIXME("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n", This); + WARN("(%p) call to IWineD3DDevice_CreateVolumeTexture failed\n", This); HeapFree(GetProcessHeap(), 0, object); } else { IDirect3DDevice9Ex_AddRef(iface);
15 years, 11 months
1
0
0
0
[khornicek] 38915: - sync d3d8 with wine HEAD
by khornicek@svn.reactos.org
Author: khornicek Date: Sun Jan 18 15:09:47 2009 New Revision: 38915 URL:
http://svn.reactos.org/svn/reactos?rev=38915&view=rev
Log: - sync d3d8 with wine HEAD Modified: trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h trunk/reactos/dll/directx/wine/d3d8/device.c trunk/reactos/dll/directx/wine/d3d8/directx.c trunk/reactos/dll/directx/wine/d3d8/pixelshader.c trunk/reactos/dll/directx/wine/d3d8/surface.c trunk/reactos/dll/directx/wine/d3d8/vertexshader.c trunk/reactos/dll/directx/wine/d3d8/volume.c Modified: trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/d3d8…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -160,6 +160,7 @@ * Predeclare the interface implementation structures */ extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl; +extern const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl; /***************************************************************************** * IDirect3DDevice8 implementation structure @@ -170,13 +171,14 @@ struct FvfToDecl { DWORD fvf; - IWineD3DVertexDeclaration *decl; + struct IDirect3DVertexDeclaration8 *decl; }; struct IDirect3DDevice8Impl { /* IUnknown fields */ const IDirect3DDevice8Vtbl *lpVtbl; + const IWineD3DDeviceParentVtbl *device_parent_vtbl; LONG ref; /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */ IWineD3DDevice *WineD3DDevice; @@ -200,6 +202,7 @@ /***************************************************************************** * IDirect3DVolume8 implementation structure */ +extern const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl; struct IDirect3DVolume8Impl { /* IUnknown fields */ @@ -531,11 +534,12 @@ DWORD elements_size; /* Size of elements, in bytes */ IWineD3DVertexDeclaration *wined3d_vertex_declaration; + DWORD shader_handle; } IDirect3DVertexDeclaration8Impl; /***************************************************************************** - * IDirect3DVertexShader9 interface + * IDirect3DVertexShader8 interface */ #define INTERFACE IDirect3DVertexShader8 DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown) @@ -544,9 +548,6 @@ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirect3DVertexShader9 methods ***/ - STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE; }; #undef INTERFACE @@ -554,16 +555,13 @@ #define IDirect3DVertexShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) #define IDirect3DVertexShader8_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DVertexShader8_Release(p) (p)->lpVtbl->Release(p) -/*** IDirect3DVertexShader8 methods ***/ -#define IDirect3DVertexShader8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DVertexShader8_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) /* ------------------------- */ /* IDirect3DVertexShader8Impl */ /* ------------------------- */ /***************************************************************************** - * IDirect3DPixelShader9 interface + * IDirect3DPixelShader8 interface */ #define INTERFACE IDirect3DPixelShader8 DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown) @@ -572,9 +570,6 @@ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirect3DPixelShader8 methods ***/ - STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE; - STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE; }; #undef INTERFACE @@ -582,10 +577,6 @@ #define IDirect3DPixelShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) #define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p) -/*** IDirect3DPixelShader8 methods ***/ -#define IDirect3DPixelShader8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) -#define IDirect3DPixelShader8_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) - /***************************************************************************** * Predeclare the interface implementation structures @@ -600,7 +591,6 @@ const IDirect3DVertexShader8Vtbl *lpVtbl; LONG ref; - DWORD handle; IDirect3DVertexDeclaration8 *vertex_declaration; IWineD3DVertexShader *wineD3DVertexShader; }; @@ -624,7 +614,6 @@ LONG ref; DWORD handle; - /* The device, to be replaced by an IDirect3DDeviceImpl */ IWineD3DPixelShader *wineD3DPixelShader; } IDirect3DPixelShader8Impl; @@ -638,34 +627,10 @@ size_t parse_token(const DWORD* pToken); /* Callbacks */ -extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - WINED3DCUBEMAP_FACES Face, IWineD3DSurface** ppSurface, - HANDLE* pSharedHandle); - -extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth, - WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage, - IWineD3DVolume **ppVolume, - HANDLE * pSharedHandle); - -extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Discard, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle); - -extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Lockable, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle); - extern ULONG WINAPI D3D8CB_DestroySwapChain (IWineD3DSwapChain *pSwapChain); - extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface); - extern ULONG WINAPI D3D8CB_DestroyRenderTarget (IWineD3DSurface *pSurface); - extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface); - extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume); #endif /* __WINE_D3DX8_PRIVATE_H */ Modified: trunk/reactos/dll/directx/wine/d3d8/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/devi…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/device.c [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -73,6 +73,13 @@ return S_OK; } + if (IsEqualGUID(riid, &IID_IWineD3DDeviceParent)) + { + IUnknown_AddRef((IUnknown *)&This->device_parent_vtbl); + *ppobj = &This->device_parent_vtbl; + return S_OK; + } + WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj); *ppobj = NULL; return E_NOINTERFACE; @@ -104,7 +111,7 @@ This->inDestruction = TRUE; for(i = 0; i < This->numConvertedDecls; i++) { - IWineD3DVertexDeclaration_Release(This->decls[i].decl); + IDirect3DVertexDeclaration8_Release(This->decls[i].decl); } HeapFree(GetProcessHeap(), 0, This->decls); @@ -308,7 +315,8 @@ localParameters.AutoRestoreDisplayMode = TRUE; EnterCriticalSection(&d3d8_cs); - hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D8CB_CreateRenderTarget, D3D8CB_CreateDepthStencilSurface, SURFACE_OPENGL); + hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, + &object->wineD3DSwapChain, (IUnknown *)object, SURFACE_OPENGL); LeaveCriticalSection(&d3d8_cs); pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; @@ -462,7 +470,7 @@ object->ref = 1; EnterCriticalSection(&d3d8_cs); hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK, - (WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DTexture, NULL, (IUnknown *)object, D3D8CB_CreateSurface); + Format, Pool, &object->wineD3DTexture, NULL, (IUnknown *)object); LeaveCriticalSection(&d3d8_cs); if (FAILED(hrc)) { @@ -501,9 +509,8 @@ object->lpVtbl = &Direct3DVolumeTexture8_Vtbl; object->ref = 1; EnterCriticalSection(&d3d8_cs); - hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, Usage & WINED3DUSAGE_MASK, - (WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DVolumeTexture, NULL, - (IUnknown *)object, D3D8CB_CreateVolume); + hrc = IWineD3DDevice_CreateVolumeTexture(This->WineD3DDevice, Width, Height, Depth, Levels, + Usage & WINED3DUSAGE_MASK, Format, Pool, &object->wineD3DVolumeTexture, NULL, (IUnknown *)object); LeaveCriticalSection(&d3d8_cs); if (hrc != D3D_OK) { @@ -543,8 +550,7 @@ object->ref = 1; EnterCriticalSection(&d3d8_cs); hr = IWineD3DDevice_CreateCubeTexture(This->WineD3DDevice, EdgeLength, Levels, Usage & WINED3DUSAGE_MASK, - (WINED3DFORMAT)Format, (WINED3DPOOL) Pool, &object->wineD3DCubeTexture, NULL, (IUnknown*)object, - D3D8CB_CreateSurface); + Format, Pool, &object->wineD3DCubeTexture, NULL, (IUnknown *)object); LeaveCriticalSection(&d3d8_cs); if (hr != D3D_OK){ @@ -761,11 +767,11 @@ /* Copy rect by rect */ if (NULL != pSourceRects && NULL != pDestPoints) { for (i = 0; i < cRects; ++i) { - IWineD3DSurface_BltFast(Dest->wineD3DSurface, pDestPoints[i].x, pDestPoints[i].y, Source->wineD3DSurface, (RECT *) &pSourceRects[i], WINEDDBLTFAST_NOCOLORKEY); + IWineD3DSurface_BltFast(Dest->wineD3DSurface, pDestPoints[i].x, pDestPoints[i].y, Source->wineD3DSurface, &pSourceRects[i], WINEDDBLTFAST_NOCOLORKEY); } } else { for (i = 0; i < cRects; ++i) { - IWineD3DSurface_BltFast(Dest->wineD3DSurface, 0, 0, Source->wineD3DSurface, (RECT *) &pSourceRects[i], WINEDDBLTFAST_NOCOLORKEY); + IWineD3DSurface_BltFast(Dest->wineD3DSurface, 0, 0, Source->wineD3DSurface, &pSourceRects[i], WINEDDBLTFAST_NOCOLORKEY); } } } @@ -1110,7 +1116,7 @@ EnterCriticalSection(&d3d8_cs); hr = IWineD3DDevice_EndStateBlock(This->WineD3DDevice , &wineD3DStateBlock); if (hr != D3D_OK) { - FIXME("IWineD3DDevice_EndStateBlock returned an error\n"); + WARN("IWineD3DDevice_EndStateBlock returned an error\n"); LeaveCriticalSection(&d3d8_cs); return hr; } @@ -1263,100 +1269,70 @@ return hr; } +static const struct tss_lookup +{ + BOOL sampler_state; + DWORD state; +} +tss_lookup[] = +{ + {FALSE, WINED3DTSS_FORCE_DWORD}, /* 0, unused */ + {FALSE, WINED3DTSS_COLOROP}, /* 1, D3DTSS_COLOROP */ + {FALSE, WINED3DTSS_COLORARG1}, /* 2, D3DTSS_COLORARG1 */ + {FALSE, WINED3DTSS_COLORARG2}, /* 3, D3DTSS_COLORARG2 */ + {FALSE, WINED3DTSS_ALPHAOP}, /* 4, D3DTSS_ALPHAOP */ + {FALSE, WINED3DTSS_ALPHAARG1}, /* 5, D3DTSS_ALPHAARG1 */ + {FALSE, WINED3DTSS_ALPHAARG2}, /* 6, D3DTSS_ALPHAARG2 */ + {FALSE, WINED3DTSS_BUMPENVMAT00}, /* 7, D3DTSS_BUMPENVMAT00 */ + {FALSE, WINED3DTSS_BUMPENVMAT01}, /* 8, D3DTSS_BUMPENVMAT01 */ + {FALSE, WINED3DTSS_BUMPENVMAT10}, /* 9, D3DTSS_BUMPENVMAT10 */ + {FALSE, WINED3DTSS_BUMPENVMAT11}, /* 10, D3DTSS_BUMPENVMAT11 */ + {FALSE, WINED3DTSS_TEXCOORDINDEX}, /* 11, D3DTSS_TEXCOORDINDEX */ + {FALSE, WINED3DTSS_FORCE_DWORD}, /* 12, unused */ + {TRUE, WINED3DSAMP_ADDRESSU}, /* 13, D3DTSS_ADDRESSU */ + {TRUE, WINED3DSAMP_ADDRESSV}, /* 14, D3DTSS_ADDRESSV */ + {TRUE, WINED3DSAMP_BORDERCOLOR}, /* 15, D3DTSS_BORDERCOLOR */ + {TRUE, WINED3DSAMP_MAGFILTER}, /* 16, D3DTSS_MAGFILTER */ + {TRUE, WINED3DSAMP_MINFILTER}, /* 17, D3DTSS_MINFILTER */ + {TRUE, WINED3DSAMP_MIPFILTER}, /* 18, D3DTSS_MIPFILTER */ + {TRUE, WINED3DSAMP_MIPMAPLODBIAS}, /* 19, D3DTSS_MIPMAPLODBIAS */ + {TRUE, WINED3DSAMP_MAXMIPLEVEL}, /* 20, D3DTSS_MAXMIPLEVEL */ + {TRUE, WINED3DSAMP_MAXANISOTROPY}, /* 21, D3DTSS_MAXANISOTROPY */ + {FALSE, WINED3DTSS_BUMPENVLSCALE}, /* 22, D3DTSS_BUMPENVLSCALE */ + {FALSE, WINED3DTSS_BUMPENVLOFFSET}, /* 23, D3DTSS_BUMPENVLOFFSET */ + {FALSE, WINED3DTSS_TEXTURETRANSFORMFLAGS}, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */ + {TRUE, WINED3DSAMP_ADDRESSW}, /* 25, D3DTSS_ADDRESSW */ + {FALSE, WINED3DTSS_COLORARG0}, /* 26, D3DTSS_COLORARG0 */ + {FALSE, WINED3DTSS_ALPHAARG0}, /* 27, D3DTSS_ALPHAARG0 */ + {FALSE, WINED3DTSS_RESULTARG}, /* 28, D3DTSS_RESULTARG */ +}; + static HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) { IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; - HRESULT hr; - TRACE("(%p) Relay\n" , This); - - switch(Type) { - case D3DTSS_ADDRESSU: - Type = WINED3DSAMP_ADDRESSU; - break; - case D3DTSS_ADDRESSV: - Type = WINED3DSAMP_ADDRESSV; - break; - case D3DTSS_ADDRESSW: - Type = WINED3DSAMP_ADDRESSW; - break; - case D3DTSS_BORDERCOLOR: - Type = WINED3DSAMP_BORDERCOLOR; - break; - case D3DTSS_MAGFILTER: - Type = WINED3DSAMP_MAGFILTER; - break; - case D3DTSS_MAXANISOTROPY: - Type = WINED3DSAMP_MAXANISOTROPY; - break; - case D3DTSS_MAXMIPLEVEL: - Type = WINED3DSAMP_MAXMIPLEVEL; - break; - case D3DTSS_MINFILTER: - Type = WINED3DSAMP_MINFILTER; - break; - case D3DTSS_MIPFILTER: - Type = WINED3DSAMP_MIPFILTER; - break; - case D3DTSS_MIPMAPLODBIAS: - Type = WINED3DSAMP_MIPMAPLODBIAS; - break; - default: - EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, Type, pValue); - LeaveCriticalSection(&d3d8_cs); - return hr; - } - - EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_GetSamplerState(This->WineD3DDevice, Stage, Type, pValue); + const struct tss_lookup *l = &tss_lookup[Type]; + HRESULT hr; + TRACE("(%p) Relay\n" , This); + + EnterCriticalSection(&d3d8_cs); + + if (l->sampler_state) hr = IWineD3DDevice_GetSamplerState(This->WineD3DDevice, Stage, l->state, pValue); + else hr = IWineD3DDevice_GetTextureStageState(This->WineD3DDevice, Stage, l->state, pValue); + LeaveCriticalSection(&d3d8_cs); return hr; } static HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) { IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; - HRESULT hr; - TRACE("(%p) Relay\n" , This); - - switch(Type) { - case D3DTSS_ADDRESSU: - Type = WINED3DSAMP_ADDRESSU; - break; - case D3DTSS_ADDRESSV: - Type = WINED3DSAMP_ADDRESSV; - break; - case D3DTSS_ADDRESSW: - Type = WINED3DSAMP_ADDRESSW; - break; - case D3DTSS_BORDERCOLOR: - Type = WINED3DSAMP_BORDERCOLOR; - break; - case D3DTSS_MAGFILTER: - Type = WINED3DSAMP_MAGFILTER; - break; - case D3DTSS_MAXANISOTROPY: - Type = WINED3DSAMP_MAXANISOTROPY; - break; - case D3DTSS_MAXMIPLEVEL: - Type = WINED3DSAMP_MAXMIPLEVEL; - break; - case D3DTSS_MINFILTER: - Type = WINED3DSAMP_MINFILTER; - break; - case D3DTSS_MIPFILTER: - Type = WINED3DSAMP_MIPFILTER; - break; - case D3DTSS_MIPMAPLODBIAS: - Type = WINED3DSAMP_MIPMAPLODBIAS; - break; - default: - EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, Type, Value); - LeaveCriticalSection(&d3d8_cs); - return hr; - } - - EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_SetSamplerState(This->WineD3DDevice, Stage, Type, Value); + const struct tss_lookup *l = &tss_lookup[Type]; + HRESULT hr; + TRACE("(%p) Relay\n" , This); + + EnterCriticalSection(&d3d8_cs); + + if (l->sampler_state) hr = IWineD3DDevice_SetSamplerState(This->WineD3DDevice, Stage, l->state, Value); + else hr = IWineD3DDevice_SetTextureStageState(This->WineD3DDevice, Stage, l->state, Value); + LeaveCriticalSection(&d3d8_cs); return hr; } @@ -1537,6 +1513,7 @@ IDirect3DVertexShader8Impl *object; IWineD3DVertexDeclaration *wined3d_vertex_declaration; const DWORD *token = pDeclaration; + shader_handle *handle; /* Test if the vertex declaration is valid */ while (D3DVSD_END() != *token) { @@ -1575,41 +1552,57 @@ *ppShader = 0; return D3DERR_INVALIDCALL; } - wined3d_vertex_declaration = ((IDirect3DVertexDeclaration8Impl *)object->vertex_declaration)->wined3d_vertex_declaration; - - /* Usage is missing ... Use SetRenderState to set the sw vp render state in SetVertexShader */ - hrc = IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, wined3d_vertex_declaration, pFunction, &object->wineD3DVertexShader, (IUnknown *)object); - - if (FAILED(hrc)) { - /* free up object */ - FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n"); + + handle = alloc_shader_handle(This); + if (!handle) + { + ERR("Failed to allocate shader handle\n"); + LeaveCriticalSection(&d3d8_cs); + IDirect3DVertexDeclaration8_Release(object->vertex_declaration); HeapFree(GetProcessHeap(), 0, object); *ppShader = 0; - } else { - /* TODO: Store the VS declarations locally so that they can be dereferenced with a value higher than VS_HIGHESTFIXEDFXF */ - shader_handle *handle = alloc_shader_handle(This); - if (!handle) { - ERR("Failed to allocate shader handle\n"); - IDirect3DVertexShader8_Release((IUnknown *)object); - hrc = E_OUTOFMEMORY; - } else { - *handle = object; - object->handle = (handle - This->shader_handles) + VS_HIGHESTFIXEDFXF + 1; - *ppShader = object->handle; - + return E_OUTOFMEMORY; + } + else + { + DWORD shader_handle = (handle - This->shader_handles) + VS_HIGHESTFIXEDFXF + 1; + *handle = object; + *ppShader = ((IDirect3DVertexDeclaration8Impl *)object->vertex_declaration)->shader_handle = shader_handle; + } + + wined3d_vertex_declaration = ((IDirect3DVertexDeclaration8Impl *)object->vertex_declaration)->wined3d_vertex_declaration; + + if (pFunction) + { + /* Usage is missing ... Use SetRenderState to set the sw vp render state in SetVertexShader */ + hrc = IWineD3DDevice_CreateVertexShader(This->WineD3DDevice, wined3d_vertex_declaration, + pFunction, &object->wineD3DVertexShader, (IUnknown *)object); + + if (FAILED(hrc)) + { + /* free up object */ + FIXME("Call to IWineD3DDevice_CreateVertexShader failed\n"); + free_shader_handle(This, handle); + IDirect3DVertexDeclaration8_Release(object->vertex_declaration); + HeapFree(GetProcessHeap(), 0, object); + *ppShader = 0; + } + else + { load_local_constants(pDeclaration, object->wineD3DVertexShader); TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader); } } + LeaveCriticalSection(&d3d8_cs); return hrc; } -static IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8Impl *This, DWORD fvf) +static IDirect3DVertexDeclaration8Impl *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8Impl *This, DWORD fvf) { - HRESULT hr; - IWineD3DVertexDeclaration* pDecl = NULL; + IDirect3DVertexDeclaration8Impl *d3d8_declaration; + HRESULT hr; int p, low, high; /* deliberately signed */ struct FvfToDecl *convertedDecls = This->decls; @@ -1622,7 +1615,7 @@ TRACE("%d ", p); if(convertedDecls[p].fvf == fvf) { TRACE("found %p\n", convertedDecls[p].decl); - return convertedDecls[p].decl; + return (IDirect3DVertexDeclaration8Impl *)convertedDecls[p].decl; } else if(convertedDecls[p].fvf < fvf) { low = p + 1; } else { @@ -1631,11 +1624,27 @@ } TRACE("not found. Creating and inserting at position %d.\n", low); + d3d8_declaration = HeapAlloc(GetProcessHeap(), 0, sizeof(*d3d8_declaration)); + if (!d3d8_declaration) + { + ERR("Memory allocation failed.\n"); + return NULL; + } + + d3d8_declaration->ref_count = 1; + d3d8_declaration->lpVtbl = &Direct3DVertexDeclaration8_Vtbl; + d3d8_declaration->elements = NULL; + d3d8_declaration->elements_size = 0; + d3d8_declaration->shader_handle = fvf; + hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->WineD3DDevice, - &pDecl, - (IUnknown *) This, - fvf); - if (FAILED(hr)) return NULL; + &d3d8_declaration->wined3d_vertex_declaration, (IUnknown *)d3d8_declaration, fvf); + if (FAILED(hr)) + { + ERR("Failed to create wined3d vertex declaration.\n"); + HeapFree(GetProcessHeap(), 0, d3d8_declaration); + return NULL; + } if(This->declArraySize == This->numConvertedDecls) { int grow = This->declArraySize / 2; @@ -1643,7 +1652,7 @@ sizeof(convertedDecls[0]) * (This->numConvertedDecls + grow)); if(!convertedDecls) { /* This will destroy it */ - IWineD3DVertexDeclaration_Release(pDecl); + IDirect3DVertexDeclaration8_Release((IDirect3DVertexDeclaration8 *)d3d8_declaration); return NULL; } This->decls = convertedDecls; @@ -1651,12 +1660,12 @@ } memmove(convertedDecls + low + 1, convertedDecls + low, sizeof(convertedDecls[0]) * (This->numConvertedDecls - low)); - convertedDecls[low].decl = pDecl; + convertedDecls[low].decl = (IDirect3DVertexDeclaration8 *)d3d8_declaration; convertedDecls[low].fvf = fvf; This->numConvertedDecls++; - TRACE("Returning %p. %d decls in array\n", pDecl, This->numConvertedDecls); - return pDecl; + TRACE("Returning %p. %u decls in array\n", d3d8_declaration, This->numConvertedDecls); + return d3d8_declaration; } static HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD pShader) { @@ -1666,9 +1675,9 @@ TRACE("(%p) : Relay\n", This); EnterCriticalSection(&d3d8_cs); if (VS_HIGHESTFIXEDFXF >= pShader) { - TRACE("Setting FVF, %d %d\n", VS_HIGHESTFIXEDFXF, pShader); - IWineD3DDevice_SetFVF(This->WineD3DDevice, pShader); - IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, IDirect3DDevice8Impl_FindDecl(This, pShader)); + TRACE("Setting FVF, %#x\n", pShader); + IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, + IDirect3DDevice8Impl_FindDecl(This, pShader)->wined3d_vertex_declaration); IWineD3DDevice_SetVertexShader(This->WineD3DDevice, NULL); } else { TRACE("Setting shader\n"); @@ -1677,9 +1686,19 @@ hrc = D3DERR_INVALIDCALL; } else { IDirect3DVertexShader8Impl *shader = This->shader_handles[pShader - (VS_HIGHESTFIXEDFXF + 1)]; - IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, - shader ? ((IDirect3DVertexDeclaration8Impl *)shader->vertex_declaration)->wined3d_vertex_declaration : NULL); - hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, 0 == shader ? NULL : shader->wineD3DVertexShader); + + if (shader) + { + hrc = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, + ((IDirect3DVertexDeclaration8Impl *)shader->vertex_declaration)->wined3d_vertex_declaration); + if (SUCCEEDED(hrc)) + hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, shader->wineD3DVertexShader); + } + else + { + hrc = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, NULL); + if (SUCCEEDED(hrc)) hrc = IWineD3DDevice_SetVertexShader(This->WineD3DDevice, NULL); + } } } TRACE("(%p) : returning hr(%u)\n", This, hrc); @@ -1690,24 +1709,36 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD* ppShader) { IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; - IWineD3DVertexShader *pShader; - HRESULT hrc = D3D_OK; + IWineD3DVertexDeclaration *wined3d_declaration; + HRESULT hrc; TRACE("(%p) : Relay device@%p\n", This, This->WineD3DDevice); EnterCriticalSection(&d3d8_cs); - hrc = IWineD3DDevice_GetVertexShader(This->WineD3DDevice, &pShader); - if (D3D_OK == hrc) { - if(0 != pShader) { - IDirect3DVertexShader8Impl *d3d8_shader; - hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)&d3d8_shader); - IWineD3DVertexShader_Release(pShader); - *ppShader = d3d8_shader->handle; - } else { + + hrc = IWineD3DDevice_GetVertexDeclaration(This->WineD3DDevice, &wined3d_declaration); + if (SUCCEEDED(hrc)) + { + if (wined3d_declaration) + { + IDirect3DVertexDeclaration8 *d3d8_declaration; + hrc = IWineD3DVertexDeclaration_GetParent(wined3d_declaration, (IUnknown **)&d3d8_declaration); + IWineD3DVertexDeclaration_Release(wined3d_declaration); + if (SUCCEEDED(hrc)) + { + *ppShader = ((IDirect3DVertexDeclaration8Impl *)d3d8_declaration)->shader_handle; + IDirect3DVertexDeclaration8_Release(d3d8_declaration); + } + } + else + { *ppShader = 0; hrc = D3D_OK; } - } else { - WARN("(%p) : Call to IWineD3DDevice_GetVertexShader failed %u (device %p)\n", This, hrc, This->WineD3DDevice); + } + else + { + WARN("(%p) : Call to IWineD3DDevice_GetVertexDeclaration failed %#x (device %p)\n", + This, hrc, This->WineD3DDevice); } TRACE("(%p) : returning %#x\n", This, *ppShader); LeaveCriticalSection(&d3d8_cs); @@ -1750,7 +1781,7 @@ TRACE("(%p) : Relay\n", This); EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_SetVertexShaderConstantF(This->WineD3DDevice, Register, (CONST float *)pConstantData, ConstantCount); + hr = IWineD3DDevice_SetVertexShaderConstantF(This->WineD3DDevice, Register, pConstantData, ConstantCount); LeaveCriticalSection(&d3d8_cs); return hr; } @@ -1761,7 +1792,7 @@ TRACE("(%p) : Relay\n", This); EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_GetVertexShaderConstantF(This->WineD3DDevice, Register, (float *)pConstantData, ConstantCount); + hr = IWineD3DDevice_GetVertexShaderConstantF(This->WineD3DDevice, Register, pConstantData, ConstantCount); LeaveCriticalSection(&d3d8_cs); return hr; } @@ -1819,7 +1850,16 @@ } shader = This->shader_handles[pVertexShader - (VS_HIGHESTFIXEDFXF + 1)]; - hr = IWineD3DVertexShader_GetFunction(shader->wineD3DVertexShader, pData, pSizeOfData); + if (shader->wineD3DVertexShader) + { + hr = IWineD3DVertexShader_GetFunction(shader->wineD3DVertexShader, pData, pSizeOfData); + } + else + { + *pSizeOfData = 0; + hr = D3D_OK; + } + LeaveCriticalSection(&d3d8_cs); return hr; } @@ -1995,7 +2035,7 @@ TRACE("(%p) Relay\n", This); EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_SetPixelShaderConstantF(This->WineD3DDevice, Register, (CONST float *)pConstantData, ConstantCount); + hr = IWineD3DDevice_SetPixelShaderConstantF(This->WineD3DDevice, Register, pConstantData, ConstantCount); LeaveCriticalSection(&d3d8_cs); return hr; } @@ -2006,7 +2046,7 @@ TRACE("(%p) Relay\n", This); EnterCriticalSection(&d3d8_cs); - hr = IWineD3DDevice_GetPixelShaderConstantF(This->WineD3DDevice, Register, (float *)pConstantData, ConstantCount); + hr = IWineD3DDevice_GetPixelShaderConstantF(This->WineD3DDevice, Register, pConstantData, ConstantCount); LeaveCriticalSection(&d3d8_cs); return hr; } @@ -2206,34 +2246,6 @@ IDirect3DDevice8Impl_DeletePatch }; -/* Internal function called back during the CreateDevice to create a render target */ -HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level, - WINED3DCUBEMAP_FACES Face, IWineD3DSurface **ppSurface, - HANDLE *pSharedHandle) { - - HRESULT res = D3D_OK; - IDirect3DSurface8Impl *d3dSurface = NULL; - BOOL Lockable = TRUE; - - if((WINED3DPOOL_DEFAULT == Pool && WINED3DUSAGE_DYNAMIC != Usage)) - Lockable = FALSE; - - TRACE("relay\n"); - res = IDirect3DDevice8Impl_CreateSurface((IDirect3DDevice8 *)device, Width, Height, (D3DFORMAT)Format, Lockable, FALSE/*Discard*/, Level, (IDirect3DSurface8 **)&d3dSurface, D3DRTYPE_SURFACE, Usage, Pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */); - - if (SUCCEEDED(res)) { - *ppSurface = d3dSurface->wineD3DSurface; - d3dSurface->container = pSuperior; - IUnknown_Release(d3dSurface->parentDevice); - d3dSurface->parentDevice = NULL; - d3dSurface->forwardReference = pSuperior; - } else { - FIXME("(%p) IDirect3DDevice8_CreateSurface failed\n", device); - } - return res; -} - ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface) { IDirect3DSurface8Impl* surfaceParent; TRACE("(%p) call back\n", pSurface); @@ -2244,3 +2256,234 @@ surfaceParent->forwardReference = NULL; return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent); } + +/* IWineD3DDeviceParent IUnknown methods */ + +static inline struct IDirect3DDevice8Impl *device_from_device_parent(IWineD3DDeviceParent *iface) +{ + return (struct IDirect3DDevice8Impl *)((char*)iface + - FIELD_OFFSET(struct IDirect3DDevice8Impl, device_parent_vtbl)); +} + +HRESULT STDMETHODCALLTYPE device_parent_QueryInterface(IWineD3DDeviceParent *iface, REFIID riid, void **object) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + return IDirect3DDevice8Impl_QueryInterface((IDirect3DDevice8 *)This, riid, object); +} + +ULONG STDMETHODCALLTYPE device_parent_AddRef(IWineD3DDeviceParent *iface) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + return IDirect3DDevice8Impl_AddRef((IDirect3DDevice8 *)This); +} + +ULONG STDMETHODCALLTYPE device_parent_Release(IWineD3DDeviceParent *iface) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + return IDirect3DDevice8Impl_Release((IDirect3DDevice8 *)This); +} + +/* IWineD3DDeviceParent methods */ + +static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, DWORD usage, + WINED3DPOOL pool, UINT level, WINED3DCUBEMAP_FACES face, IWineD3DSurface **surface) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + IDirect3DSurface8Impl *d3d_surface; + BOOL lockable = TRUE; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, format %#x, usage %#x,\n" + "\tpool %#x, level %u, face %u, surface %p\n", + iface, superior, width, height, format, usage, pool, level, face, surface); + + + if (pool == WINED3DPOOL_DEFAULT && !(usage & WINED3DUSAGE_DYNAMIC)) lockable = FALSE; + + hr = IDirect3DDevice8Impl_CreateSurface((IDirect3DDevice8 *)This, width, height, + format, lockable, FALSE /* Discard */, level, (IDirect3DSurface8 **)&d3d_surface, + D3DRTYPE_SURFACE, usage, pool, D3DMULTISAMPLE_NONE, 0 /* MultisampleQuality */); + if (FAILED(hr)) + { + ERR("(%p) CreateSurface failed, returning %#x\n", iface, hr); + return hr; + } + + *surface = d3d_surface->wineD3DSurface; + d3d_surface->container = superior; + IUnknown_Release(d3d_surface->parentDevice); + d3d_surface->parentDevice = NULL; + d3d_surface->forwardReference = superior; + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type, + DWORD multisample_quality, BOOL lockable, IWineD3DSurface **surface) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + IDirect3DSurface8Impl *d3d_surface; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n" + "\tmultisample_quality %u, lockable %u, surface %p\n", + iface, superior, width, height, format, multisample_type, multisample_quality, lockable, surface); + + hr = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)This, width, height, format, + multisample_type, lockable, (IDirect3DSurface8 **)&d3d_surface); + if (FAILED(hr)) + { + ERR("(%p) CreateRenderTarget failed, returning %#x\n", iface, hr); + return hr; + } + + *surface = d3d_surface->wineD3DSurface; + d3d_surface->container = (IUnknown *)This; + d3d_surface->isImplicit = TRUE; + /* Implicit surfaces are created with an refcount of 0 */ + IUnknown_Release((IUnknown *)d3d_surface); + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, WINED3DFORMAT format, WINED3DMULTISAMPLE_TYPE multisample_type, + DWORD multisample_quality, BOOL discard, IWineD3DSurface **surface) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + IDirect3DSurface8Impl *d3d_surface; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, format %#x, multisample_type %#x,\n" + "\tmultisample_quality %u, discard %u, surface %p\n", + iface, superior, width, height, format, multisample_type, multisample_quality, discard, surface); + + hr = IDirect3DDevice8_CreateDepthStencilSurface((IDirect3DDevice8 *)This, width, height, format, + multisample_type, (IDirect3DSurface8 **)&d3d_surface); + if (FAILED(hr)) + { + ERR("(%p) CreateDepthStencilSurface failed, returning %#x\n", iface, hr); + return hr; + } + + *surface = d3d_surface->wineD3DSurface; + d3d_surface->container = (IUnknown *)This; + d3d_surface->isImplicit = TRUE; + /* Implicit surfaces are created with an refcount of 0 */ + IUnknown_Release((IUnknown *)d3d_surface); + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent *iface, + IUnknown *superior, UINT width, UINT height, UINT depth, WINED3DFORMAT format, + WINED3DPOOL pool, DWORD usage, IWineD3DVolume **volume) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + IDirect3DVolume8Impl *object; + HRESULT hr; + + TRACE("iface %p, superior %p, width %u, height %u, depth %u, format %#x, pool %#x, usage %#x, volume %p\n", + iface, superior, width, height, depth, format, pool, usage, volume); + + /* Allocate the storage for the device */ + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + { + FIXME("Allocation of memory failed\n"); + *volume = NULL; + return D3DERR_OUTOFVIDEOMEMORY; + } + + object->lpVtbl = &Direct3DVolume8_Vtbl; + object->ref = 1; + hr = IWineD3DDevice_CreateVolume(This->WineD3DDevice, width, height, depth, usage, + format, pool, &object->wineD3DVolume, NULL, (IUnknown *)object); + if (FAILED(hr)) + { + ERR("(%p) CreateVolume failed, returning %#x\n", iface, hr); + HeapFree(GetProcessHeap(), 0, object); + *volume = NULL; + return hr; + } + + *volume = object->wineD3DVolume; + object->container = superior; + object->forwardReference = superior; + + TRACE("(%p) Created volume %p\n", iface, *volume); + + return hr; +} + +static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDeviceParent *iface, + WINED3DPRESENT_PARAMETERS *present_parameters, IWineD3DSwapChain **swapchain) +{ + struct IDirect3DDevice8Impl *This = device_from_device_parent(iface); + IDirect3DSwapChain8Impl *d3d_swapchain; + D3DPRESENT_PARAMETERS local_parameters; + HRESULT hr; + + TRACE("iface %p, present_parameters %p, swapchain %p\n", iface, present_parameters, swapchain); + + /* Copy the presentation parameters */ + local_parameters.BackBufferWidth = present_parameters->BackBufferWidth; + local_parameters.BackBufferHeight = present_parameters->BackBufferHeight; + local_parameters.BackBufferFormat = present_parameters->BackBufferFormat; + local_parameters.BackBufferCount = present_parameters->BackBufferCount; + local_parameters.MultiSampleType = present_parameters->MultiSampleType; + local_parameters.SwapEffect = present_parameters->SwapEffect; + local_parameters.hDeviceWindow = present_parameters->hDeviceWindow; + local_parameters.Windowed = present_parameters->Windowed; + local_parameters.EnableAutoDepthStencil = present_parameters->EnableAutoDepthStencil; + local_parameters.AutoDepthStencilFormat = present_parameters->AutoDepthStencilFormat; + local_parameters.Flags = present_parameters->Flags; + local_parameters.FullScreen_RefreshRateInHz = present_parameters->FullScreen_RefreshRateInHz; + local_parameters.FullScreen_PresentationInterval = present_parameters->PresentationInterval; + + hr = IDirect3DDevice8_CreateAdditionalSwapChain((IDirect3DDevice8 *)This, + &local_parameters, (IDirect3DSwapChain8 **)&d3d_swapchain); + if (FAILED(hr)) + { + ERR("(%p) CreateAdditionalSwapChain failed, returning %#x\n", iface, hr); + *swapchain = NULL; + return hr; + } + + *swapchain = d3d_swapchain->wineD3DSwapChain; + IUnknown_Release(d3d_swapchain->parentDevice); + d3d_swapchain->parentDevice = NULL; + + /* Copy back the presentation parameters */ + present_parameters->BackBufferWidth = local_parameters.BackBufferWidth; + present_parameters->BackBufferHeight = local_parameters.BackBufferHeight; + present_parameters->BackBufferFormat = local_parameters.BackBufferFormat; + present_parameters->BackBufferCount = local_parameters.BackBufferCount; + present_parameters->MultiSampleType = local_parameters.MultiSampleType; + present_parameters->SwapEffect = local_parameters.SwapEffect; + present_parameters->hDeviceWindow = local_parameters.hDeviceWindow; + present_parameters->Windowed = local_parameters.Windowed; + present_parameters->EnableAutoDepthStencil = local_parameters.EnableAutoDepthStencil; + present_parameters->AutoDepthStencilFormat = local_parameters.AutoDepthStencilFormat; + present_parameters->Flags = local_parameters.Flags; + present_parameters->FullScreen_RefreshRateInHz = local_parameters.FullScreen_RefreshRateInHz; + present_parameters->PresentationInterval = local_parameters.FullScreen_PresentationInterval; + + return hr; +} + +const IWineD3DDeviceParentVtbl d3d8_wined3d_device_parent_vtbl = +{ + /* IUnknown methods */ + device_parent_QueryInterface, + device_parent_AddRef, + device_parent_Release, + /* IWineD3DDeviceParent methods */ + device_parent_CreateSurface, + device_parent_CreateRenderTarget, + device_parent_CreateDepthStencilSurface, + device_parent_CreateVolume, + device_parent_CreateSwapChain, +}; Modified: trunk/reactos/dll/directx/wine/d3d8/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/dire…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/directx.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/directx.c [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -260,31 +260,6 @@ return ret; } -/* Internal function called back during the CreateDevice to create a render target */ -HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Lockable, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) { - HRESULT res = D3D_OK; - IDirect3DSurface8Impl *d3dSurface = NULL; - - TRACE("(%p) call back\n", device); - res = IDirect3DDevice8_CreateRenderTarget((IDirect3DDevice8 *)device, Width, Height, - (D3DFORMAT)Format, MultiSample, Lockable, - (IDirect3DSurface8 **)&d3dSurface); - - if (SUCCEEDED(res)) { - *ppSurface = d3dSurface->wineD3DSurface; - d3dSurface->container = device; - d3dSurface->isImplicit = TRUE; - /* Implicit surfaces are created with an refcount of 0 */ - IUnknown_Release((IUnknown *)d3dSurface); - } else { - *ppSurface = NULL; - } - return res; -} - ULONG WINAPI D3D8CB_DestroyRenderTarget(IWineD3DSurface *pSurface) { IDirect3DSurface8Impl* surfaceParent; TRACE("(%p) call back\n", pSurface); @@ -295,58 +270,6 @@ return IDirect3DSurface8_Release((IDirect3DSurface8*) surfaceParent); } -/* Callback for creating the implicit swapchain when the device is created */ -static HRESULT WINAPI D3D8CB_CreateAdditionalSwapChain(IUnknown *device, - WINED3DPRESENT_PARAMETERS* pPresentationParameters, - IWineD3DSwapChain ** ppSwapChain){ - HRESULT res = D3D_OK; - IDirect3DSwapChain8Impl *d3dSwapChain = NULL; - D3DPRESENT_PARAMETERS localParameters; - TRACE("(%p) call back\n", device); - - /* Copy the presentation parameters */ - localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth; - localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight; - localParameters.BackBufferFormat = pPresentationParameters->BackBufferFormat; - localParameters.BackBufferCount = pPresentationParameters->BackBufferCount; - localParameters.MultiSampleType = pPresentationParameters->MultiSampleType; - localParameters.SwapEffect = pPresentationParameters->SwapEffect; - localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow; - localParameters.Windowed = pPresentationParameters->Windowed; - localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil; - localParameters.AutoDepthStencilFormat = pPresentationParameters->AutoDepthStencilFormat; - localParameters.Flags = pPresentationParameters->Flags; - localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; - localParameters.FullScreen_PresentationInterval = pPresentationParameters->PresentationInterval; - - res = IDirect3DDevice8_CreateAdditionalSwapChain((IDirect3DDevice8 *)device, &localParameters, (IDirect3DSwapChain8 **)&d3dSwapChain); - - /* Copy back the presentation parameters */ - pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; - pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight; - pPresentationParameters->BackBufferFormat = localParameters.BackBufferFormat; - pPresentationParameters->BackBufferCount = localParameters.BackBufferCount; - pPresentationParameters->MultiSampleType = localParameters.MultiSampleType; - pPresentationParameters->SwapEffect = localParameters.SwapEffect; - pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow; - pPresentationParameters->Windowed = localParameters.Windowed; - pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil; - pPresentationParameters->AutoDepthStencilFormat = localParameters.AutoDepthStencilFormat; - pPresentationParameters->Flags = localParameters.Flags; - pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz; - pPresentationParameters->PresentationInterval = localParameters.FullScreen_PresentationInterval; - - if (SUCCEEDED(res)) { - *ppSwapChain = d3dSwapChain->wineD3DSwapChain; - IUnknown_Release(d3dSwapChain->parentDevice); - d3dSwapChain->parentDevice = NULL; - } else { - *ppSwapChain = NULL; - } - - return res; -} - ULONG WINAPI D3D8CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) { IUnknown* swapChainParent; TRACE("(%p) call back\n", pSwapChain); @@ -354,27 +277,6 @@ IWineD3DSwapChain_GetParent(pSwapChain, &swapChainParent); IUnknown_Release(swapChainParent); return IUnknown_Release(swapChainParent); -} - -/* Internal function called back during the CreateDevice to create a render target */ -HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height, - WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample, - DWORD MultisampleQuality, BOOL Discard, - IWineD3DSurface** ppSurface, HANDLE* pSharedHandle) { - HRESULT res = D3D_OK; - IDirect3DSurface8Impl *d3dSurface = NULL; - TRACE("(%p) call back\n", device); - - res = IDirect3DDevice8_CreateDepthStencilSurface((IDirect3DDevice8 *)device, Width, Height, - (D3DFORMAT)Format, MultiSample, (IDirect3DSurface8 **)&d3dSurface); - if (SUCCEEDED(res)) { - *ppSurface = d3dSurface->wineD3DSurface; - d3dSurface->container = device; - d3dSurface->isImplicit = TRUE; - /* Implicit surfaces are created with an refcount of 0 */ - IUnknown_Release((IUnknown *)d3dSurface); - } - return res; } ULONG WINAPI D3D8CB_DestroyDepthStencilSurface(IWineD3DSurface *pSurface) { @@ -412,6 +314,7 @@ } object->lpVtbl = &Direct3DDevice8_Vtbl; + object->device_parent_vtbl = &d3d8_wined3d_device_parent_vtbl; object->ref = 1; object->shader_handles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, INITIAL_SHADER_HANDLE_TABLE_SIZE * sizeof(shader_handle)); object->shader_handle_table_size = INITIAL_SHADER_HANDLE_TABLE_SIZE; @@ -419,7 +322,8 @@ /* Allocate an associated WineD3DDevice object */ EnterCriticalSection(&d3d8_cs); - hr =IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags, &object->WineD3DDevice, (IUnknown *)object); + hr = IWineD3D_CreateDevice(This->WineD3D, Adapter, DeviceType, hFocusWindow, BehaviourFlags, + (IUnknown *)object, (IWineD3DDeviceParent *)&object->device_parent_vtbl, &object->WineD3DDevice); if (hr != D3D_OK) { HeapFree(GetProcessHeap(), 0, object); @@ -450,7 +354,7 @@ IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); } - hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters, D3D8CB_CreateAdditionalSwapChain); + hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters); LeaveCriticalSection(&d3d8_cs); pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; Modified: trunk/reactos/dll/directx/wine/d3d8/pixelshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/pixe…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/pixelshader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/pixelshader.c [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -62,34 +62,10 @@ return ref; } -/* IDirect3DPixelShader8 Interface follow: */ -static HRESULT WINAPI IDirect3DPixelShader8Impl_GetDevice(IDirect3DPixelShader8 *iface, IDirect3DDevice8 **ppDevice) { - IDirect3DPixelShader8Impl *This = (IDirect3DPixelShader8Impl *)iface; - IWineD3DDevice *myDevice = NULL; - - TRACE("(%p) : Relay\n", This); - - IWineD3DPixelShader_GetDevice(This->wineD3DPixelShader, &myDevice); - IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); - IWineD3DDevice_Release(myDevice); - TRACE("(%p) returning (%p)\n", This, *ppDevice); - return D3D_OK; -} - -static HRESULT WINAPI IDirect3DPixelShader8Impl_GetFunction(IDirect3DPixelShader8 *iface, VOID *pData, UINT *pSizeOfData) { - IDirect3DPixelShader8Impl *This = (IDirect3DPixelShader8Impl *)iface; - TRACE("(%p) Relay\n", This); - return IWineD3DPixelShader_GetFunction(This->wineD3DPixelShader, pData, pSizeOfData); -} - - const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl = { /* IUnknown */ IDirect3DPixelShader8Impl_QueryInterface, IDirect3DPixelShader8Impl_AddRef, IDirect3DPixelShader8Impl_Release, - /* IDirect3DPixelShader8 */ - IDirect3DPixelShader8Impl_GetDevice, - IDirect3DPixelShader8Impl_GetFunction }; Modified: trunk/reactos/dll/directx/wine/d3d8/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/surf…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/surface.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/surface.c [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -206,7 +206,11 @@ EnterCriticalSection(&d3d8_cs); hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface); LeaveCriticalSection(&d3d8_cs); - return hr; + switch(hr) + { + case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL; + default: return hr; + } } const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl = Modified: trunk/reactos/dll/directx/wine/d3d8/vertexshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/vert…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/vertexshader.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/vertexshader.c [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -57,37 +57,11 @@ if (ref == 0) { IDirect3DVertexDeclaration8_Release(This->vertex_declaration); - IWineD3DVertexShader_Release(This->wineD3DVertexShader); + if (This->wineD3DVertexShader) IWineD3DVertexShader_Release(This->wineD3DVertexShader); HeapFree(GetProcessHeap(), 0, This); } return ref; } - -/* IDirect3DVertexShader8 Interface follow: */ -static HRESULT WINAPI IDirect3DVertexShader8Impl_GetDevice(IDirect3DVertexShader8 *iface, IDirect3DDevice8** ppDevice) { - IDirect3DVertexShader8Impl *This = (IDirect3DVertexShader8Impl *)iface; - IWineD3DDevice *myDevice = NULL; - HRESULT hr; - TRACE("(%p) : Relay\n", This); - - hr = IWineD3DVertexShader_GetDevice(This->wineD3DVertexShader, &myDevice); - if (WINED3D_OK == hr && myDevice != NULL) { - hr = IWineD3DDevice_GetParent(myDevice, (IUnknown **)ppDevice); - IWineD3DDevice_Release(myDevice); - } else { - *ppDevice = NULL; - } - TRACE("(%p) returning (%p)\n", This, *ppDevice); - return hr; -} - -static HRESULT WINAPI IDirect3DVertexShader8Impl_GetFunction(IDirect3DVertexShader8 *iface, VOID* pData, UINT* pSizeOfData) { - IDirect3DVertexShader8Impl *This = (IDirect3DVertexShader8Impl *)iface; - - TRACE("(%p) : Relay\n", This); - return IWineD3DVertexShader_GetFunction(This->wineD3DVertexShader, pData, pSizeOfData); -} - const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl = { @@ -95,7 +69,4 @@ IDirect3DVertexShader8Impl_QueryInterface, IDirect3DVertexShader8Impl_AddRef, IDirect3DVertexShader8Impl_Release, - /* IDirect3DVertexShader8 */ - IDirect3DVertexShader8Impl_GetDevice, - IDirect3DVertexShader8Impl_GetFunction }; Modified: trunk/reactos/dll/directx/wine/d3d8/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/volu…
============================================================================== --- trunk/reactos/dll/directx/wine/d3d8/volume.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/d3d8/volume.c [iso-8859-1] Sun Jan 18 15:09:47 2009 @@ -192,7 +192,7 @@ return hr; } -static const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl = +const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl = { /* IUnknown */ IDirect3DVolume8Impl_QueryInterface, @@ -209,42 +209,6 @@ IDirect3DVolume8Impl_UnlockBox }; - -/* Internal function called back during the CreateVolumeTexture */ -HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth, - WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage, - IWineD3DVolume **ppVolume, - HANDLE * pSharedHandle) { - IDirect3DVolume8Impl *object; - IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)pDevice; - HRESULT hrc = D3D_OK; - - /* Allocate the storage for the device */ - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DVolume8Impl)); - if (NULL == object) { - FIXME("Allocation of memory failed\n"); - *ppVolume = NULL; - return D3DERR_OUTOFVIDEOMEMORY; - } - - object->lpVtbl = &Direct3DVolume8_Vtbl; - object->ref = 1; - hrc = IWineD3DDevice_CreateVolume(This->WineD3DDevice, Width, Height, Depth, Usage, Format, - Pool, &object->wineD3DVolume, pSharedHandle, (IUnknown *)object); - if (hrc != D3D_OK) { - /* free up object */ - FIXME("(%p) call to IWineD3DDevice_CreateVolume failed\n", This); - HeapFree(GetProcessHeap(), 0, object); - *ppVolume = NULL; - } else { - *ppVolume = object->wineD3DVolume; - object->container = pSuperior; - object->forwardReference = pSuperior; - } - TRACE("(%p) Created volume %p\n", This, *ppVolume); - return hrc; -} - ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume) { IDirect3DVolume8Impl* volumeParent;
15 years, 11 months
1
0
0
0
[khornicek] 38914: - sync wined3d with wine HEAD
by khornicek@svn.reactos.org
Author: khornicek Date: Sun Jan 18 15:09:22 2009 New Revision: 38914 URL:
http://svn.reactos.org/svn/reactos?rev=38914&view=rev
Log: - sync wined3d with wine HEAD Added: trunk/reactos/dll/directx/wine/wined3d/gl_compat.c (with props) Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c trunk/reactos/dll/directx/wine/wined3d/baseshader.c trunk/reactos/dll/directx/wine/wined3d/basetexture.c trunk/reactos/dll/directx/wine/wined3d/context.c trunk/reactos/dll/directx/wine/wined3d/cubetexture.c trunk/reactos/dll/directx/wine/wined3d/device.c trunk/reactos/dll/directx/wine/wined3d/directx.c trunk/reactos/dll/directx/wine/wined3d/drawprim.c trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c trunk/reactos/dll/directx/wine/wined3d/indexbuffer.c trunk/reactos/dll/directx/wine/wined3d/nvidia_texture_shader.c trunk/reactos/dll/directx/wine/wined3d/palette.c trunk/reactos/dll/directx/wine/wined3d/pixelshader.c trunk/reactos/dll/directx/wine/wined3d/query.c trunk/reactos/dll/directx/wine/wined3d/resource.c trunk/reactos/dll/directx/wine/wined3d/state.c trunk/reactos/dll/directx/wine/wined3d/stateblock.c trunk/reactos/dll/directx/wine/wined3d/surface.c trunk/reactos/dll/directx/wine/wined3d/surface_base.c trunk/reactos/dll/directx/wine/wined3d/surface_gdi.c trunk/reactos/dll/directx/wine/wined3d/texture.c trunk/reactos/dll/directx/wine/wined3d/utils.c trunk/reactos/dll/directx/wine/wined3d/vertexbuffer.c trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c trunk/reactos/dll/directx/wine/wined3d/vertexshader.c trunk/reactos/dll/directx/wine/wined3d/volume.c trunk/reactos/dll/directx/wine/wined3d/volumetexture.c trunk/reactos/dll/directx/wine/wined3d/wined3d.rbuild trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h trunk/reactos/include/reactos/wine/wined3d.idl [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/baseshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/basetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/cubetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/drawprim.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Added: trunk/reactos/dll/directx/wine/wined3d/gl_compat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
Modified: trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
Modified: trunk/reactos/dll/directx/wine/wined3d/indexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/i…
Modified: trunk/reactos/dll/directx/wine/wined3d/nvidia_texture_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/n…
Modified: trunk/reactos/dll/directx/wine/wined3d/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/p…
Modified: trunk/reactos/dll/directx/wine/wined3d/pixelshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/p…
Modified: trunk/reactos/dll/directx/wine/wined3d/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/q…
Modified: trunk/reactos/dll/directx/wine/wined3d/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/r…
Modified: trunk/reactos/dll/directx/wine/wined3d/state.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/stateblock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface_base.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface_gdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/t…
Modified: trunk/reactos/dll/directx/wine/wined3d/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/u…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexbuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexshader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/volumetexture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/include/reactos/wine/wined3d.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wined…
15 years, 11 months
1
0
0
0
[janderwald] 38913: - Fix IPortWaveCyclic interface - Implement IPortEvents interface
by janderwald@svn.reactos.org
Author: janderwald Date: Sun Jan 18 14:56:01 2009 New Revision: 38913 URL:
http://svn.reactos.org/svn/reactos?rev=38913&view=rev
Log: - Fix IPortWaveCyclic interface - Implement IPortEvents interface Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1] Sun Jan 18 14:56:01 2009 @@ -6,6 +6,7 @@ IPortEventsVtbl *lpVbtlPortEvents; IUnregisterSubdeviceVtbl *lpVtblUnregisterSubdevice; IUnregisterPhysicalConnectionVtbl *lpVtblPhysicalConnection; + IPortEventsVtbl *lpVtblPortEvents; ISubdeviceVtbl *lpVtblSubDevice; LONG ref; @@ -22,6 +23,98 @@ const GUID GUID_DEVCLASS_SOUND; //FIXME + +//--------------------------------------------------------------- +// IPortEvents +// + +static +NTSTATUS +NTAPI +IPortEvents_fnQueryInterface( + IPortEvents* iface, + IN REFIID refiid, + OUT PVOID* Output) +{ + IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)CONTAINING_RECORD(iface, IPortWaveCyclicImpl, lpVtblPortEvents); + + DPRINT1("IPortEvents_fnQueryInterface entered\n"); + + if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) || + IsEqualGUIDAligned(refiid, &IID_IUnknown)) + { + *Output = &This->lpVbtlPortEvents; + InterlockedIncrement(&This->ref); + return STATUS_SUCCESS; + } + return STATUS_UNSUCCESSFUL; +} + +static +ULONG +NTAPI +IPortEvents_fnAddRef( + IPortEvents* iface) +{ + IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)CONTAINING_RECORD(iface, IPortWaveCyclicImpl, lpVtblPortEvents); + DPRINT1("IPortEvents_fnQueryInterface entered\n"); + return InterlockedIncrement(&This->ref); +} + +static +ULONG +NTAPI +IPortEvents_fnRelease( + IPortEvents* iface) +{ + IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)CONTAINING_RECORD(iface, IPortWaveCyclicImpl, lpVtblPortEvents); + DPRINT1("IPortEvents_fnQueryInterface entered\n"); + InterlockedDecrement(&This->ref); + + if (This->ref == 0) + { + FreeItem(This, TAG_PORTCLASS); + return 0; + } + /* Return new reference count */ + return This->ref; +} + +static +void +NTAPI +IPortEvents_fnAddEventToEventList( + IPortEvents* iface, + IN PKSEVENT_ENTRY EventEntry) +{ + DPRINT1("IPortEvents_fnAddEventToEventList stub\n"); +} + + +static +void +NTAPI +IPortEvents_fnGenerateEventList( + IPortEvents* iface, + IN GUID* Set OPTIONAL, + IN ULONG EventId, + IN BOOL PinEvent, + IN ULONG PinId, + IN BOOL NodeEvent, + IN ULONG NodeId) +{ + DPRINT1("IPortEvents_fnGenerateEventList stub\n"); +} + +static IPortEventsVtbl vt_IPortEvents = +{ + IPortEvents_fnQueryInterface, + IPortEvents_fnAddRef, + IPortEvents_fnRelease, + IPortEvents_fnAddEventToEventList, + IPortEvents_fnGenerateEventList +}; + //--------------------------------------------------------------- // IUnknown interface functions // @@ -33,6 +126,7 @@ IN REFIID refiid, OUT PVOID* Output) { + WCHAR Buffer[100]; IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface; if (IsEqualGUIDAligned(refiid, &IID_IPortWaveCyclic) || IsEqualGUIDAligned(refiid, &IID_IUnknown)) @@ -41,6 +135,12 @@ InterlockedIncrement(&This->ref); return STATUS_SUCCESS; } + else if (IsEqualGUIDAligned(refiid, &IID_IPortEvents)) + { + *Output = &This->lpVtblPortEvents; + InterlockedIncrement(&This->ref); + return STATUS_SUCCESS; + } else if (IsEqualGUIDAligned(refiid, &IID_ISubdevice)) { *Output = &This->lpVtblSubDevice; @@ -56,6 +156,10 @@ { return NewIDrmPort((PDRMPORT2*)Output); } + + StringFromCLSID(refiid, Buffer); + DPRINT1("IPortWaveCyclic_fnQueryInterface no interface!!! iface %S\n", Buffer); + KeBugCheckEx(0, 0, 0, 0, 0); return STATUS_UNSUCCESSFUL; } @@ -176,11 +280,12 @@ Status = UnknownMiniport->lpVtbl->QueryInterface(UnknownMiniport, &IID_IPinCount, (PVOID*)&PinCount); if (NT_SUCCESS(Status)) { + /* store IPinCount interface */ This->pPinCount = PinCount; - This->pDescriptor = NULL; } else { + /* check if the miniport adapter provides a valid device descriptor */ Status = Miniport->lpVtbl->GetDescription(Miniport, &This->pDescriptor); if (!NT_SUCCESS(Status)) { @@ -188,17 +293,14 @@ Miniport->lpVtbl->Release(Miniport); return Status; } - This->pPinCount = NULL; - } - + } + + /* does the Miniport adapter support IPowerNotify interface*/ Status = UnknownMiniport->lpVtbl->QueryInterface(UnknownMiniport, &IID_IPowerNotify, (PVOID*)&PowerNotify); if (NT_SUCCESS(Status)) { + /* store reference */ This->pPowerNotify = PowerNotify; - } - else - { - This->pPowerNotify = NULL; } /* increment reference on resource list */ @@ -329,8 +431,8 @@ IPortWaveCyclic_fnGetDeviceProperty, IPortWaveCyclic_fnNewRegistryKey, IPortWaveCyclic_fnNotify, - IPortWaveCyclic_fnNewMasterDmaChannel, IPortWaveCyclic_fnNewSlaveDmaChannel, + IPortWaveCyclic_fnNewMasterDmaChannel }; //--------------------------------------------------------------- @@ -514,6 +616,7 @@ This->lpVtbl = &vt_IPortWaveCyclicVtbl; This->lpVtblSubDevice = &vt_ISubdeviceVtbl; + This->lpVtblPortEvents = &vt_IPortEvents; This->ref = 1; *OutPort = (PPORT)(&This->lpVtbl);
15 years, 11 months
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
76
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
Results per page:
10
25
50
100
200