From 6e5ac7bdecb75eeabec27c1cebd67536f381ca8c Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sun, 9 Dec 2007 16:01:39 +0100 Subject: [PATCH] push b97c10770d1b2e3102a993a8d54615bf192cfe17 --- dlls/comctl32/propsheet.c | 2 +- dlls/comdlg32/printdlg.c | 4 +- dlls/dbghelp/msc.c | 2 +- dlls/ddraw/device.c | 2 +- dlls/dmime/audiopath.c | 10 ++-- dlls/dmime/performance.c | 30 +++++----- dlls/dmloader/loaderstream.c | 10 ++-- dlls/dmusic/collection.c | 2 +- dlls/dmusic/dmusic.c | 2 +- dlls/dmusic/dmusic_main.c | 2 +- dlls/gdi32/bidi.c | 2 +- dlls/gdi32/font.c | 2 +- dlls/kernel32/tests/drive.c | 4 +- dlls/kernel32/volume.c | 17 ++---- dlls/msi/appsearch.c | 70 ++++++++++++++++++++---- dlls/msi/msi.c | 68 ++++++++++++++++------- dlls/msi/tests/msi.c | 110 +++++++++---------------------------- dlls/msi/tests/package.c | 20 ++----- dlls/opengl32/Makefile.in | 2 +- dlls/opengl32/make_opengl | 4 +- dlls/opengl32/opengl_ext.c | 2 +- dlls/riched20/clipboard.c | 8 +-- dlls/riched20/editor.c | 13 +++-- dlls/riched20/editor.h | 12 ++-- dlls/riched20/paint.c | 37 +++++++------ dlls/riched20/reader.c | 56 ++++++++----------- dlls/riched20/richole.c | 4 +- dlls/riched20/rtf.h | 2 +- dlls/rpcrt4/ndr_marshall.c | 115 +++++++++++++++++++++++++++++++-------- dlls/rpcrt4/rpcrt4_main.c | 1 + dlls/rpcrt4/tests/ndr_marshall.c | 2 - dlls/wined3d/device.c | 2 +- server/async.c | 4 +- tools/widl/parser.y | 2 +- 34 files changed, 338 insertions(+), 287 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index a1a765fa1ad..1f675cda6eb 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -2081,7 +2081,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, index = PROPSHEET_FindPageByResId(psInfo, result); if(index >= psInfo->nPages) { index = old_index; - WARN("Tried to skip to nonexistant page by res id\n"); + WARN("Tried to skip to nonexistent page by res id\n"); break; } continue; diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c index e04e145597f..5baa90edc8d 100644 --- a/dlls/comdlg32/printdlg.c +++ b/dlls/comdlg32/printdlg.c @@ -2890,10 +2890,10 @@ PRINTDLG_PS_WMCommandA( GETVAL(id, pda->curdlg.rtMargin.left); break; case edt5: - GETVAL(id, pda->curdlg.rtMargin.right); + GETVAL(id, pda->curdlg.rtMargin.top); break; case edt6: - GETVAL(id, pda->curdlg.rtMargin.top); + GETVAL(id, pda->curdlg.rtMargin.right); break; case edt7: GETVAL(id, pda->curdlg.rtMargin.bottom); diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index c04fa798254..5e6f8a84bcf 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -355,7 +355,7 @@ static int codeview_add_type(unsigned int typeno, struct symt* dt) if (cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE]) { if (cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE] != dt) - FIXME("Overwritting at %x\n", typeno); + FIXME("Overwriting at %x\n", typeno); } cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE] = dt; return TRUE; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 53ef2f176b3..fa471ef70c8 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5477,8 +5477,8 @@ const IDirect3DDeviceVtbl IDirect3DDevice1_Vtbl = IDirect3DDeviceImpl_1_SetMatrix, IDirect3DDeviceImpl_1_GetMatrix, IDirect3DDeviceImpl_1_DeleteMatrix, - Thunk_IDirect3DDeviceImpl_1_EndScene, Thunk_IDirect3DDeviceImpl_1_BeginScene, + Thunk_IDirect3DDeviceImpl_1_EndScene, Thunk_IDirect3DDeviceImpl_1_GetDirect3D }; diff --git a/dlls/dmime/audiopath.c b/dlls/dmime/audiopath.c index 2deb846e7b1..448160ff8ee 100644 --- a/dlls/dmime/audiopath.c +++ b/dlls/dmime/audiopath.c @@ -142,7 +142,7 @@ static HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectI DMUSIC_CreateDirectMusicGraphImpl (&IID_IDirectMusicGraph, (LPVOID*)&pGraph, NULL); This->pToolGraph = (IDirectMusicGraph*) pGraph; } - *ppObject = (LPDIRECTMUSICGRAPH) This->pToolGraph; + *ppObject = This->pToolGraph; IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) *ppObject); return S_OK; } @@ -158,7 +158,7 @@ static HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectI case DMUS_PATH_PERFORMANCE: { /* TODO check wanted GUID */ - *ppObject = (LPDIRECTMUSICPERFORMANCE8) This->pPerf; + *ppObject = This->pPerf; IUnknown_AddRef((LPUNKNOWN) *ppObject); return S_OK; } @@ -167,16 +167,16 @@ static HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectI case DMUS_PATH_PERFORMANCE_GRAPH: { IDirectMusicGraph* pPerfoGraph = NULL; - IDirectMusicPerformance8_GetGraph((LPDIRECTMUSICPERFORMANCE8) This->pPerf, &pPerfoGraph); + IDirectMusicPerformance8_GetGraph(This->pPerf, &pPerfoGraph); if (NULL == pPerfoGraph) { IDirectMusicGraphImpl* pGraph = NULL; DMUSIC_CreateDirectMusicGraphImpl (&IID_IDirectMusicGraph, (LPVOID*)&pGraph, NULL); - IDirectMusicPerformance8_SetGraph((LPDIRECTMUSICPERFORMANCE8) This->pPerf, (IDirectMusicGraph*) pGraph); + IDirectMusicPerformance8_SetGraph(This->pPerf, (IDirectMusicGraph*) pGraph); /* we need release as SetGraph do an AddRef */ IDirectMusicGraph_Release((LPDIRECTMUSICGRAPH) pGraph); pPerfoGraph = (LPDIRECTMUSICGRAPH) pGraph; } - *ppObject = (LPDIRECTMUSICGRAPH) pPerfoGraph; + *ppObject = pPerfoGraph; return S_OK; } break; diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 4013106ab08..51a4b253f00 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -219,8 +219,8 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANC } if (NULL != pDirectSound) { - This->pDirectSound = (IDirectSound*) pDirectSound; - IDirectSound_AddRef((LPDIRECTSOUND) This->pDirectSound); + This->pDirectSound = pDirectSound; + IDirectSound_AddRef(This->pDirectSound); } else { HRESULT hr; hr = DirectSoundCreate8(NULL, (LPDIRECTSOUND8*) &This->pDirectSound, NULL); @@ -242,7 +242,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANC if (NULL != ppDirectMusic && NULL != *ppDirectMusic) { /* app creates it's own dmusic object and gives it to performance */ This->pDirectMusic = (IDirectMusic8*) *ppDirectMusic; - IDirectMusic8_AddRef((LPDIRECTMUSIC8) This->pDirectMusic); + IDirectMusic8_AddRef(This->pDirectMusic); } else { /* app allows the performance to initialise itfself and needs a pointer to object*/ CoCreateInstance (&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic8, (void**)&This->pDirectMusic); @@ -451,8 +451,8 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph (LPDIRECTMUSICPERFOR IDirectMusicPerformance8Impl *This = (IDirectMusicPerformance8Impl *)iface; FIXME("(%p, %p): to check\n", This, ppGraph); if (NULL != This->pToolGraph) { - *ppGraph = (LPDIRECTMUSICGRAPH) This->pToolGraph; - IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) *ppGraph); + *ppGraph = This->pToolGraph; + IDirectMusicGraph_AddRef(*ppGraph); } else { return E_FAIL; } @@ -466,11 +466,11 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_SetGraph (LPDIRECTMUSICPERFOR if (NULL != This->pToolGraph) { /* Todo clean buffers and tools before */ - IDirectMusicGraph_Release((LPDIRECTMUSICGRAPH) This->pToolGraph); + IDirectMusicGraph_Release(This->pToolGraph); } This->pToolGraph = pGraph; if (NULL != This->pToolGraph) { - IDirectMusicGraph_AddRef((LPDIRECTMUSICGRAPH) This->pToolGraph); + IDirectMusicGraph_AddRef(This->pToolGraph); } return S_OK; } @@ -690,11 +690,11 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_CloseDown (LPDIRECTMUSICPERFO CloseHandle(This->procThread); } if (NULL != This->pDirectSound) { - IDirectSound_Release((LPDIRECTSOUND) This->pDirectSound); + IDirectSound_Release(This->pDirectSound); This->pDirectSound = NULL; } if (NULL != This->pDirectMusic) { - IDirectMusic8_Release((LPDIRECTMUSIC8) This->pDirectMusic); + IDirectMusic8_Release(This->pDirectMusic); This->pDirectMusic = NULL; } return S_OK; @@ -785,7 +785,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio (LPDIRECTMUSICPERFO This->pParams.dwFeatures = dwFlags; This->pParams.clsidDefaultSynth = CLSID_DirectMusicSynthSink; } - hr = IDirectMusicPerformance8_CreateStandardAudioPath(iface, dwDefaultPathType, dwPChannelCount, FALSE, (IDirectMusicAudioPath**) &This->pDefaultPath); + hr = IDirectMusicPerformance8_CreateStandardAudioPath(iface, dwDefaultPathType, dwPChannelCount, FALSE, &This->pDefaultPath); PostMessageToProcessMsgThread(This, PROCESSMSG_START); @@ -829,7 +829,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_CreateAudioPath (LPDIRECTMUSI /** TODO */ - *ppNewPath = (LPDIRECTMUSICAUDIOPATH) pPath; + *ppNewPath = pPath; return IDirectMusicAudioPath_Activate(*ppNewPath, fActivate); } @@ -921,7 +921,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_CreateStandardAudioPath (LPDI } default_path->pPrimary = buffer; - *ppNewPath = (LPDIRECTMUSICAUDIOPATH) pPath; + *ppNewPath = pPath; TRACE(" returning IDirectMusicPerformance interface at %p.\n", *ppNewPath); @@ -933,13 +933,13 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_SetDefaultAudioPath (LPDIRECT FIXME("(%p, %p): semi-stub\n", This, pAudioPath); if (NULL != This->pDefaultPath) { - IDirectMusicAudioPath_Release((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath); + IDirectMusicAudioPath_Release(This->pDefaultPath); ((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = NULL; This->pDefaultPath = NULL; } This->pDefaultPath = pAudioPath; if (NULL != This->pDefaultPath) { - IDirectMusicAudioPath_AddRef((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath); + IDirectMusicAudioPath_AddRef(This->pDefaultPath); ((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = (IDirectMusicPerformance8*) This; } @@ -952,7 +952,7 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_GetDefaultAudioPath (LPDIRECT FIXME("(%p, %p): semi-stub (%p)\n", This, ppAudioPath, This->pDefaultPath); if (NULL != This->pDefaultPath) { - *ppAudioPath = (LPDIRECTMUSICAUDIOPATH) This->pDefaultPath; + *ppAudioPath = This->pDefaultPath; IDirectMusicAudioPath_AddRef(*ppAudioPath); } else { *ppAudioPath = NULL; diff --git a/dlls/dmloader/loaderstream.c b/dlls/dmloader/loaderstream.c index 2a1938fdb24..97047cf168e 100644 --- a/dlls/dmloader/loaderstream.c +++ b/dlls/dmloader/loaderstream.c @@ -179,16 +179,16 @@ static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Clone (LPSTREAM iface if (SUCCEEDED(result)) { LARGE_INTEGER liNewPosition; liNewPosition.QuadPart = ullCurrentPosition.QuadPart; - result = IDirectMusicLoaderFileStream_IStream_Seek ((LPSTREAM)pOther, liNewPosition, STREAM_SEEK_SET, &ullCurrentPosition); + result = IDirectMusicLoaderFileStream_IStream_Seek (pOther, liNewPosition, STREAM_SEEK_SET, &ullCurrentPosition); } if (FAILED(result)) { TRACE(": failed\n"); - IDirectMusicLoaderFileStream_IStream_Release ((LPSTREAM)pOther); + IDirectMusicLoaderFileStream_IStream_Release (pOther); return result; } } TRACE(": succeeded\n"); - *ppstm = (IStream*)pOther; + *ppstm = pOther; return S_OK; } @@ -452,7 +452,7 @@ static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Clone (LPSTREAM i IDirectMusicLoaderResourceStream_Attach (pOther, This->pbMemData, This->llMemLength, This->llPos, This->pLoader); TRACE(": succeeded\n"); - *ppstm = (IStream*)pOther; + *ppstm = pOther; return S_OK; } @@ -670,7 +670,7 @@ static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Clone (LPSTREAM if IDirectMusicLoaderGenericStream_Attach (pOther, pLowLevel, This->pLoader); TRACE(": succeeded\n"); - *ppstm = (IStream*)pOther; + *ppstm = pOther; return S_OK; } diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index d9ef6586a95..06842c5d18f 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -118,7 +118,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_GetInstr tmpEntry = LIST_ENTRY(listEntry, DMUS_PRIVATE_INSTRUMENTENTRY, entry); IDirectMusicInstrument_GetPatch (tmpEntry->pInstrument, &dwInstPatch); if (dwPatch == dwInstPatch) { - *ppInstrument = (LPDIRECTMUSICINSTRUMENT)tmpEntry->pInstrument; + *ppInstrument = tmpEntry->pInstrument; IDirectMusicInstrument_AddRef (tmpEntry->pInstrument); IDirectMusicInstrumentImpl_Custom_Load (tmpEntry->pInstrument, This->pStm); /* load instrument before returning it */ TRACE(": returning instrument %p\n", *ppInstrument); diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index b9f380d40dd..34edce977b5 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -134,7 +134,7 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLS if (!This->ppPorts) This->ppPorts = HeapAlloc(GetProcessHeap(), 0, sizeof(LPDIRECTMUSICPORT) * This->nrofports); else This->ppPorts = HeapReAlloc(GetProcessHeap(), 0, This->ppPorts, sizeof(LPDIRECTMUSICPORT) * This->nrofports); This->ppPorts[This->nrofports - 1] = pNewPort; - *ppPort = (LPDIRECTMUSICPORT) pNewPort; + *ppPort = pNewPort; return S_OK; } } diff --git a/dlls/dmusic/dmusic_main.c b/dlls/dmusic/dmusic_main.c index 24901ba1f3d..2b629988f4e 100644 --- a/dlls/dmusic/dmusic_main.c +++ b/dlls/dmusic/dmusic_main.c @@ -54,7 +54,7 @@ static ULONG WINAPI DirectMusicCF_Release(LPCLASSFACTORY iface) { static HRESULT WINAPI DirectMusicCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj); - return DMUSIC_CreateDirectMusicImpl (riid, (LPVOID*) ppobj, pOuter); + return DMUSIC_CreateDirectMusicImpl (riid, ppobj, pOuter); } static HRESULT WINAPI DirectMusicCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { diff --git a/dlls/gdi32/bidi.c b/dlls/gdi32/bidi.c index 7505a910af8..5b787d39274 100644 --- a/dlls/gdi32/bidi.c +++ b/dlls/gdi32/bidi.c @@ -231,7 +231,7 @@ static void SetDeferredRun(WORD *pval, int cval, int iStart, int nval) Output: revised character count - Note: This is a very simplfistic function. In effect it restricts + Note: This is a very simplistic function. In effect it restricts the action of the algorithm to the first paragraph in the input where a paragraph ends at the end of the first block separator or at the end of the input text. diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 1a179d5270a..9fba58e9350 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2780,7 +2780,7 @@ DWORD WINAPI GetKerningPairsW( HDC hDC, DWORD cPairs, * TranslateCharsetInfo [GDI32.@] * * Fills a CHARSETINFO structure for a character set, code page, or - * font. This allows making the correspondance between different labelings + * font. This allows making the correspondence between different labelings * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) * of the same encoding. * diff --git a/dlls/kernel32/tests/drive.c b/dlls/kernel32/tests/drive.c index 52afc93ebc6..a8cc165bd59 100644 --- a/dlls/kernel32/tests/drive.c +++ b/dlls/kernel32/tests/drive.c @@ -43,7 +43,7 @@ static void test_GetDriveTypeA(void) if (!(logical_drives & 1)) ok(type == DRIVE_NO_ROOT_DIR, - "GetDriveTypeA should return DRIVE_NO_ROOT_DIR for inexistant drive %c: but not %u\n", + "GetDriveTypeA should return DRIVE_NO_ROOT_DIR for inexistent drive %c: but not %u\n", drive[0], type); logical_drives >>= 1; @@ -71,7 +71,7 @@ static void test_GetDriveTypeW(void) if (!(logical_drives & 1)) ok(type == DRIVE_NO_ROOT_DIR, - "GetDriveTypeW should return DRIVE_NO_ROOT_DIR for inexistant drive %c: but not %u\n", + "GetDriveTypeW should return DRIVE_NO_ROOT_DIR for inexistent drive %c: but not %u\n", drive[0], type); logical_drives >>= 1; diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 655fda15411..1869d0d072a 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -58,14 +58,11 @@ enum fs_type { FS_ERROR, /* error accessing the device */ FS_UNKNOWN, /* unknown file system */ - FS_PLACEHOLDER, /* Wine placeholder for drive device */ FS_FAT1216, FS_FAT32, FS_ISO9660 }; -static const char wine_placeholder[] = "Wine device placeholder"; - static const WCHAR drive_types[][8] = { { 0 }, /* DRIVE_UNKNOWN */ @@ -308,11 +305,7 @@ static enum fs_type VOLUME_ReadFATSuperblock( HANDLE handle, BYTE *buff ) !ReadFile( handle, buff, SUPERBLOCK_SIZE, &size, NULL )) return FS_ERROR; - if (size >= sizeof(wine_placeholder)-1 && - !memcmp( buff, wine_placeholder, sizeof(wine_placeholder)-1 )) - return FS_PLACEHOLDER; - - if (size != SUPERBLOCK_SIZE) return FS_ERROR; + if (size < SUPERBLOCK_SIZE) return FS_UNKNOWN; /* FIXME: do really all FAT have their name beginning with * "FAT" ? (At least FAT12, FAT16 and FAT32 have :) @@ -395,12 +388,11 @@ static void VOLUME_GetSuperblockLabel( const WCHAR *device, enum fs_type type, c switch(type) { case FS_ERROR: - case FS_UNKNOWN: label_len = 0; break; - case FS_PLACEHOLDER: + case FS_UNKNOWN: get_filesystem_label( device, label, len ); - break; + return; case FS_FAT1216: label_ptr = superblock + 0x2b; label_len = 11; @@ -446,9 +438,8 @@ static DWORD VOLUME_GetSuperblockSerial( const WCHAR *device, enum fs_type type, switch(type) { case FS_ERROR: - case FS_UNKNOWN: break; - case FS_PLACEHOLDER: + case FS_UNKNOWN: return get_filesystem_serial( device ); case FS_FAT1216: return GETLONG( superblock, 0x27 ); diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index 64b2d485862..5f5bba8315d 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -28,6 +28,7 @@ #include "msiquery.h" #include "msidefs.h" #include "winver.h" +#include "shlwapi.h" #include "wine/unicode.h" #include "wine/debug.h" #include "msipriv.h" @@ -157,30 +158,77 @@ static void ACTION_FreeSignature(MSISIGNATURE *sig) static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig) { static const WCHAR query[] = { - 's','e','l','e','c','t',' ','*',' ', - 'f','r','o','m',' ', - 'C','o','m','p','L','o','c','a','t','o','r',' ', - 'w','h','e','r','e',' ','S','i','g','n','a','t','u','r','e','_',' ','=',' ', + 'S','E','L','E','C','T',' ','*',' ', + 'F','R','O','M',' ', + '`','C','o','m','p','L','o','c','a','t','o','r','`',' ', + 'W','H','E','R','E',' ','`','S','i','g','n','a','t','u','r','e','_','`',' ','=',' ', '\'','%','s','\'',0}; - MSIRECORD *row; - LPWSTR guid; + static const WCHAR sigquery[] = { + 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','S','i','g','n','a','t','u','r','e','`',' ', + 'W','H','E','R','E',' ','`','S','i','g','n','a','t','u','r','e','`',' ','=',' ', + '\'','%','s','\'',0}; + + MSIRECORD *row, *rec; + LPCWSTR signature, guid; + BOOL sigpresent = TRUE; + BOOL isdir; + UINT type; + WCHAR path[MAX_PATH]; + DWORD size = MAX_PATH; + LPWSTR ptr; + DWORD attr; TRACE("%s\n", debugstr_w(sig->Name)); *appValue = NULL; - row = MSI_QueryGetRecord( package->db, query, sig->Name ); + row = MSI_QueryGetRecord(package->db, query, sig->Name); if (!row) { TRACE("failed to query CompLocator for %s\n", debugstr_w(sig->Name)); return ERROR_SUCCESS; } - guid = msi_dup_record_field( row, 2 ); - FIXME("AppSearch CompLocator (%s) unimplemented\n", debugstr_w(guid)); - msi_free( guid ); - msiobj_release( &row->hdr ); + signature = MSI_RecordGetString(row, 1); + guid = MSI_RecordGetString(row, 2); + type = MSI_RecordGetInteger(row, 3); + + rec = MSI_QueryGetRecord(package->db, sigquery, signature); + if (!rec) + sigpresent = FALSE; + + *path = '\0'; + MsiLocateComponentW(guid, path, &size); + if (!*path) + goto done; + + attr = GetFileAttributesW(path); + if (attr == INVALID_FILE_ATTRIBUTES) + goto done; + isdir = (attr & FILE_ATTRIBUTE_DIRECTORY); + + if (type != msidbLocatorTypeDirectory && sigpresent && !isdir) + { + *appValue = strdupW(path); + } + else if (!sigpresent && (type != msidbLocatorTypeDirectory || isdir)) + { + if (type == msidbLocatorTypeFileName) + { + ptr = strrchrW(path, '\\'); + *(ptr + 1) = '\0'; + } + else + PathAddBackslashW(path); + + *appValue = strdupW(path); + } + +done: + if (rec) msiobj_release(&rec->hdr); + msiobj_release(&row->hdr); return ERROR_SUCCESS; } diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 416192f7e67..70a9c983d1e 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -487,9 +487,10 @@ UINT WINAPI MsiGetProductCodeA(LPCSTR szComponent, LPSTR szBuffer) return ERROR_OUTOFMEMORY; } + *szwBuffer = '\0'; r = MsiGetProductCodeW( szwComponent, szwBuffer ); - if( ERROR_SUCCESS == r ) + if(*szwBuffer) WideCharToMultiByte(CP_ACP, 0, szwBuffer, -1, szBuffer, GUID_SIZE, NULL, NULL); msi_free( szwComponent ); @@ -499,38 +500,65 @@ UINT WINAPI MsiGetProductCodeA(LPCSTR szComponent, LPSTR szBuffer) UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer) { - UINT rc; - HKEY hkey; - WCHAR szSquished[GUID_SIZE]; + UINT rc, index; + HKEY compkey, prodkey; + WCHAR squished_comp[GUID_SIZE]; + WCHAR squished_prod[GUID_SIZE]; DWORD sz = GUID_SIZE; - static const WCHAR szPermKey[] = - { '0','0','0','0','0','0','0','0','0','0','0','0', - '0','0','0','0','0','0','0','0','0','0','0','0', - '0','0','0','0','0','0','0','0',0}; - TRACE("%s %p\n",debugstr_w(szComponent), szBuffer); + TRACE("%s %p\n", debugstr_w(szComponent), szBuffer); - if (NULL == szComponent) + if (!szComponent || !*szComponent) return ERROR_INVALID_PARAMETER; - rc = MSIREG_OpenComponentsKey( szComponent, &hkey, FALSE); + if (!squash_guid(szComponent, squished_comp)) + return ERROR_INVALID_PARAMETER; + + if (MSIREG_OpenUserDataComponentKey(szComponent, &compkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenLocalSystemComponentKey(szComponent, &compkey, FALSE) != ERROR_SUCCESS) + { + return ERROR_UNKNOWN_COMPONENT; + } + + rc = RegEnumValueW(compkey, 0, squished_prod, &sz, NULL, NULL, NULL, NULL); if (rc != ERROR_SUCCESS) + { + RegCloseKey(compkey); return ERROR_UNKNOWN_COMPONENT; + } - rc = RegEnumValueW(hkey, 0, szSquished, &sz, NULL, NULL, NULL, NULL); - if (rc == ERROR_SUCCESS && strcmpW(szSquished,szPermKey)==0) + /* check simple case, only one product */ + rc = RegEnumValueW(compkey, 1, squished_prod, &sz, NULL, NULL, NULL, NULL); + if (rc == ERROR_NO_MORE_ITEMS) { - sz = GUID_SIZE; - rc = RegEnumValueW(hkey, 1, szSquished, &sz, NULL, NULL, NULL, NULL); + rc = ERROR_SUCCESS; + goto done; } - RegCloseKey(hkey); + index = 0; + while ((rc = RegEnumValueW(compkey, index, squished_prod, &sz, + NULL, NULL, NULL, NULL)) != ERROR_NO_MORE_ITEMS) + { + index++; + sz = GUID_SIZE; + unsquash_guid(squished_prod, szBuffer); - if (rc != ERROR_SUCCESS) - return ERROR_INSTALL_FAILURE; + if (MSIREG_OpenLocalManagedProductKey(szBuffer, &prodkey, FALSE) == ERROR_SUCCESS || + MSIREG_OpenUserProductsKey(szBuffer, &prodkey, FALSE) == ERROR_SUCCESS || + MSIREG_OpenLocalClassesProductKey(szBuffer, &prodkey, FALSE) == ERROR_SUCCESS) + { + RegCloseKey(prodkey); + rc = ERROR_SUCCESS; + goto done; + } + } - unsquash_guid(szSquished, szBuffer); - return ERROR_SUCCESS; + rc = ERROR_INSTALL_FAILURE; + +done: + RegCloseKey(compkey); + unsquash_guid(squished_prod, szBuffer); + return rc; } static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 963abc28ad9..a6eaa215d95 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -1359,28 +1359,19 @@ static void test_MsiGetProductCode(void) /* szComponent is empty */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA("", product); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); ok(!lstrcmpA(product, "prod"), "Expected product to be unchanged, got %s\n", product); /* garbage szComponent */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA("garbage", product); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); ok(!lstrcmpA(product, "prod"), "Expected product to be unchanged, got %s\n", product); /* guid without brackets */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA("6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D", product); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); ok(!lstrcmpA(product, "prod"), "Expected product to be unchanged, got %s\n", product); /* guid with brackets */ @@ -1392,10 +1383,7 @@ static void test_MsiGetProductCode(void) /* same length as guid, but random */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA("A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93", product); - todo_wine - { - ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - } + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); ok(!lstrcmpA(product, "prod"), "Expected product to be unchanged, got %s\n", product); /* all params correct, szComponent not published */ @@ -1425,24 +1413,12 @@ static void test_MsiGetProductCode(void) /* product value exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); res = RegSetValueExA(compkey, prod2_squashed, 0, REG_SZ, (const BYTE *)"C:\\another", 10); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - /* another product value exists */ - lstrcpyA(product, "prod"); - r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r); - ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product); - } - lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\"); lstrcatA(keypath, "Installer\\Managed\\"); lstrcatA(keypath, usersid); @@ -1455,11 +1431,8 @@ static void test_MsiGetProductCode(void) /* user managed product key of first product exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1476,11 +1449,8 @@ static void test_MsiGetProductCode(void) /* user unmanaged product key exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1494,11 +1464,8 @@ static void test_MsiGetProductCode(void) /* local classes product key exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1515,11 +1482,8 @@ static void test_MsiGetProductCode(void) /* user managed product key of second product exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1536,7 +1500,7 @@ static void test_MsiGetProductCode(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); /* local user component key exists */ - lstrcpyA(product, "prod"); + lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r); ok(!lstrcmpA(product, "prod"), "Expected product to be unchanged, got %s\n", product); @@ -1547,24 +1511,12 @@ static void test_MsiGetProductCode(void) /* product value exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); res = RegSetValueExA(compkey, prod2_squashed, 0, REG_SZ, (const BYTE *)"C:\\another", 10); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - /* another product value exists */ - lstrcpyA(product, "prod"); - r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %d\n", r); - ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product); - } - lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\"); lstrcatA(keypath, "Installer\\Managed\\"); lstrcatA(keypath, usersid); @@ -1577,11 +1529,8 @@ static void test_MsiGetProductCode(void) /* user managed product key of first product exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1595,11 +1544,8 @@ static void test_MsiGetProductCode(void) /* user unmanaged product key exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1613,11 +1559,8 @@ static void test_MsiGetProductCode(void) /* local classes product key exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); @@ -1634,11 +1577,8 @@ static void test_MsiGetProductCode(void) /* user managed product key of second product exists */ lstrcpyA(product, "prod"); r = MsiGetProductCodeA(component, product); - todo_wine - { - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product); - } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(product, prodcode2), "Expected %s, got %s\n", prodcode2, product); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index e4ba8e51659..b52aab87a7a 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -5228,10 +5228,7 @@ static void test_complocator(void) lstrcpyA(expected, CURR_DIR); lstrcatA(expected, "\\abelisaurus"); - todo_wine - { - ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); - } + ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "BACTROSAURUS", prop, &size); @@ -5254,10 +5251,7 @@ static void test_complocator(void) lstrcpyA(expected, CURR_DIR); lstrcatA(expected, "\\"); - todo_wine - { - ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); - } + ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "FALCARIUS", prop, &size); @@ -5300,10 +5294,7 @@ static void test_complocator(void) lstrcpyA(expected, CURR_DIR); lstrcatA(expected, "\\"); - todo_wine - { - ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); - } + ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "NEOSODON", prop, &size); @@ -5311,10 +5302,7 @@ static void test_complocator(void) lstrcpyA(expected, CURR_DIR); lstrcatA(expected, "\\neosodon\\"); - todo_wine - { - ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); - } + ok(!lstrcmpA(prop, expected), "Expected %s, got %s\n", expected, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "OLOROTITAN", prop, &size); diff --git a/dlls/opengl32/Makefile.in b/dlls/opengl32/Makefile.in index 7e32d6b4e36..7c06f5e654b 100644 --- a/dlls/opengl32/Makefile.in +++ b/dlls/opengl32/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = opengl32.dll IMPORTLIB = libopengl32.$(IMPLIBEXT) -IMPORTS = user32 gdi32 advapi32 kernel32 +IMPORTS = user32 gdi32 advapi32 kernel32 ntdll EXTRAINCL = @X_CFLAGS@ EXTRALIBS = @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ @OPENGL_LIBS@ diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 824dd1c2611..2fb447b16b0 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -702,8 +702,8 @@ foreach (sort keys %ext_functions) { print EXT "\nstatic ", GenerateThunk($ext_functions{$_}, 0, $ext_prefix, $gen_thread_safe, $local_var); } -# Then the table giving the string <-> function correspondance */ -print EXT "\n\n/* The table giving the correspondance between names and functions */\n"; +# Then the table giving the string <-> function correspondence */ +print EXT "\n\n/* The table giving the correspondence between names and functions */\n"; print EXT "const OpenGL_extension extension_registry[$count] = {\n"; my $i = 0; foreach (sort keys %ext_functions) { diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c index fc870ee7290..5a37ed9d2ba 100644 --- a/dlls/opengl32/opengl_ext.c +++ b/dlls/opengl32/opengl_ext.c @@ -9706,7 +9706,7 @@ static void WINAPI wine_glWriteMaskEXT( GLuint res, GLuint in, GLenum outX, GLen } -/* The table giving the correspondance between names and functions */ +/* The table giving the correspondence between names and functions */ const OpenGL_extension extension_registry[1197] = { { "glActiveStencilFaceEXT", "GL_EXT_stencil_two_side", (void *) wine_glActiveStencilFaceEXT }, { "glActiveTexture", "GL_VERSION_1_3", (void *) wine_glActiveTexture }, diff --git a/dlls/riched20/clipboard.c b/dlls/riched20/clipboard.c index 376a2e5b3d9..e9b5cd0ef55 100644 --- a/dlls/riched20/clipboard.c +++ b/dlls/riched20/clipboard.c @@ -77,7 +77,7 @@ static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface) if(!ref) { GlobalFree(This->fmtetc); - richedit_free(This); + heap_free(This); } return ref; @@ -152,7 +152,7 @@ static HRESULT EnumFormatImpl_Create(const FORMATETC *fmtetc, UINT fmtetc_cnt, I EnumFormatImpl *ret; TRACE("\n"); - ret = richedit_alloc(sizeof(EnumFormatImpl)); + ret = heap_alloc(sizeof(EnumFormatImpl)); ret->lpVtbl = &VT_EnumFormatImpl; ret->ref = 1; ret->cur = 0; @@ -195,7 +195,7 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface) if(This->unicode) GlobalFree(This->unicode); if(This->rtf) GlobalFree(This->rtf); if(This->fmtetc) GlobalFree(This->fmtetc); - richedit_free(This); + heap_free(This); } return ref; @@ -388,7 +388,7 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const CHARRANGE *lpchrg, LPDATAO DataObjectImpl *obj; TRACE("(%p,%d,%d)\n", editor, lpchrg->cpMin, lpchrg->cpMax); - obj = richedit_alloc(sizeof(DataObjectImpl)); + obj = heap_alloc(sizeof(DataObjectImpl)); if(cfRTF == 0) cfRTF = RegisterClipboardFormatA("Rich Text Format"); diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index d30ba9de412..10aaaa9b959 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2013,8 +2013,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, LPWSTR bufferW = NULL; if (unicode) - bufferW = richedit_alloc((wParam + 2) * sizeof(WCHAR)); - else bufferA = richedit_alloc(wParam + 2); + bufferW = heap_alloc((wParam + 2) * sizeof(WCHAR)); + else + bufferA = heap_alloc(wParam + 2); ex.cb = wParam + (unicode ? 2*sizeof(WCHAR) : 2); ex.flags = GT_USECRLF; @@ -2033,8 +2034,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, memcpy((LPSTR)lParam, bufferA, wParam); if (strlen(bufferA) >= wParam) rc = 0; } - if (bufferA != NULL) richedit_free(bufferA); - if (bufferW != NULL) richedit_free(bufferW); + heap_free(bufferA); + heap_free(bufferW); return rc; } case EM_GETTEXTEX: @@ -2066,7 +2067,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, /* potentially each char may be a CR, why calculate the exact value with O(N) when we can just take a bigger buffer? :) */ int crlfmul = (ex->flags & GT_USECRLF) ? 2 : 1; - LPWSTR buffer = richedit_alloc((crlfmul*nCount + 1) * sizeof(WCHAR)); + LPWSTR buffer = heap_alloc((crlfmul*nCount + 1) * sizeof(WCHAR)); DWORD buflen = ex->cb; LRESULT rc; DWORD flags = 0; @@ -2075,7 +2076,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, rc = WideCharToMultiByte(ex->codepage, flags, buffer, -1, (LPSTR)lParam, ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar); if (rc) rc--; /* do not count 0 terminator */ - richedit_free(buffer); + heap_free(buffer); return rc; } } diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 83dee767847..010494aa88b 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -23,24 +23,24 @@ extern HANDLE me_heap; -static inline void *richedit_alloc( size_t len ) +static inline void *heap_alloc( size_t len ) { return HeapAlloc( me_heap, 0, len ); } -static inline BOOL richedit_free( void *ptr ) +static inline BOOL heap_free( void *ptr ) { return HeapFree( me_heap, 0, ptr ); } -static inline void *richedit_realloc( void *ptr, size_t len ) +static inline void *heap_realloc( void *ptr, size_t len ) { return HeapReAlloc( me_heap, 0, ptr, len ); } -#define ALLOC_OBJ(type) richedit_alloc(sizeof(type)) -#define ALLOC_N_OBJ(type, count) richedit_alloc((count)*sizeof(type)) -#define FREE_OBJ(ptr) richedit_free(ptr) +#define ALLOC_OBJ(type) heap_alloc(sizeof(type)) +#define ALLOC_N_OBJ(type, count) heap_alloc((count)*sizeof(type)) +#define FREE_OBJ(ptr) heap_free(ptr) #define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \ && (run)->style->fmt.dwEffects & CFE_HIDDEN) diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 7c40814f88b..5f1d5b6aad0 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -558,25 +558,26 @@ ME_InvalidateSelection(ME_TextEditor *editor) assert(para2->type == diParagraph); /* last selection markers aren't always updated, which means they can point past the end of the document */ - if (editor->nLastSelStart > len) - editor->nLastSelEnd = len; - if (editor->nLastSelEnd > len) - editor->nLastSelEnd = len; - - /* if the start part of selection is being expanded or contracted... */ - if (nStart < editor->nLastSelStart) { - ME_MarkForPainting(editor, para1, ME_FindItemFwd(editor->pLastSelStartPara, diParagraphOrEnd)); - } else - if (nStart > editor->nLastSelStart) { - ME_MarkForPainting(editor, editor->pLastSelStartPara, ME_FindItemFwd(para1, diParagraphOrEnd)); - } + if (editor->nLastSelStart > len || editor->nLastSelEnd > len) { + ME_MarkForPainting(editor, + ME_FindItemFwd(editor->pBuffer->pFirst, diParagraph), + ME_FindItemFwd(editor->pBuffer->pFirst, diTextEnd)); + } else { + /* if the start part of selection is being expanded or contracted... */ + if (nStart < editor->nLastSelStart) { + ME_MarkForPainting(editor, para1, ME_FindItemFwd(editor->pLastSelStartPara, diParagraphOrEnd)); + } else + if (nStart > editor->nLastSelStart) { + ME_MarkForPainting(editor, editor->pLastSelStartPara, ME_FindItemFwd(para1, diParagraphOrEnd)); + } - /* if the end part of selection is being contracted or expanded... */ - if (nEnd < editor->nLastSelEnd) { - ME_MarkForPainting(editor, para2, ME_FindItemFwd(editor->pLastSelEndPara, diParagraphOrEnd)); - } else - if (nEnd > editor->nLastSelEnd) { - ME_MarkForPainting(editor, editor->pLastSelEndPara, ME_FindItemFwd(para2, diParagraphOrEnd)); + /* if the end part of selection is being contracted or expanded... */ + if (nEnd < editor->nLastSelEnd) { + ME_MarkForPainting(editor, para2, ME_FindItemFwd(editor->pLastSelEndPara, diParagraphOrEnd)); + } else + if (nEnd > editor->nLastSelEnd) { + ME_MarkForPainting(editor, editor->pLastSelEndPara, ME_FindItemFwd(para2, diParagraphOrEnd)); + } } ME_InvalidateMarkedParagraphs(editor); diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index e0a9e1a86e3..f46a8ccaaea 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -76,18 +76,6 @@ static void RTFPutCodePageChar(RTF_Info *info, int c); /* ---------------------------------------------------------------------- */ -/* - * Memory allocation routines - */ - - -/* - * Return pointer to block of size bytes, or NULL if there's - * not enough memory available. - */ -#define RTFAlloc(size) richedit_alloc(size) -#define RTFReAlloc(ptr, size) richedit_realloc(ptr, size) -#define RTFFree(ptr) richedit_free(ptr) /* * Saves a string on the heap and returns a pointer to it. @@ -96,7 +84,7 @@ static inline char *RTFStrSave(const char *s) { char *p; - p = RTFAlloc (lstrlenA(s) + 1); + p = heap_alloc (lstrlenA(s) + 1); if (p == NULL) return NULL; return lstrcpyA (p, s); @@ -143,14 +131,14 @@ RTFDestroyAttrs(RTF_Info *info) while (info->fontList) { fp = info->fontList->rtfNextFont; - RTFFree (info->fontList->rtfFName); - RTFFree (info->fontList); + heap_free (info->fontList->rtfFName); + heap_free (info->fontList); info->fontList = fp; } while (info->colorList) { cp = info->colorList->rtfNextColor; - RTFFree (info->colorList); + heap_free (info->colorList); info->colorList = cp; } while (info->styleList) @@ -160,12 +148,12 @@ RTFDestroyAttrs(RTF_Info *info) while (eltList) { ep = eltList->rtfNextSE; - RTFFree (eltList->rtfSEText); - RTFFree (eltList); + heap_free (eltList->rtfSEText); + heap_free (eltList); eltList = ep; } - RTFFree (info->styleList->rtfSName); - RTFFree (info->styleList); + heap_free (info->styleList->rtfSName); + heap_free (info->styleList); info->styleList = sp; } } @@ -176,11 +164,11 @@ RTFDestroy(RTF_Info *info) { if (info->rtfTextBuf) { - RTFFree(info->rtfTextBuf); - RTFFree(info->pushedTextBuf); + heap_free(info->rtfTextBuf); + heap_free(info->pushedTextBuf); } RTFDestroyAttrs(info); - RTFFree(info->cpOutputBuffer); + heap_free(info->cpOutputBuffer); } @@ -196,15 +184,15 @@ void RTFInit(RTF_Info *info) if (info->rtfTextBuf == NULL) /* initialize the text buffers */ { - info->rtfTextBuf = RTFAlloc (rtfBufSiz); - info->pushedTextBuf = RTFAlloc (rtfBufSiz); + info->rtfTextBuf = heap_alloc (rtfBufSiz); + info->pushedTextBuf = heap_alloc (rtfBufSiz); if (info->rtfTextBuf == NULL || info->pushedTextBuf == NULL) ERR ("Cannot allocate text buffers.\n"); info->rtfTextBuf[0] = info->pushedTextBuf[0] = '\0'; } - RTFFree (info->inputName); - RTFFree (info->outputName); + heap_free (info->inputName); + heap_free (info->outputName); info->inputName = info->outputName = NULL; for (i = 0; i < rtfMaxClass; i++) @@ -245,7 +233,7 @@ void RTFInit(RTF_Info *info) if (!info->cpOutputBuffer) { info->dwMaxCPOutputCount = 0x1000; - info->cpOutputBuffer = RTFAlloc(info->dwMaxCPOutputCount); + info->cpOutputBuffer = heap_alloc(info->dwMaxCPOutputCount); } } @@ -2300,9 +2288,9 @@ void LookupInit(void) rp->rtfKHash = Hash (rp->rtfKStr); index = rp->rtfKHash % (RTF_KEY_COUNT * 2); if (!rtfHashTable[index].count) - rtfHashTable[index].value = RTFAlloc(sizeof(RTFKey *)); + rtfHashTable[index].value = heap_alloc(sizeof(RTFKey *)); else - rtfHashTable[index].value = RTFReAlloc(rtfHashTable[index].value, sizeof(RTFKey *) * (rtfHashTable[index].count + 1)); + rtfHashTable[index].value = heap_realloc(rtfHashTable[index].value, sizeof(RTFKey *) * (rtfHashTable[index].count + 1)); rtfHashTable[index].value[rtfHashTable[index].count++] = rp; } } @@ -2313,7 +2301,7 @@ void LookupCleanup(void) for (i=0; idwCPOutputCount * 2 * sizeof(WCHAR); - WCHAR *buffer = RTFAlloc(bufferMax); + WCHAR *buffer = heap_alloc(bufferMax); int length; length = MultiByteToWideChar(info->codePage, 0, info->cpOutputBuffer, @@ -2690,7 +2678,7 @@ RTFFlushCPOutputBuffer(RTF_Info *info) info->dwCPOutputCount = 0; RTFPutUnicodeString(info, buffer, length); - RTFFree((char *)buffer); + heap_free((char *)buffer); } void @@ -2719,7 +2707,7 @@ RTFPutCodePageChar(RTF_Info *info, int c) if (info->dwCPOutputCount >= info->dwMaxCPOutputCount) { info->dwMaxCPOutputCount *= 2; - info->cpOutputBuffer = RTFReAlloc(info->cpOutputBuffer, info->dwMaxCPOutputCount); + info->cpOutputBuffer = heap_realloc(info->cpOutputBuffer, info->dwMaxCPOutputCount); } info->cpOutputBuffer[info->dwCPOutputCount++] = c; } diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 0585e43edf8..9bd44aaee4e 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -112,7 +112,7 @@ IRichEditOle_fnRelease(IRichEditOle *me) if (!ref) { TRACE ("Destroying %p\n", This); - richedit_free(This); + heap_free(This); } return ref; } @@ -529,7 +529,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj) { IRichEditOleImpl *reo; - reo = richedit_alloc(sizeof(IRichEditOleImpl)); + reo = heap_alloc(sizeof(IRichEditOleImpl)); if (!reo) return 0; diff --git a/dlls/riched20/rtf.h b/dlls/riched20/rtf.h index 7234b435f88..9befae7b710 100644 --- a/dlls/riched20/rtf.h +++ b/dlls/riched20/rtf.h @@ -1005,7 +1005,7 @@ struct RTFStyleElt * if no memory available. */ -# define New(t) ((t *) RTFAlloc ((int) sizeof (t))) +# define New(t) (heap_alloc (sizeof (t))) /* Parser stack size */ diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index be18de8ba58..7578221b5a0 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -1126,8 +1126,10 @@ static unsigned long PointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, unsigned type = pFormat[0], attr = pFormat[1]; PFORMAT_STRING desc; NDR_MEMORYSIZE m; + DWORD pointer_id = 0; + int pointer_needs_sizing; - FIXME("(%p,%p,%p): stub\n", pStubMsg, Buffer, pFormat); + TRACE("(%p,%p,%p)\n", pStubMsg, Buffer, pFormat); TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr); pFormat += 2; if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat; @@ -1135,21 +1137,43 @@ static unsigned long PointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, switch (type) { case RPC_FC_RP: /* ref pointer (always non-null) */ + pointer_needs_sizing = 1; + break; + case RPC_FC_UP: /* unique pointer */ + case RPC_FC_OP: /* object pointer - we must free data before overwriting it */ + pointer_id = NDR_LOCAL_UINT32_READ(Buffer); + TRACE("pointer_id is 0x%08x\n", pointer_id); + if (pointer_id) + pointer_needs_sizing = 1; + else + pointer_needs_sizing = 0; break; + case RPC_FC_FP: + { + void *pointer; + pointer_id = NDR_LOCAL_UINT32_READ(Buffer); + TRACE("pointer_id is 0x%08x\n", pointer_id); + pointer_needs_sizing = !NdrFullPointerQueryRefId( + pStubMsg->FullPtrXlatTables, pointer_id, 1, &pointer); + break; + } default: FIXME("unhandled ptr type=%02x\n", type); RpcRaiseException(RPC_X_BAD_STUB_DATA); + return 0; } if (attr & RPC_FC_P_DEREF) { TRACE("deref\n"); } - m = NdrMemorySizer[*desc & NDR_TABLE_MASK]; - if (m) m(pStubMsg, desc); - else FIXME("no memorysizer for data type=%02x\n", *desc); + if (pointer_needs_sizing) { + m = NdrMemorySizer[*desc & NDR_TABLE_MASK]; + if (m) m(pStubMsg, desc); + else FIXME("no memorysizer for data type=%02x\n", *desc); + } - return 0; + return pStubMsg->MemorySize; } /*********************************************************************** @@ -1440,12 +1464,18 @@ static unsigned long EmbeddedPointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, unsigned char *Mark = pStubMsg->BufferMark; unsigned rep, count, stride; unsigned i; + unsigned char *saved_buffer = NULL; TRACE("(%p,%p)\n", pStubMsg, pFormat); if (pStubMsg->IgnoreEmbeddedPointers) return 0; - FIXME("(%p,%p): stub\n", pStubMsg, pFormat); + if (pStubMsg->PointerBufferMark) + { + saved_buffer = pStubMsg->Buffer; + pStubMsg->Buffer = pStubMsg->PointerBufferMark; + pStubMsg->PointerBufferMark = NULL; + } if (*pFormat != RPC_FC_PP) return 0; pFormat += 2; @@ -1485,6 +1515,12 @@ static unsigned long EmbeddedPointerMemorySize(PMIDL_STUB_MESSAGE pStubMsg, pFormat += 8 * count; } + if (saved_buffer) + { + pStubMsg->PointerBufferMark = pStubMsg->Buffer; + pStubMsg->Buffer = saved_buffer; + } + return 0; } @@ -1752,7 +1788,7 @@ ULONG WINAPI NdrSimpleStructMemorySize(PMIDL_STUB_MESSAGE pStubMsg, if (pFormat[0] != RPC_FC_STRUCT) EmbeddedPointerMemorySize(pStubMsg, pFormat+4); - return size; + return pStubMsg->MemorySize; } /*********************************************************************** @@ -2585,6 +2621,7 @@ unsigned char * WINAPI NdrConformantArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, { DWORD size, esize = *(const WORD*)(pFormat+2); unsigned char alignment = pFormat[1] + 1; + unsigned char *saved_buffer; TRACE("(%p,%p,%p,%d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); if (pFormat[0] != RPC_FC_CARRAY) FIXME("format=%d\n", pFormat[0]); @@ -2592,16 +2629,24 @@ unsigned char * WINAPI NdrConformantArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pFormat = ReadConformance(pStubMsg, pFormat+4); size = safe_multiply(esize, pStubMsg->MaxCount); + ALIGN_POINTER(pStubMsg->Buffer, alignment); - if (fMustAlloc || !*ppMemory) + if (fMustAlloc) *ppMemory = NdrAllocate(pStubMsg, size); + else + { + if (!pStubMsg->IsClient && !*ppMemory) + /* for servers, we just point straight into the RPC buffer */ + *ppMemory = pStubMsg->Buffer; + } - ALIGN_POINTER(pStubMsg->Buffer, alignment); - - pStubMsg->BufferMark = pStubMsg->Buffer; - safe_copy_from_buffer(pStubMsg, *ppMemory, size); + saved_buffer = pStubMsg->BufferMark = pStubMsg->Buffer; + safe_buffer_increment(pStubMsg, size); + EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat, fMustAlloc); - EmbeddedPointerUnmarshall(pStubMsg, *ppMemory, *ppMemory, pFormat, TRUE /* FIXME */); + TRACE("copying %p to %p\n", saved_buffer, *ppMemory); + if (*ppMemory != saved_buffer) + memcpy(*ppMemory, saved_buffer, size); return NULL; } @@ -3448,6 +3493,7 @@ unsigned char * WINAPI NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE pStubMs const NDR_CSTRUCT_FORMAT *pCStructFormat = (const NDR_CSTRUCT_FORMAT *)pFormat; PFORMAT_STRING pCArrayFormat; ULONG esize, bufsize; + unsigned char *saved_buffer; TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); @@ -3481,19 +3527,27 @@ unsigned char * WINAPI NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE pStubMs pCStructFormat->memory_size, bufsize); RpcRaiseException(RPC_X_BAD_STUB_DATA); } - /* work out how much memory to allocate if we need to do so */ - if (!*ppMemory || fMustAlloc) + + if (fMustAlloc) { SIZE_T size = pCStructFormat->memory_size + bufsize; *ppMemory = NdrAllocate(pStubMsg, size); } + else + { + if (!pStubMsg->IsClient && !*ppMemory) + /* for servers, we just point straight into the RPC buffer */ + *ppMemory = pStubMsg->Buffer; + } - /* now copy the data */ - pStubMsg->BufferMark = pStubMsg->Buffer; - safe_copy_from_buffer(pStubMsg, *ppMemory, pCStructFormat->memory_size + bufsize); - + saved_buffer = pStubMsg->BufferMark = pStubMsg->Buffer; + safe_buffer_increment(pStubMsg, pCStructFormat->memory_size + bufsize); if (pCStructFormat->type == RPC_FC_CPSTRUCT) - EmbeddedPointerUnmarshall(pStubMsg, *ppMemory, *ppMemory, pFormat, TRUE /* FIXME */); + EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat, fMustAlloc); + + TRACE("copying %p to %p\n", saved_buffer, *ppMemory); + if (*ppMemory != saved_buffer) + memcpy(*ppMemory, saved_buffer, pCStructFormat->memory_size + bufsize); return NULL; } @@ -4050,6 +4104,7 @@ unsigned char * WINAPI NdrFixedArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, { const NDR_SMFARRAY_FORMAT *pSmFArrayFormat = (const NDR_SMFARRAY_FORMAT *)pFormat; unsigned long total_size; + unsigned char *saved_buffer; TRACE("(%p, %p, %p, %d)\n", pStubMsg, ppMemory, pFormat, fMustAlloc); @@ -4075,12 +4130,22 @@ unsigned char * WINAPI NdrFixedArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, pFormat = (const unsigned char *)(pLgFArrayFormat + 1); } - if (fMustAlloc || !*ppMemory) + if (fMustAlloc) *ppMemory = NdrAllocate(pStubMsg, total_size); - pStubMsg->BufferMark = pStubMsg->Buffer; - safe_copy_from_buffer(pStubMsg, *ppMemory, total_size); + else + { + if (!pStubMsg->IsClient && !*ppMemory) + /* for servers, we just point straight into the RPC buffer */ + *ppMemory = pStubMsg->Buffer; + } + + saved_buffer = pStubMsg->BufferMark = pStubMsg->Buffer; + safe_buffer_increment(pStubMsg, total_size); + pFormat = EmbeddedPointerUnmarshall(pStubMsg, saved_buffer, *ppMemory, pFormat, fMustAlloc); - pFormat = EmbeddedPointerUnmarshall(pStubMsg, *ppMemory, *ppMemory, pFormat, TRUE /* FIXME */); + TRACE("copying %p to %p\n", saved_buffer, *ppMemory); + if (*ppMemory != saved_buffer) + memcpy(*ppMemory, saved_buffer, total_size); return NULL; } @@ -5614,6 +5679,8 @@ static ULONG WINAPI NdrBaseTypeMemorySize( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat) { + TRACE("pStubMsg %p, type 0x%02x\n", pStubMsg, *pFormat); + switch(*pFormat) { case RPC_FC_BYTE: diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c index d5576643934..d9efe9a19ff 100644 --- a/dlls/rpcrt4/rpcrt4_main.c +++ b/dlls/rpcrt4/rpcrt4_main.c @@ -191,6 +191,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ERR("tdata->connection should be NULL but is still set to %p\n", tdata); HeapFree(GetProcessHeap(), 0, tdata); } + break; case DLL_PROCESS_DETACH: CloseHandle(master_mutex); diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c index d72d76f8e45..51aecd5fd13 100644 --- a/dlls/rpcrt4/tests/ndr_marshall.c +++ b/dlls/rpcrt4/tests/ndr_marshall.c @@ -1072,10 +1072,8 @@ static void test_conformant_array(void) mem = NULL; StubMsg.Buffer = StubMsg.BufferStart; NdrConformantArrayUnmarshall( &StubMsg, &mem, fmtstr_conf_array, 0); -todo_wine { ok(mem == StubMsg.BufferStart + 4, "mem not pointing at buffer\n"); ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called); -} my_alloc_called = 0; mem = NULL; StubMsg.Buffer = StubMsg.BufferStart; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 582e9e36932..a22c779131b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5761,7 +5761,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT } /* TODO: Write a test for the return value */ - FIXME("Attempt to destroy nonexistant patch\n"); + FIXME("Attempt to destroy nonexistent patch\n"); return WINED3DERR_INVALIDCALL; } diff --git a/server/async.c b/server/async.c index 9ca239c8465..ae586368d11 100644 --- a/server/async.c +++ b/server/async.c @@ -147,7 +147,7 @@ void async_terminate( struct async *async, unsigned int status ) } /* send error completion event */ - if (status != STATUS_ALERTED && async->data.cvalue && async->queue && async->queue->fd) + if (status != STATUS_ALERTED && async->data.cvalue && async->queue->fd) fd_add_completion( async->queue->fd, async->data.cvalue, status, 0 ); memset( &data, 0, sizeof(data) ); @@ -257,7 +257,7 @@ void async_set_result( struct object *obj, unsigned int status, unsigned long to if (async->timeout) remove_timeout_user( async->timeout ); async->timeout = NULL; async->status = status; - if (async->data.cvalue && async->queue && async->queue->fd) + if (async->data.cvalue && async->queue->fd) fd_add_completion( async->queue->fd, async->data.cvalue, status, total ); if (async->data.apc) { diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 3d643c1a15a..06f00352ad2 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -1329,7 +1329,7 @@ static void set_type(var_t *v, type_t *type, int ptr_level, array_dims_t *arr, } } - if (ptr_type) + if (ptr_type && !arr) { if (is_ptr(v->type)) { -- 2.11.4.GIT