From e1da1d086c47ffb0a5d5164a5deeeb6330a124d0 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Thu, 27 Dec 2007 15:55:06 +0100 Subject: [PATCH] push 2a0daadedf3e892c0317692dc48ba3bbde299123 --- dlls/d3d9/tests/device.c | 38 +-- dlls/gdi32/tests/font.c | 3 +- dlls/msi/table.c | 2 +- dlls/shell32/Makefile.in | 1 + dlls/shell32/pidl.c | 6 + dlls/shell32/pidl.h | 1 + dlls/shell32/shell32_main.h | 1 + dlls/shell32/shellole.c | 1 + dlls/shell32/shfldr_netplaces.c | 656 ++++++++++++++++++++++++++++++++++++++++ dlls/shell32/shres.rc | 4 + dlls/wined3d/state.c | 30 +- dlls/wined3d/surface.c | 6 +- programs/explorer/hal.c | 14 +- programs/rpcss/np_server.c | 2 + server/async.c | 1 + tools/sfnt2fnt.c | 4 +- 16 files changed, 722 insertions(+), 48 deletions(-) create mode 100644 dlls/shell32/shfldr_netplaces.c diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index a5a2f06bc05..94056736c89 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1662,7 +1662,7 @@ static void test_set_stream_source(void) IDirect3D9 *d3d9; HWND hwnd; HRESULT hr; - IDirect3DVertexBuffer9 *pVertexBuffer; + IDirect3DVertexBuffer9 *pVertexBuffer = NULL; d3d9 = pDirect3DCreate9( D3D_SDK_VERSION ); ok(d3d9 != NULL, "Failed to create IDirect3D9 object\n"); @@ -1692,23 +1692,23 @@ static void test_set_stream_source(void) hr = IDirect3DDevice9_CreateVertexBuffer( device, 512, 0, 0, D3DPOOL_DEFAULT, &pVertexBuffer, NULL ); ok(hr == D3D_OK, "Failed to create a vertex buffer, hr = %s\n", DXGetErrorString9(hr)); - - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 0, 32); - ok(hr == D3D_OK, "Failed to set the stream source, offset 0, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 1, 32); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 1, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 2, 32); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 2, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 3, 32); - ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 3, hr = %s\n", - DXGetErrorString9(hr)); - hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 4, 32); - ok(hr == D3D_OK, "Failed to set the stream source, offset 4, hr = %s\n", - DXGetErrorString9(hr)); - + if (SUCCEEDED(hr)) { + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 0, 32); + ok(hr == D3D_OK, "Failed to set the stream source, offset 0, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 1, 32); + ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 1, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 2, 32); + ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 2, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 3, 32); + ok(hr == D3DERR_INVALIDCALL, "Unexpected result when setting the stream source, offset 3, hr = %s\n", + DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetStreamSource(device, 0, pVertexBuffer, 4, 32); + ok(hr == D3D_OK, "Failed to set the stream source, offset 4, hr = %s\n", + DXGetErrorString9(hr)); + } /* Try to set the NULL buffer with an offset and stride 0 */ hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); ok(hr == D3D_OK, "Failed to set the stream source, offset 0, hr = %s\n", @@ -1729,8 +1729,8 @@ static void test_set_stream_source(void) hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); ok(hr == D3D_OK, "Failed to set the stream source, offset 4, hr = %s\n", DXGetErrorString9(hr)); - cleanup: if(pVertexBuffer) IDirect3DDevice9_Release(pVertexBuffer); +cleanup: if(device) IDirect3DDevice9_Release(device); if(d3d9) IDirect3D9_Release(d3d9); } diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 0893b87dfa2..d38ec8da2d7 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -347,8 +347,7 @@ static void test_bitmap_font_metrics(void) { "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, CP1251_BIT }, { "Small Fonts", FW_NORMAL, 10, 8, 2, 0, 0, 6, 12, CP932_BIT }, { "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, CP1252_BIT | CP1250_BIT | CP1251_BIT }, -/* No proper small font for Japanese yet */ -/* { "Small Fonts", FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, CP932_BIT }, */ + { "Small Fonts", FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, CP932_BIT }, { "Fixedsys", FW_NORMAL, 15, 12, 3, 3, 0, 8, 8, CP1252_BIT | CP1250_BIT }, { "Fixedsys", FW_NORMAL, 16, 12, 4, 3, 0, 8, 8, CP1251_BIT }, { "FixedSys", FW_NORMAL, 18, 16, 2, 0, 0, 8, 16, CP932_BIT } diff --git a/dlls/msi/table.c b/dlls/msi/table.c index ca6fa1b911e..e5ad1aff978 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -189,7 +189,7 @@ LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) if( next && (next<0x80) ) { next = utf2mime(next); - if( next >= 0 ) + if( next != -1 ) { next += 0x3ffffc0; ch += (next<<6); diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index 0da3e95d759..583b0f7a2d6 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -38,6 +38,7 @@ C_SRCS = \ shfldr_desktop.c \ shfldr_fs.c \ shfldr_mycomp.c \ + shfldr_netplaces.c \ shfldr_unixfs.c \ shlexec.c \ shlfileop.c \ diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 6bb77387dae..d37cde12eb2 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -1429,6 +1429,12 @@ LPITEMIDLIST _ILCreateBitBucket(void) return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin); } +LPITEMIDLIST _ILCreateNetHood(void) +{ + TRACE("()\n"); + return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces); +} + LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, REFIID guid) { LPITEMIDLIST pidlOut; diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index 010947c19cb..4b4de7b4223 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -252,6 +252,7 @@ LPITEMIDLIST _ILCreateIExplore (void); LPITEMIDLIST _ILCreateControlPanel (void); LPITEMIDLIST _ILCreatePrinters (void); LPITEMIDLIST _ILCreateNetwork (void); +LPITEMIDLIST _ILCreateNetHood (void); LPITEMIDLIST _ILCreateBitBucket (void); LPITEMIDLIST _ILCreateDrive (LPCWSTR); diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index cd480726e52..ec8bfac5926 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -90,6 +90,7 @@ HRESULT WINAPI IShellLink_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv); HRESULT WINAPI ISF_Desktop_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); +HRESULT WINAPI ISF_NetworkPlaces_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV); HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index d3fb7c3e4ad..64b00248111 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -64,6 +64,7 @@ static const struct { } InterfaceTable[] = { {&CLSID_ShellFSFolder, &IFSFolder_Constructor}, {&CLSID_MyComputer, &ISF_MyComputer_Constructor}, + {&CLSID_NetworkPlaces, &ISF_NetworkPlaces_Constructor}, {&CLSID_ShellDesktop, &ISF_Desktop_Constructor}, {&CLSID_ShellLink, &IShellLink_Constructor}, {&CLSID_DragDropHelper, &IDropTargetHelper_Constructor}, diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c new file mode 100644 index 00000000000..1216341d8ee --- /dev/null +++ b/dlls/shell32/shfldr_netplaces.c @@ -0,0 +1,656 @@ +/* + * Network Places (Neighbourhood) folder + * + * Copyright 1997 Marcus Meissner + * Copyright 1998, 1999, 2002 Juergen Schmied + * Copyright 2003 Mike McCormack for Codeweavers + * + * 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 +#include +#include +#include + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winreg.h" + +#include "pidl.h" +#include "enumidlist.h" +#include "undocshell.h" +#include "shell32_main.h" +#include "shresdef.h" +#include "wine/debug.h" +#include "debughlp.h" +#include "shfldr.h" + +WINE_DEFAULT_DEBUG_CHANNEL (shell); + +/*********************************************************************** +* IShellFolder implementation +*/ + +typedef struct { + const IShellFolder2Vtbl *lpVtbl; + LONG ref; + const IPersistFolder2Vtbl *lpVtblPersistFolder2; + + /* both paths are parsible from the desktop */ + LPITEMIDLIST pidlRoot; /* absolute pidl */ +} IGenericSFImpl; + +static const IShellFolder2Vtbl vt_ShellFolder2; +static const IPersistFolder2Vtbl vt_NP_PersistFolder2; + + +#define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2))) +#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset); + +#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) +#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) +#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) + +static shvheader NetworkPlacesSFHeader[] = { + {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, + {IDS_SHV_COLUMN9, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10} +}; + +#define NETWORKPLACESSHELLVIEWCOLUMNS 2 + +/************************************************************************** +* ISF_NetworkPlaces_Constructor +*/ +HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + IGenericSFImpl *sf; + + TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid)); + + if (!ppv) + return E_POINTER; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + sf = (IGenericSFImpl *) HeapAlloc ( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl)); + if (!sf) + return E_OUTOFMEMORY; + + sf->ref = 0; + sf->lpVtbl = &vt_ShellFolder2; + sf->lpVtblPersistFolder2 = &vt_NP_PersistFolder2; + sf->pidlRoot = _ILCreateNetHood(); /* my qualified pidl */ + + if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) + { + IUnknown_Release (_IUnknown_ (sf)); + return E_NOINTERFACE; + } + + TRACE ("--(%p)\n", sf); + return S_OK; +} + +/************************************************************************** + * ISF_NetworkPlaces_fnQueryInterface + * + * NOTE + * supports not IPersist/IPersistFolder + */ +static HRESULT WINAPI ISF_NetworkPlaces_fnQueryInterface (IShellFolder2 *iface, REFIID riid, LPVOID *ppvObj) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj); + + *ppvObj = NULL; + + if (IsEqualIID (riid, &IID_IUnknown) || + IsEqualIID (riid, &IID_IShellFolder) || + IsEqualIID (riid, &IID_IShellFolder2)) + { + *ppvObj = This; + } + else if (IsEqualIID (riid, &IID_IPersist) || + IsEqualIID (riid, &IID_IPersistFolder) || + IsEqualIID (riid, &IID_IPersistFolder2)) + { + *ppvObj = _IPersistFolder2_ (This); + } + + if (*ppvObj) + { + IUnknown_AddRef ((IUnknown *) (*ppvObj)); + TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); + return S_OK; + } + TRACE ("-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ISF_NetworkPlaces_fnAddRef (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + TRACE ("(%p)->(count=%u)\n", This, refCount - 1); + + return refCount; +} + +static ULONG WINAPI ISF_NetworkPlaces_fnRelease (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE ("(%p)->(count=%u)\n", This, refCount + 1); + + if (!refCount) { + TRACE ("-- destroying IShellFolder(%p)\n", This); + SHFree (This->pidlRoot); + HeapFree (GetProcessHeap(), 0, This); + } + return refCount; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnParseDisplayName +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * iface, + HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, + DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + HRESULT hr = E_UNEXPECTED; + + TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This, + hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), + pchEaten, ppidl, pdwAttributes); + + *ppidl = 0; + if (pchEaten) + *pchEaten = 0; /* strange but like the original */ + + TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr); + + return hr; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnEnumObjects +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnEnumObjects (IShellFolder2 * iface, + HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This, + hwndOwner, dwFlags, ppEnumIDList); + + *ppEnumIDList = IEnumIDList_Constructor(); + + TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList); + + return (*ppEnumIDList) ? S_OK : E_OUTOFMEMORY; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnBindToObject +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnBindToObject (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, + pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); + + return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut); +} + +/************************************************************************** +* ISF_NetworkPlaces_fnBindToStorage +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnBindToStorage (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, + pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); + + *ppvOut = NULL; + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnCompareIDs +*/ + +static HRESULT WINAPI ISF_NetworkPlaces_fnCompareIDs (IShellFolder2 * iface, + LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + int nReturn; + + TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); + nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2); + TRACE ("-- %i\n", nReturn); + return nReturn; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnCreateViewObject +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnCreateViewObject (IShellFolder2 * iface, + HWND hwndOwner, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + LPSHELLVIEW pShellView; + HRESULT hr = E_INVALIDARG; + + TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, + hwndOwner, shdebugstr_guid (riid), ppvOut); + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IDropTarget)) + { + WARN ("IDropTarget not implemented\n"); + hr = E_NOTIMPL; + } + else if (IsEqualIID (riid, &IID_IContextMenu)) + { + WARN ("IContextMenu not implemented\n"); + hr = E_NOTIMPL; + } + else if (IsEqualIID (riid, &IID_IShellView)) + { + pShellView = IShellView_Constructor ((IShellFolder *) iface); + if (pShellView) + { + hr = IShellView_QueryInterface (pShellView, riid, ppvOut); + IShellView_Release (pShellView); + } + } + TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut); + return hr; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnGetAttributesOf +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface, + UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + HRESULT hr = S_OK; + + TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This, + cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); + + if (!rgfInOut) + return E_INVALIDARG; + if (cidl && !apidl) + return E_INVALIDARG; + + if (*rgfInOut == 0) + *rgfInOut = ~0; + + if (cidl == 0) + { + IShellFolder *psfParent = NULL; + LPCITEMIDLIST rpidl = NULL; + + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); + if(SUCCEEDED(hr)) + { + SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); + IShellFolder_Release(psfParent); + } + } + else + { + while (cidl > 0 && *apidl) + { + pdump (*apidl); + SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut); + apidl++; + cidl--; + } + } + + /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ + *rgfInOut &= ~SFGAO_VALIDATE; + + TRACE ("-- result=0x%08x\n", *rgfInOut); + return hr; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnGetUIObjectOf +* +* PARAMETERS +* hwndOwner [in] Parent window for any output +* cidl [in] array size +* apidl [in] simple pidl array +* riid [in] Requested Interface +* prgfInOut [ ] reserved +* ppvObject [out] Resulting Interface +* +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnGetUIObjectOf (IShellFolder2 * iface, + HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, + UINT * prgfInOut, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + LPITEMIDLIST pidl; + IUnknown *pObj = NULL; + HRESULT hr = E_INVALIDARG; + + TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This, + hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut); + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) + { + pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) + { + pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) + { + hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj); + } + else + hr = E_NOINTERFACE; + + if (SUCCEEDED(hr) && !pObj) + hr = E_OUTOFMEMORY; + + *ppvOut = pObj; + TRACE ("(%p)->hr=0x%08x\n", This, hr); + return hr; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnGetDisplayNameOf +* +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnGetDisplayNameOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet); + pdump (pidl); + + if (!strRet) + return E_INVALIDARG; + + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_NetworkPlaces_fnSetNameOf +* Changes the name of a file object or subfolder, possibly changing its item +* identifier in the process. +* +* PARAMETERS +* hwndOwner [in] Owner window for output +* pidl [in] simple pidl of item to change +* lpszName [in] the items new display name +* dwFlags [in] SHGNO formatting flags +* ppidlOut [out] simple pidl returned +*/ +static HRESULT WINAPI ISF_NetworkPlaces_fnSetNameOf (IShellFolder2 * iface, + HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */ + LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, + hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut); + return E_FAIL; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID ( + IShellFolder2 * iface, GUID * pguid) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnEnumSearches (IShellFolder2 * iface, + IEnumExtraSearch ** ppenum) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumn (IShellFolder2 * iface, + DWORD dwRes, ULONG * pSort, ULONG * pDisplay) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)\n", This); + + if (pSort) + *pSort = 0; + if (pDisplay) + *pDisplay = 0; + + return S_OK; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultColumnState ( + IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)\n", This); + + if (!pcsFlags || iColumn >= NETWORKPLACESSHELLVIEWCOLUMNS) + return E_INVALIDARG; + *pcsFlags = NetworkPlacesSFHeader[iColumn].pcsFlags; + return S_OK; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsEx (IShellFolder2 * iface, + LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnGetDetailsOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_NetworkPlaces_fnMapColumnToSCID (IShellFolder2 * iface, + UINT column, SHCOLUMNID * pscid) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)\n", This); + + return E_NOTIMPL; +} + +static const IShellFolder2Vtbl vt_ShellFolder2 = { + ISF_NetworkPlaces_fnQueryInterface, + ISF_NetworkPlaces_fnAddRef, + ISF_NetworkPlaces_fnRelease, + ISF_NetworkPlaces_fnParseDisplayName, + ISF_NetworkPlaces_fnEnumObjects, + ISF_NetworkPlaces_fnBindToObject, + ISF_NetworkPlaces_fnBindToStorage, + ISF_NetworkPlaces_fnCompareIDs, + ISF_NetworkPlaces_fnCreateViewObject, + ISF_NetworkPlaces_fnGetAttributesOf, + ISF_NetworkPlaces_fnGetUIObjectOf, + ISF_NetworkPlaces_fnGetDisplayNameOf, + ISF_NetworkPlaces_fnSetNameOf, + /* ShellFolder2 */ + ISF_NetworkPlaces_fnGetDefaultSearchGUID, + ISF_NetworkPlaces_fnEnumSearches, + ISF_NetworkPlaces_fnGetDefaultColumn, + ISF_NetworkPlaces_fnGetDefaultColumnState, + ISF_NetworkPlaces_fnGetDetailsEx, + ISF_NetworkPlaces_fnGetDetailsOf, + ISF_NetworkPlaces_fnMapColumnToSCID +}; + +/************************************************************************ + * INPFldr_PersistFolder2_QueryInterface + */ +static HRESULT WINAPI INPFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface, + REFIID iid, LPVOID * ppvObj) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)\n", This); + + return IUnknown_QueryInterface (_IUnknown_ (This), iid, ppvObj); +} + +/************************************************************************ + * INPFldr_PersistFolder2_AddRef + */ +static ULONG WINAPI INPFldr_PersistFolder2_AddRef (IPersistFolder2 * iface) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_AddRef (_IUnknown_ (This)); +} + +/************************************************************************ + * ISFPersistFolder_Release + */ +static ULONG WINAPI INPFldr_PersistFolder2_Release (IPersistFolder2 * iface) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_Release (_IUnknown_ (This)); +} + +/************************************************************************ + * INPFldr_PersistFolder2_GetClassID + */ +static HRESULT WINAPI INPFldr_PersistFolder2_GetClassID ( + IPersistFolder2 * iface, CLSID * lpClassId) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)\n", This); + + if (!lpClassId) + return E_POINTER; + + *lpClassId = CLSID_NetworkPlaces; + + return S_OK; +} + +/************************************************************************ + * INPFldr_PersistFolder2_Initialize + * + * NOTES: it makes no sense to change the pidl + */ +static HRESULT WINAPI INPFldr_PersistFolder2_Initialize ( + IPersistFolder2 * iface, LPCITEMIDLIST pidl) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(%p)\n", This, pidl); + + return E_NOTIMPL; +} + +/************************************************************************** + * IPersistFolder2_fnGetCurFolder + */ +static HRESULT WINAPI INPFldr_PersistFolder2_GetCurFolder ( + IPersistFolder2 * iface, LPITEMIDLIST * pidl) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(%p)\n", This, pidl); + + if (!pidl) + return E_POINTER; + + *pidl = ILClone (This->pidlRoot); + + return S_OK; +} + +static const IPersistFolder2Vtbl vt_NP_PersistFolder2 = +{ + INPFldr_PersistFolder2_QueryInterface, + INPFldr_PersistFolder2_AddRef, + INPFldr_PersistFolder2_Release, + INPFldr_PersistFolder2_GetClassID, + INPFldr_PersistFolder2_Initialize, + INPFldr_PersistFolder2_GetCurFolder +}; diff --git a/dlls/shell32/shres.rc b/dlls/shell32/shres.rc index 840aefe9ae4..30748aa30c0 100644 --- a/dlls/shell32/shres.rc +++ b/dlls/shell32/shres.rc @@ -94,6 +94,10 @@ IDI_SHELL_CONFIRM_DELETE ICON delete.ico /* @makedep: mydocs.ico */ IDI_SHELL_MY_DOCUMENTS ICON mydocs.ico +/* FIXME: Following resource is not yet added */ +/* @makedep: mydocs.ico */ +IDI_SHELL_MY_NETWORK_PLACES ICON mydocs.ico + /* @makedep: searching.avi */ IDR_AVI_SEARCHING AVI searching.avi diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 08ad5c24b2f..59ff3d4fd18 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2421,6 +2421,13 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont if(!isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3DTSS_COLOROP))) { activate_dimensions(sampler, stateblock, context); } + + if(stateblock->renderState[WINED3DRS_COLORKEYENABLE] && sampler == 0) { + /* If color keying is enabled update the alpha test, it depends on the existence + * of a color key in stage 0 + */ + state_alpha(WINED3DRS_COLORKEYENABLE, stateblock, context); + } } /* Otherwise tex_colorop disables the stage */ glBindTexture(GL_TEXTURE_2D, stateblock->wineD3DDevice->dummyTextureName[sampler]); checkGLcall("glBindTexture(GL_TEXTURE_2D, stateblock->wineD3DDevice->dummyTextureName[sampler])"); @@ -2728,12 +2735,6 @@ static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine } } -static const GLfloat invymat[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, -1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f}; - static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { glMatrixMode(GL_PROJECTION); checkGLcall("glMatrixMode(GL_PROJECTION)"); @@ -2801,8 +2802,8 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock /* D3D texture coordinates are flipped compared to OpenGL ones, so * render everything upside down when rendering offscreen. */ if (stateblock->wineD3DDevice->render_offscreen) { - glMultMatrixf(invymat); - checkGLcall("glMultMatrixf(invymat)"); + glScalef(1.0, -1.0, 1.0); + checkGLcall("glScalef"); } } else { /* The rule is that the window coordinate 0 does not correspond to the @@ -2825,14 +2826,15 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock */ glTranslatef(1.0 / stateblock->viewport.Width, -1.0/ stateblock->viewport.Height, -1.0); checkGLcall("glTranslatef (1.0 / width, -1.0 / height, -1.0)"); - glScalef(1.0, 1.0, 2.0); - - /* D3D texture coordinates are flipped compared to OpenGL ones, so - * render everything upside down when rendering offscreen. */ if (stateblock->wineD3DDevice->render_offscreen) { - glMultMatrixf(invymat); - checkGLcall("glMultMatrixf(invymat)"); + /* D3D texture coordinates are flipped compared to OpenGL ones, so + * render everything upside down when rendering offscreen. */ + glScalef(1.0, -1.0, 2.0); + } else { + glScalef(1.0, 1.0, 2.0); } + checkGLcall("glScalef"); + glMultMatrixf((float *) &stateblock->transforms[WINED3DTS_PROJECTION].u.m[0][0]); checkGLcall("glLoadMatrixf"); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 30d65075617..f9df55e713a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2974,13 +2974,11 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * } else if(dstSwapchain) { if(SrcSurface != myDevice->render_targets[0]) { ERR("Unexpected render target -> render target blit\n"); + return 0; } TRACE("Blit from active render target to a swapchain\n"); /* Handled with regular texture -> swapchain blit */ - } else if(srcSwapchain) { - if(This != (IWineD3DSurfaceImpl *) myDevice->render_targets[0]) { - ERR("Unexpected render target -> render target blit\n"); - } + } else if(srcSwapchain && This == (IWineD3DSurfaceImpl *) myDevice->render_targets[0]) { FIXME("Implement blit from a swapchain to the active render target\n"); return WINED3DERR_INVALIDCALL; } diff --git a/programs/explorer/hal.c b/programs/explorer/hal.c index 6b5be469bdb..38b0523a58f 100644 --- a/programs/explorer/hal.c +++ b/programs/explorer/hal.c @@ -112,7 +112,10 @@ static WINE_EXCEPTION_FILTER(assert_fault) static void new_device( LibHalContext *ctx, const char *udi ) { DBusError error; - char *parent, *mount_point, *device, *type; + char *parent = NULL; + char *mount_point = NULL; + char *device = NULL; + char *type = NULL; p_dbus_error_init( &error ); @@ -133,15 +136,14 @@ static void new_device( LibHalContext *ctx, const char *udi ) add_dos_device( udi, device, mount_point, type ); - if (type) p_libhal_free_string( type ); - p_libhal_free_string( parent ); - p_libhal_free_string( device ); - p_libhal_free_string( mount_point ); - /* add property watch for mount point */ p_libhal_device_add_property_watch( ctx, udi, &error ); done: + if (type) p_libhal_free_string( type ); + if (parent) p_libhal_free_string( parent ); + if (device) p_libhal_free_string( device ); + if (mount_point) p_libhal_free_string( mount_point ); p_dbus_error_free( &error ); } diff --git a/programs/rpcss/np_server.c b/programs/rpcss/np_server.c index 17089478b1f..d26cf32e927 100644 --- a/programs/rpcss/np_server.c +++ b/programs/rpcss/np_server.c @@ -110,6 +110,7 @@ static void RPCSS_ServerProcessRESOLVEEPMessage(PRPCSS_NP_MESSAGE pMsg, static void RPCSS_ServerProcessMessage(PRPCSS_NP_MESSAGE pMsg, PRPCSS_NP_REPLY pReply, char *vardata) { WINE_TRACE("\n"); + ZeroMemory(pReply, sizeof(*pReply)); switch (pMsg->message_type) { case RPCSS_NP_MESSAGE_TYPEID_RANMSG: RPCSS_ServerProcessRANMessage(pMsg, pReply); @@ -436,6 +437,7 @@ BOOL RPCSS_BecomePipeServer(void) */ if ((client_handle = RPCSS_NPConnect()) != INVALID_HANDLE_VALUE) { + ZeroMemory(&msg, sizeof(msg)); msg.message_type = RPCSS_NP_MESSAGE_TYPEID_RANMSG; msg.message.ranmsg.timeout = 1000; msg.vardata_payload_size = 0; diff --git a/server/async.c b/server/async.c index baed1331054..879616d9946 100644 --- a/server/async.c +++ b/server/async.c @@ -263,6 +263,7 @@ void async_set_result( struct object *obj, unsigned int status, unsigned long to if (async->data.apc) { apc_call_t data; + memset( &data, 0, sizeof(data) ); data.type = APC_USER; data.user.func = async->data.apc; data.user.args[0] = (unsigned long)async->data.arg; diff --git a/tools/sfnt2fnt.c b/tools/sfnt2fnt.c index 8868c660089..0a32598ab01 100644 --- a/tools/sfnt2fnt.c +++ b/tools/sfnt2fnt.c @@ -312,8 +312,8 @@ static void fill_fontinfo(FT_Face face, int enc, FILE *fp, int dpi, unsigned cha /* Hack: Courier has no internal leading, nor do any Chinese or Japanese fonts */ if(!strcmp(face->family_name, "Courier") || enc == 936 || enc == 950 || enc == 932) il = 0; - /* Japanese fonts have an external leading */ - if(enc == 932) + /* Japanese system fonts have an external leading (not small font) */ + if (enc == 932 && ppem > 11) el = 2; else el = 0; -- 2.11.4.GIT