winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
892 discussions
Start a n
N
ew thread
Damjan Jovanovic : winemenubuilder: Use windowscodecs for some ICO to PNG conversion.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: 8404a3d64a5de0525d366b22ea601e0290e7d200 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8404a3d64a5de0525d366b22e…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Thu Jul 22 21:40:14 2010 +0200 winemenubuilder: Use windowscodecs for some ICO to PNG conversion. --- programs/winemenubuilder/Makefile.in | 2 +- programs/winemenubuilder/winemenubuilder.c | 140 +++++++++++++++++++++++++++- 2 files changed, 137 insertions(+), 5 deletions(-) diff --git a/programs/winemenubuilder/Makefile.in b/programs/winemenubuilder/Makefile.in index dd8ba55..ee8a092 100644 --- a/programs/winemenubuilder/Makefile.in +++ b/programs/winemenubuilder/Makefile.in @@ -5,7 +5,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = winemenubuilder.exe APPMODE = -mwindows -municode -IMPORTS = uuid shell32 shlwapi ole32 user32 advapi32 +IMPORTS = uuid windowscodecs shell32 shlwapi ole32 user32 advapi32 EXTRAINCL = @PNGINCL@ C_SRCS = \ diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 7641b91..41a3be3 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -90,6 +90,8 @@ #include <tlhelp32.h> #include <intshcut.h> #include <shlwapi.h> +#include <initguid.h> +#include <wincodec.h> #include "wine/unicode.h" #include "wine/debug.h" @@ -519,6 +521,130 @@ static BOOL SaveIconResAsPNG(const BITMAPINFO *pIcon, const char *png_filename, } #endif /* SONAME_LIBPNG */ +static BOOL SaveIconStreamAsPNG(IStream *icoFile, int index, const char *pngFileName, LPCWSTR commentW) +{ + WCHAR *dosPNGFileName = NULL; + IWICImagingFactory *factory = NULL; + IWICBitmapDecoder *decoder = NULL; + IWICBitmapFrameDecode *sourceFrame = NULL; + IWICBitmapSource *sourceBitmap = NULL; + IWICBitmapEncoder *encoder = NULL; + IStream *outputFile = NULL; + IWICBitmapFrameEncode *dstFrame = NULL; + IPropertyBag2 *options = NULL; + UINT width, height; + HRESULT hr = E_FAIL; + + dosPNGFileName = wine_get_dos_file_name(pngFileName); + if (dosPNGFileName == NULL) + { + WINE_ERR("error converting %s to DOS file name\n", pngFileName); + goto end; + } + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void**)&factory); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X creating IWICImagingFactory\n", hr); + goto end; + } + hr = IWICImagingFactory_CreateDecoderFromStream(factory, icoFile, NULL, + WICDecodeMetadataCacheOnDemand, &decoder); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X creating IWICBitmapDecoder\n", hr); + goto end; + } + hr = IWICBitmapDecoder_GetFrame(decoder, index, &sourceFrame); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X getting frame %d\n", hr, index); + goto end; + } + hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, (IWICBitmapSource*)sourceFrame, &sourceBitmap); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X converting bitmap to 32bppBGRA\n", hr); + goto end; + } + hr = CoCreateInstance(&CLSID_WICPngEncoder, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICBitmapEncoder, (void**)&encoder); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X creating bitmap encoder\n", hr); + goto end; + } + hr = SHCreateStreamOnFileW(dosPNGFileName, STGM_CREATE | STGM_WRITE, &outputFile); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X creating output file\n", hr); + goto end; + } + hr = IWICBitmapEncoder_Initialize(encoder, outputFile, GENERIC_WRITE); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X initializing encoder\n", hr); + goto end; + } + hr = IWICBitmapEncoder_CreateNewFrame(encoder, &dstFrame, &options); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X creating encoder frame\n", hr); + goto end; + } + hr = IWICBitmapFrameEncode_Initialize(dstFrame, options); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X initializing encoder frame\n", hr); + goto end; + } + hr = IWICBitmapSource_GetSize(sourceBitmap, &width, &height); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X getting source bitmap size\n", hr); + goto end; + } + hr = IWICBitmapFrameEncode_SetSize(dstFrame, width, height); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X setting destination bitmap size\n", hr); + goto end; + } + hr = IWICBitmapFrameEncode_SetResolution(dstFrame, 96, 96); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X setting destination bitmap resolution\n", hr); + goto end; + } + hr = IWICBitmapFrameEncode_WriteSource(dstFrame, sourceBitmap, NULL); + if (FAILED(hr)) + { + WINE_ERR("error 0x%08X copying bitmaps\n", hr); + goto end; + } + IWICBitmapFrameEncode_Commit(dstFrame); + IWICBitmapEncoder_Commit(encoder); + hr = S_OK; + +end: + HeapFree(GetProcessHeap(), 0, dosPNGFileName); + if (factory) + IWICImagingFactory_Release(factory); + if (decoder) + IWICBitmapDecoder_Release(decoder); + if (sourceFrame) + IWICBitmapFrameDecode_Release(sourceFrame); + if (sourceBitmap) + IWICBitmapSource_Release(sourceBitmap); + if (encoder) + IWICBitmapEncoder_Release(encoder); + if (outputFile) + IStream_Release(outputFile); + if (dstFrame) + IWICBitmapFrameEncode_Release(dstFrame); + return SUCCEEDED(hr); +} + static BOOL SaveIconResAsXPM(const BITMAPINFO *pIcon, const char *szXPMFileName, LPCWSTR commentW) { FILE *fXPMFile; @@ -756,6 +882,8 @@ static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) void *pIcon = NULL; int i; char *filename = NULL; + IStream *icoStream = NULL; + HRESULT hr; filename = wine_get_unix_file_name(szFileName); if (!(fICOFile = fopen(filename, "r"))) @@ -795,12 +923,13 @@ static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) goto error; if (fread(pIcon, pIconDirEntry[nIndex].dwBytesInRes, 1, fICOFile) != 1) goto error; + fclose(fICOFile); + fICOFile = NULL; + hr = SHCreateStreamOnFileW(szFileName, STGM_READ, &icoStream); /* Prefer PNG over XPM */ -#ifdef SONAME_LIBPNG - if (!SaveIconResAsPNG(pIcon, szXPMFileName, szFileName)) -#endif + if (FAILED(hr) || !SaveIconStreamAsPNG(icoStream, nIndex, szXPMFileName, szFileName)) { memcpy(szXPMFileName + strlen(szXPMFileName) - 3, "xpm", 3); if (!SaveIconResAsXPM(pIcon, szXPMFileName, szFileName)) @@ -809,8 +938,9 @@ static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) HeapFree(GetProcessHeap(), 0, pIcon); HeapFree(GetProcessHeap(), 0, pIconDirEntry); - fclose(fICOFile); HeapFree(GetProcessHeap(), 0, filename); + if (icoStream) + IStream_Release(icoStream); return 1; error: @@ -818,6 +948,8 @@ static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) HeapFree(GetProcessHeap(), 0, pIconDirEntry); if (fICOFile) fclose(fICOFile); HeapFree(GetProcessHeap(), 0, filename); + if (icoStream) + IStream_Release(icoStream); return 0; }
1
0
0
0
Damjan Jovanovic : kernel32: Deal with unix paths in wine_get_dos_file_name .
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: f56be472c65f4ad964fb9fc891824a8441a2d01a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f56be472c65f4ad964fb9fc89…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Thu Jul 22 21:38:59 2010 +0200 kernel32: Deal with unix paths in wine_get_dos_file_name. --- dlls/kernel32/path.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 0e69f91..81467cb 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -1788,10 +1788,15 @@ WCHAR * CDECL wine_get_dos_file_name( LPCSTR str ) SetLastError( RtlNtStatusToDosError( status ) ); return NULL; } - /* get rid of the \??\ prefix */ - /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */ - len = nt_name.Length - 4 * sizeof(WCHAR); - memmove( nt_name.Buffer, nt_name.Buffer + 4, len ); - nt_name.Buffer[len / sizeof(WCHAR)] = 0; + if (nt_name.Buffer[5] == ':') + { + /* get rid of the \??\ prefix */ + /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */ + len = nt_name.Length - 4 * sizeof(WCHAR); + memmove( nt_name.Buffer, nt_name.Buffer + 4, len ); + nt_name.Buffer[len / sizeof(WCHAR)] = 0; + } + else + nt_name.Buffer[1] = '\\'; return nt_name.Buffer; }
1
0
0
0
Damjan Jovanovic : ntdll: Convert even Unix paths outside Wine' s drive mappings to DOS paths.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: 2f877b0a79c5bd7a1b26d7de519f344630ad5e2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f877b0a79c5bd7a1b26d7de5…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Thu Jul 22 21:36:33 2010 +0200 ntdll: Convert even Unix paths outside Wine's drive mappings to DOS paths. --- dlls/ntdll/path.c | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 8b62a3a..3207720 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -1020,6 +1020,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRING *nt ) { static const WCHAR prefixW[] = {'\\','?','?','\\','A',':','\\'}; + static const WCHAR unix_prefixW[] = {'\\','?','?','\\','u','n','i','x'}; unsigned int lenW, lenA = name->Length; const char *path = name->Buffer; char *cwd; @@ -1057,7 +1058,29 @@ NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRIN lenA -= (path - name->Buffer); } - if (status != STATUS_SUCCESS) goto done; + if (status != STATUS_SUCCESS) + { + if (status == STATUS_OBJECT_PATH_NOT_FOUND) + { + lenW = ntdll_umbstowcs( 0, path, lenA, NULL, 0 ); + nt->Buffer = RtlAllocateHeap( GetProcessHeap(), 0, + (lenW + 1) * sizeof(WCHAR) + sizeof(unix_prefixW) ); + if (nt->Buffer == NULL) + { + status = STATUS_NO_MEMORY; + goto done; + } + memcpy( nt->Buffer, unix_prefixW, sizeof(unix_prefixW) ); + ntdll_umbstowcs( 0, path, lenA, nt->Buffer + sizeof(unix_prefixW)/sizeof(WCHAR), lenW ); + lenW += sizeof(unix_prefixW)/sizeof(WCHAR); + nt->Buffer[lenW] = 0; + nt->Length = lenW * sizeof(WCHAR); + nt->MaximumLength = nt->Length + sizeof(WCHAR); + for (p = nt->Buffer + sizeof(unix_prefixW)/sizeof(WCHAR); *p; p++) if (*p == '/') *p = '\\'; + status = STATUS_SUCCESS; + } + goto done; + } while (lenA && path[0] == '/') { lenA--; path++; } lenW = ntdll_umbstowcs( 0, path, lenA, NULL, 0 );
1
0
0
0
David Hedberg : shell32: Implement SHGetIDListFromObject.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: b8a40388ee8d3c763034a32c8c7f29bfdf7edcb2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8a40388ee8d3c763034a32c8…
Author: David Hedberg <david.hedberg(a)gmail.com> Date: Thu Jul 22 20:17:06 2010 +0200 shell32: Implement SHGetIDListFromObject. --- dlls/shell32/pidl.c | 75 ++++++++++++++ dlls/shell32/shell32.spec | 1 + dlls/shell32/tests/shlfolder.c | 219 ++++++++++++++++++++++++++++++++++++++++ include/shobjidl.idl | 1 + 4 files changed, 296 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b8a40388ee8d3c763034a…
1
0
0
0
David Hedberg : shell32: Implement SHGetItemFromDataObject.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: c8c2bc8b4bcd7536c7ad73ae291f899a108a9acc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8c2bc8b4bcd7536c7ad73ae2…
Author: David Hedberg <david.hedberg(a)gmail.com> Date: Thu Jul 22 20:17:05 2010 +0200 shell32: Implement SHGetItemFromDataObject. --- dlls/shell32/shell32.spec | 1 + dlls/shell32/shellitem.c | 98 +++++++++++++++++++++++++++++++++ dlls/shell32/tests/shlfolder.c | 117 ++++++++++++++++++++++++++++++++++++++++ include/shobjidl.idl | 11 ++++ 4 files changed, 227 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c8c2bc8b4bcd7536c7ad7…
1
0
0
0
David Hedberg : shell32: Implement SHCreateItemFromIDList.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: 222d2142ef0161cd1a1b380c95b2a3bd248f3262 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=222d2142ef0161cd1a1b380c9…
Author: David Hedberg <david.hedberg(a)gmail.com> Date: Thu Jul 22 20:17:04 2010 +0200 shell32: Implement SHCreateItemFromIDList. --- dlls/shell32/shell32.spec | 1 + dlls/shell32/shellitem.c | 18 ++++++++++++ dlls/shell32/tests/shlfolder.c | 58 ++++++++++++++++++++++++++++++++++++++++ include/shobjidl.idl | 1 + 4 files changed, 78 insertions(+), 0 deletions(-) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index bb1796d..cc7744d 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -330,6 +330,7 @@ @ stub SHChangeNotifySuspendResume @ stdcall SHCreateDirectoryExA(long str ptr) @ stdcall SHCreateDirectoryExW(long wstr ptr) +@ stdcall SHCreateItemFromIDList(ptr ptr ptr) @ stdcall SHCreateItemFromParsingName(wstr ptr ptr ptr) @ stub SHCreateProcessAsUserW @ stdcall SHCreateShellItem(ptr ptr ptr ptr) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index 762b13b..84a195f 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -419,3 +419,21 @@ HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, } return ret; } + +HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv) +{ + ShellItem *psiimpl; + HRESULT ret; + + if(!pidl) + return E_INVALIDARG; + + ret = IShellItem_Constructor(NULL, riid, ppv); + if(SUCCEEDED(ret)) + { + psiimpl = (ShellItem*)*ppv; + psiimpl->pidl = ILClone(pidl); + } + + return ret; +} diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 10838e6..7eda991 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -53,6 +53,7 @@ static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT); static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST); static void (WINAPI *pILFree)(LPITEMIDLIST); static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); +static HRESULT (WINAPI *pSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv); static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**); static HRESULT (WINAPI *pSHCreateShellItem)(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**); static LPITEMIDLIST (WINAPI *pILCombine)(LPCITEMIDLIST,LPCITEMIDLIST); @@ -70,6 +71,7 @@ static void init_function_pointers(void) #define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f)) MAKEFUNC(SHBindToParent); + MAKEFUNC(SHCreateItemFromIDList); MAKEFUNC(SHCreateItemFromParsingName); MAKEFUNC(SHCreateShellItem); MAKEFUNC(SHGetFolderPathA); @@ -2079,6 +2081,62 @@ static void test_SHCreateShellItem(void) else win_skip("No SHCreateItemFromParsingName\n"); + + /* SHCreateItemFromIDList */ + if(pSHCreateItemFromIDList) + { + if(0) + { + /* Crashes under win7 */ + ret = pSHCreateItemFromIDList(NULL, &IID_IShellItem, NULL); + } + + ret = pSHCreateItemFromIDList(NULL, &IID_IShellItem, (void**)&shellitem); + ok(ret == E_INVALIDARG, "SHCreateItemFromIDList returned %x\n", ret); + + ret = pSHCreateItemFromIDList(pidl_cwd, &IID_IShellItem, (void**)&shellitem); + ok(ret == S_OK, "SHCreateItemFromIDList returned %x\n", ret); + if (SUCCEEDED(ret)) + { + ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (void**)&persistidl); + ok(ret == S_OK, "QueryInterface returned %x\n", ret); + if (SUCCEEDED(ret)) + { + ret = IPersistIDList_GetIDList(persistidl, &pidl_test); + ok(ret == S_OK, "GetIDList returned %x\n", ret); + if (SUCCEEDED(ret)) + { + ok(ILIsEqual(pidl_cwd, pidl_test), "id lists are not equal\n"); + pILFree(pidl_test); + } + IPersistIDList_Release(persistidl); + } + IShellItem_Release(shellitem); + } + + ret = pSHCreateItemFromIDList(pidl_testfile, &IID_IShellItem, (void**)&shellitem); + ok(ret == S_OK, "SHCreateItemFromIDList returned %x\n", ret); + if (SUCCEEDED(ret)) + { + ret = IShellItem_QueryInterface(shellitem, &IID_IPersistIDList, (void**)&persistidl); + ok(ret == S_OK, "QueryInterface returned %x\n", ret); + if (SUCCEEDED(ret)) + { + ret = IPersistIDList_GetIDList(persistidl, &pidl_test); + ok(ret == S_OK, "GetIDList returned %x\n", ret); + if (SUCCEEDED(ret)) + { + ok(ILIsEqual(pidl_testfile, pidl_test), "id lists are not equal\n"); + pILFree(pidl_test); + } + IPersistIDList_Release(persistidl); + } + IShellItem_Release(shellitem); + } + } + else + win_skip("No SHCreateItemFromIDList\n"); + DeleteFileA(".\\testfile"); pILFree(pidl_abstestfile); pILFree(pidl_testfile); diff --git a/include/shobjidl.idl b/include/shobjidl.idl index 60c0f18..d79c932 100644 --- a/include/shobjidl.idl +++ b/include/shobjidl.idl @@ -496,6 +496,7 @@ interface IShellItemArray : IUnknown cpp_quote("HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);") cpp_quote("HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv);") +cpp_quote("HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);") /***************************************************************************** * IShellItemFilter interface
1
0
0
0
David Hedberg : shell32: Implement SHCreateItemFromParsingName.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: 5b0b56fac404bf0d2b6523de29a48a5a3e917779 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b0b56fac404bf0d2b6523de2…
Author: David Hedberg <david.hedberg(a)gmail.com> Date: Thu Jul 22 20:17:03 2010 +0200 shell32: Implement SHCreateItemFromParsingName. --- dlls/shell32/shell32.spec | 1 + dlls/shell32/shellitem.c | 27 ++++++++++++++++++++++++ dlls/shell32/tests/shlfolder.c | 44 ++++++++++++++++++++++++++++++++++++++++ include/shobjidl.idl | 1 + 4 files changed, 73 insertions(+), 0 deletions(-) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 07f97af..bb1796d 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -330,6 +330,7 @@ @ stub SHChangeNotifySuspendResume @ stdcall SHCreateDirectoryExA(long str ptr) @ stdcall SHCreateDirectoryExW(long wstr ptr) +@ stdcall SHCreateItemFromParsingName(wstr ptr ptr ptr) @ stub SHCreateProcessAsUserW @ stdcall SHCreateShellItem(ptr ptr ptr ptr) @ stdcall SHEmptyRecycleBinA(long str long) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index ae6de18..762b13b 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -392,3 +392,30 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, } return ret; } + +HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, + IBindCtx *pbc, REFIID riid, void **ppv) +{ + LPITEMIDLIST pidl; + HRESULT ret; + + *ppv = NULL; + + ret = SHParseDisplayName(pszPath, pbc, &pidl, 0, NULL); + if(SUCCEEDED(ret)) + { + ShellItem *This; + ret = IShellItem_Constructor(NULL, riid, (void**)&This); + + if(SUCCEEDED(ret)) + { + This->pidl = pidl; + *ppv = (void*)This; + } + else + { + ILFree(pidl); + } + } + return ret; +} diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 1027184..10838e6 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -53,6 +53,7 @@ static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT); static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST); static void (WINAPI *pILFree)(LPITEMIDLIST); static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); +static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**); static HRESULT (WINAPI *pSHCreateShellItem)(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**); static LPITEMIDLIST (WINAPI *pILCombine)(LPCITEMIDLIST,LPCITEMIDLIST); static HRESULT (WINAPI *pSHParseDisplayName)(LPCWSTR,IBindCtx*,LPITEMIDLIST*,SFGAOF,SFGAOF*); @@ -69,6 +70,7 @@ static void init_function_pointers(void) #define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f)) MAKEFUNC(SHBindToParent); + MAKEFUNC(SHCreateItemFromParsingName); MAKEFUNC(SHCreateShellItem); MAKEFUNC(SHGetFolderPathA); MAKEFUNC(SHGetFolderPathAndSubDirA); @@ -1867,6 +1869,7 @@ static void test_SHCreateShellItem(void) HRESULT ret; char curdirA[MAX_PATH]; WCHAR curdirW[MAX_PATH]; + WCHAR fnbufW[MAX_PATH]; IShellFolder *desktopfolder=NULL, *currentfolder=NULL; static WCHAR testfileW[] = {'t','e','s','t','f','i','l','e',0}; @@ -2035,6 +2038,47 @@ static void test_SHCreateShellItem(void) IShellItem_Release(shellitem); } + /* SHCreateItemFromParsingName */ + if(pSHCreateItemFromParsingName) + { + if(0) + { + /* Crashes under windows 7 */ + ret = pSHCreateItemFromParsingName(NULL, NULL, &IID_IShellItem, NULL); + } + + shellitem = (void*)0xdeadbeef; + ret = pSHCreateItemFromParsingName(NULL, NULL, &IID_IShellItem, (void**)&shellitem); + ok(ret == E_INVALIDARG, "SHCreateItemFromParsingName returned %x\n", ret); + ok(shellitem == NULL, "shellitem was %p.\n", shellitem); + + ret = pSHCreateItemFromParsingName(testfileW, NULL, &IID_IShellItem, (void**)&shellitem); + ok(ret == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), + "SHCreateItemFromParsingName returned %x\n", ret); + if(SUCCEEDED(ret)) IShellItem_Release(shellitem); + + lstrcpyW(fnbufW, curdirW); + myPathAddBackslashW(fnbufW); + lstrcatW(fnbufW, testfileW); + + ret = pSHCreateItemFromParsingName(fnbufW, NULL, &IID_IShellItem, (void**)&shellitem); + ok(ret == S_OK, "SHCreateItemFromParsingName returned %x\n", ret); + if(SUCCEEDED(ret)) + { + LPWSTR tmp_fname; + ret = IShellItem_GetDisplayName(shellitem, SIGDN_FILESYSPATH, &tmp_fname); + ok(ret == S_OK, "GetDisplayName returned %x\n", ret); + if(SUCCEEDED(ret)) + { + ok(!lstrcmpW(fnbufW, tmp_fname), "strings not equal\n"); + CoTaskMemFree(tmp_fname); + } + IShellItem_Release(shellitem); + } + } + else + win_skip("No SHCreateItemFromParsingName\n"); + DeleteFileA(".\\testfile"); pILFree(pidl_abstestfile); pILFree(pidl_testfile); diff --git a/include/shobjidl.idl b/include/shobjidl.idl index be85fbb..60c0f18 100644 --- a/include/shobjidl.idl +++ b/include/shobjidl.idl @@ -495,6 +495,7 @@ interface IShellItemArray : IUnknown } cpp_quote("HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);") +cpp_quote("HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv);") /***************************************************************************** * IShellItemFilter interface
1
0
0
0
David Hedberg : shell32: Implement SHGetNameFromIDList and IShellItem:: GetDisplayName.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: b43bcdf524e9f6105c0ce70da02581e2c43a52e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b43bcdf524e9f6105c0ce70da…
Author: David Hedberg <david.hedberg(a)gmail.com> Date: Thu Jul 22 20:17:02 2010 +0200 shell32: Implement SHGetNameFromIDList and IShellItem::GetDisplayName. --- dlls/shell32/pidl.c | 62 +++++++++++++++ dlls/shell32/shell32.spec | 1 + dlls/shell32/shellitem.c | 7 +- dlls/shell32/tests/shlfolder.c | 162 ++++++++++++++++++++++++++++++++++++++-- include/shobjidl.idl | 2 + 5 files changed, 223 insertions(+), 11 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b43bcdf524e9f6105c0ce…
1
0
0
0
Rico Schüller : d3d10: Add a stub ID3D10ReflectShader implementation.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: 0d18e35b28a44a0796c9e90b28922f8aaadd77e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d18e35b28a44a0796c9e90b2…
Author: Rico Schüller <kgbricola(a)web.de> Date: Wed Jul 21 20:44:59 2010 +0200 d3d10: Add a stub ID3D10ReflectShader implementation. --- dlls/d3d10/Makefile.in | 1 + dlls/d3d10/d3d10.spec | 2 +- dlls/d3d10/d3d10_main.c | 23 ++++++++ dlls/d3d10/d3d10_private.h | 8 +++ dlls/d3d10/shader.c | 135 ++++++++++++++++++++++++++++++++++++++++++++ include/d3d10shader.h | 2 + 6 files changed, 170 insertions(+), 1 deletions(-) diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in index c872984..79b2bbc 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/d3d10/Makefile.in @@ -9,6 +9,7 @@ IMPORTS = dxguid uuid d3d10core dxgi C_SRCS = \ d3d10_main.c \ effect.c \ + shader.c \ utils.c RC_SRCS = version.rc diff --git a/dlls/d3d10/d3d10.spec b/dlls/d3d10/d3d10.spec index 86e1236..97ac7a9 100644 --- a/dlls/d3d10/d3d10.spec +++ b/dlls/d3d10/d3d10.spec @@ -17,7 +17,7 @@ @ stub D3D10GetVersion @ stdcall D3D10GetVertexShaderProfile(ptr) @ stub D3D10PreprocessShader -@ stub D3D10ReflectShader +@ stdcall D3D10ReflectShader(ptr long ptr) @ stub D3D10RegisterLayers @ stub D3D10StateBlockMaskDifference @ stub D3D10StateBlockMaskDisableAll diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index 65ce1e0..2c07bb3 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -262,3 +262,26 @@ LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device) return "ps_4_0"; } + +HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector) +{ + struct d3d10_shader_reflection *object; + + FIXME("data %p, data_size %lu, reflector %p stub!\n", data, data_size, reflector); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + { + ERR("Failed to allocate D3D10 shader reflection object memory\n"); + return E_OUTOFMEMORY; + } + + object->vtbl = &d3d10_shader_reflection_vtbl; + object->refcount = 1; + + *reflector = (ID3D10ShaderReflection *)object; + + TRACE("Created ID3D10ShaderReflection %p\n", object); + + return S_OK; +} diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 2e31f29..77a3529 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -212,6 +212,14 @@ struct d3d10_effect struct d3d10_effect_technique *techniques; }; +/* ID3D10ShaderReflection */ +extern const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl DECLSPEC_HIDDEN; +struct d3d10_shader_reflection +{ + const struct ID3D10ShaderReflectionVtbl *vtbl; + LONG refcount; +}; + HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T data_size) DECLSPEC_HIDDEN; /* D3D10Core */ diff --git a/dlls/d3d10/shader.c b/dlls/d3d10/shader.c new file mode 100644 index 0000000..d5d9e16 --- /dev/null +++ b/dlls/d3d10/shader.c @@ -0,0 +1,135 @@ +/* + * Copyright 2009 Henri Verbeet for CodeWeavers + * Copyright 2010 Rico Schüller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "d3d10_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d10); + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_QueryInterface(ID3D10ShaderReflection *iface, REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D10ShaderReflection) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IUnknown_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_AddRef(ID3D10ShaderReflection *iface) +{ + struct d3d10_shader_reflection *This = (struct d3d10_shader_reflection *)iface; + ULONG refcount = InterlockedIncrement(&This->refcount); + + TRACE("%p increasing refcount to %u\n", This, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_Release(ID3D10ShaderReflection *iface) +{ + struct d3d10_shader_reflection *This = (struct d3d10_shader_reflection *)iface; + ULONG refcount = InterlockedDecrement(&This->refcount); + + TRACE("%p decreasing refcount to %u\n", This, refcount); + + if (!refcount) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return refcount; +} + +/* ID3D10ShaderReflection methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderReflection *iface, D3D10_SHADER_DESC *desc) +{ + FIXME("iface %p, desc %p stub!\n", iface, desc); + + return E_NOTIMPL; +} + +static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByIndex( + ID3D10ShaderReflection *iface, UINT index) +{ + FIXME("iface %p, index %u stub!\n", iface, index); + + return NULL; +} + +static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByName( + ID3D10ShaderReflection *iface, LPCSTR name) +{ + FIXME("iface %p, name \"%s\" stub!\n", iface, name); + + return NULL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetResourceBindingDesc( + ID3D10ShaderReflection *iface, UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) +{ + FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetInputParameterDesc( + ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) +{ + FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetOutputParameterDesc( + ID3D10ShaderReflection *iface, UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) +{ + FIXME("iface %p, index %u, desc %p stub!\n", iface, index, desc); + + return E_NOTIMPL; +} + +const struct ID3D10ShaderReflectionVtbl d3d10_shader_reflection_vtbl = +{ + /* IUnknown methods */ + d3d10_shader_reflection_QueryInterface, + d3d10_shader_reflection_AddRef, + d3d10_shader_reflection_Release, + /* ID3D10Effect methods */ + d3d10_shader_reflection_GetDesc, + d3d10_shader_reflection_GetConstantBufferByIndex, + d3d10_shader_reflection_GetConstantBufferByName, + d3d10_shader_reflection_GetResourceBindingDesc, + d3d10_shader_reflection_GetInputParameterDesc, + d3d10_shader_reflection_GetOutputParameterDesc, +}; diff --git a/include/d3d10shader.h b/include/d3d10shader.h index 728028c..7885bbd 100644 --- a/include/d3d10shader.h +++ b/include/d3d10shader.h @@ -277,4 +277,6 @@ LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device); LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device); LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device); +HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector); + #endif /* __WINE_D3D10SHADER_H */
1
0
0
0
Rico Schüller : d3d10: Add the ID3D10ShaderReflection interface.
by Alexandre Julliard
23 Jul '10
23 Jul '10
Module: wine Branch: master Commit: d2469219ac437372fa810f7796607ea903d74085 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2469219ac437372fa810f779…
Author: Rico Schüller <kgbricola(a)web.de> Date: Wed Jul 21 20:44:55 2010 +0200 d3d10: Add the ID3D10ShaderReflection interface. --- include/d3d10shader.h | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 81 insertions(+), 0 deletions(-) diff --git a/include/d3d10shader.h b/include/d3d10shader.h index fef32e7..728028c 100644 --- a/include/d3d10shader.h +++ b/include/d3d10shader.h @@ -82,6 +82,14 @@ typedef enum _D3D10_SHADER_VARIABLE_TYPE D3D10_SVT_FORCE_DWORD = 0x7fffffff } D3D10_SHADER_VARIABLE_TYPE, *LPD3D10_SHADER_VARIABLE_TYPE; +typedef enum _D3D10_SHADER_INPUT_TYPE +{ + D3D10_SIT_CBUFFER = 0, + D3D10_SIT_TBUFFER = 1, + D3D10_SIT_TEXTURE = 2, + D3D10_SIT_SAMPLER = 3 +} D3D10_SHADER_INPUT_TYPE, *LPD3D10_SHADER_INPUT_TYPE; + typedef enum D3D10_CBUFFER_TYPE { D3D10_CT_CBUFFER = 0, @@ -119,6 +127,28 @@ typedef struct _D3D10_SHADER_MACRO LPCSTR Definition; } D3D10_SHADER_MACRO, *LPD3D10_SHADER_MACRO; +typedef enum D3D10_RESOURCE_RETURN_TYPE +{ + D3D10_RETURN_TYPE_UNORM = 1, + D3D10_RETURN_TYPE_SNORM = 2, + D3D10_RETURN_TYPE_SINT = 3, + D3D10_RETURN_TYPE_UINT = 4, + D3D10_RETURN_TYPE_FLOAT = 5, + D3D10_RETURN_TYPE_MIXED = 6 +} D3D10_RESOURCE_RETURN_TYPE; + +typedef struct _D3D10_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; + D3D10_SHADER_INPUT_TYPE Type; + UINT BindPoint; + UINT BindCount; + UINT uFlags; + D3D10_RESOURCE_RETURN_TYPE ReturnType; + D3D10_SRV_DIMENSION Dimension; + UINT NumSamples; +} D3D10_SHADER_INPUT_BIND_DESC; + typedef struct _D3D10_SIGNATURE_PARAMETER_DESC { LPCSTR SemanticName; @@ -130,6 +160,38 @@ typedef struct _D3D10_SIGNATURE_PARAMETER_DESC BYTE ReadWriteMask; } D3D10_SIGNATURE_PARAMETER_DESC; +typedef struct _D3D10_SHADER_DESC +{ + UINT Version; + LPCSTR Creator; + UINT Flags; + UINT ConstantBuffers; + UINT BoundResources; + UINT InputParameters; + UINT OutputParameters; + UINT InstructionCount; + UINT TempRegisterCount; + UINT TempArrayCount; + UINT DefCount; + UINT DclCount; + UINT TextureNormalInstructions; + UINT TextureLoadInstructions; + UINT TextureCompInstructions; + UINT TextureBiasInstructions; + UINT TextureGradientInstructions; + UINT FloatInstructionCount; + UINT IntInstructionCount; + UINT UintInstructionCount; + UINT StaticFlowControlCount; + UINT DynamicFlowControlCount; + UINT MacroInstructionCount; + UINT ArrayInstructionCount; + UINT CutInstructionCount; + UINT EmitInstructionCount; + D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; + UINT GSMaxOutputVertexCount; +} D3D10_SHADER_DESC; + typedef struct _D3D10_SHADER_BUFFER_DESC { LPCSTR Name; @@ -192,6 +254,25 @@ DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer) }; #undef INTERFACE +DEFINE_GUID(IID_ID3D10ShaderReflection, 0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa); + +#define INTERFACE ID3D10ShaderReflection +DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown) +{ + /* IUnknown methods */ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /* ID3D10ShaderReflection methods */ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *desc) PURE; + STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE; + STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE; + STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) PURE; + STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE; +}; +#undef INTERFACE + LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device); LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device); LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device);
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200