Wine-0_9_5 vendor drop
Modified: vendor/wine/dlls/comctl32/current/comctl32undoc.c
Modified: vendor/wine/dlls/comctl32/current/ipaddress.c
Modified: vendor/wine/dlls/comctl32/current/listview.c
Modified: vendor/wine/dlls/comctl32/current/propsheet.c
Modified: vendor/wine/dlls/commdlg/current/colordlg.c
Modified: vendor/wine/dlls/dsound/current/buffer.c
Modified: vendor/wine/dlls/dsound/current/capture.c
Modified: vendor/wine/dlls/dsound/current/dsound.c
Modified: vendor/wine/dlls/dsound/current/dsound_private.h
Modified: vendor/wine/dlls/dsound/current/primary.c
Modified: vendor/wine/dlls/dsound/current/propset.c
Modified: vendor/wine/dlls/dsound/current/sound3d.c
Modified: vendor/wine/dlls/msi/current/action.c
Modified: vendor/wine/dlls/msi/current/custom.c
Modified: vendor/wine/dlls/msi/current/dialog.c
Modified: vendor/wine/dlls/msi/current/events.c
Modified: vendor/wine/dlls/msi/current/install.c
Modified: vendor/wine/dlls/msi/current/msi.c
Modified: vendor/wine/dlls/msi/current/msi.spec
Modified: vendor/wine/dlls/msi/current/msipriv.h
Modified: vendor/wine/dlls/msi/current/msiquery.c
Modified: vendor/wine/dlls/msi/current/package.c
Modified: vendor/wine/dlls/ole32/current/hglobalstream.c
Modified: vendor/wine/dlls/ole32/current/stg_stream.c
Modified: vendor/wine/dlls/oleaut32/current/typelib.c
Modified: vendor/wine/dlls/riched20/current/reader.c
Modified: vendor/wine/dlls/rpcrt4/current/ndr_marshall.c
Modified: vendor/wine/dlls/rpcrt4/current/rpc_server.c
Modified: vendor/wine/dlls/shell32/current/pidl.c
Modified: vendor/wine/dlls/shell32/current/pidl.h
Modified: vendor/wine/dlls/shell32/current/shell32_Bg.rc
Modified: vendor/wine/dlls/shell32/current/shell32_De.rc
Modified: vendor/wine/dlls/shell32/current/shell32_En.rc
Modified: vendor/wine/dlls/shell32/current/shell32_Es.rc
Modified: vendor/wine/dlls/shell32/current/shell32_Fi.rc
Modified: vendor/wine/dlls/shell32/current/shell32_Fr.rc
Modified: vendor/wine/dlls/shell32/current/shell32_No.rc
Modified: vendor/wine/dlls/shell32/current/shell32_Pt.rc
Modified: vendor/wine/dlls/shell32/current/shell32_Ru.rc
Modified: vendor/wine/dlls/shell32/current/shellpath.c
Modified: vendor/wine/dlls/shell32/current/shfldr_unixfs.c
Modified: vendor/wine/dlls/shlwapi/current/shlwapi.spec
Modified: vendor/wine/dlls/shlwapi/current/url.c
Modified: vendor/wine/dlls/urlmon/current/binding.c
Modified: vendor/wine/dlls/urlmon/current/file.c
Modified: vendor/wine/dlls/urlmon/current/sec_mgr.c
Modified: vendor/wine/dlls/urlmon/current/umon.c
Modified: vendor/wine/dlls/urlmon/current/urlmon.spec
Modified: vendor/wine/libs/wpp/current/Makefile.in
Modified: vendor/wine/libs/wpp/current/ppl.l
Modified: vendor/wine/libs/wpp/current/wpp.c
Modified: vendor/wine/programs/msiexec/current/msiexec.c
Modified: vendor/wine/tools/wrc/current/Makefile.in
Modified: vendor/wine/tools/wrc/current/parser.l
Modified: vendor/wine/tools/wrc/current/wrc.c

Modified: vendor/wine/dlls/comctl32/current/comctl32undoc.c
--- vendor/wine/dlls/comctl32/current/comctl32undoc.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/comctl32/current/comctl32undoc.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -96,7 +96,7 @@
 LPVOID WINAPI ReAlloc (LPVOID lpSrc, DWORD dwSize)
 {
     if (lpSrc)
-        return LocalReAlloc( lpSrc, dwSize, LMEM_ZEROINIT );
+        return LocalReAlloc( lpSrc, dwSize, LMEM_ZEROINIT | LMEM_MOVEABLE );
     else
         return LocalAlloc( LMEM_ZEROINIT, dwSize);
 }

Modified: vendor/wine/dlls/comctl32/current/ipaddress.c
--- vendor/wine/dlls/comctl32/current/ipaddress.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/comctl32/current/ipaddress.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -189,7 +189,7 @@
     edit.bottom = rcClient.bottom - 2;
 
     infoPtr->Self = hwnd;
-    infoPtr->Enabled = FALSE;
+    infoPtr->Enabled = TRUE;
     infoPtr->Notify = lpCreate->hwndParent;
 
     for (i = 0; i < 4; i++) {
@@ -208,6 +208,7 @@
         part->OrigProc = (WNDPROC)
 		SetWindowLongPtrW (part->EditHwnd, GWLP_WNDPROC,
 				(DWORD_PTR)IPADDRESS_SubclassProc);
+        EnableWindow(part->EditHwnd, infoPtr->Enabled);
     }
 
     return 0;

Modified: vendor/wine/dlls/comctl32/current/listview.c
--- vendor/wine/dlls/comctl32/current/listview.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/comctl32/current/listview.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -3173,6 +3173,7 @@
   WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL));
   BOOL bResult = FALSE;
 
+  TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl);
   if ((nItem >= 0) && (nItem < infoPtr->nItemCount))
   {
     if (infoPtr->dwStyle & LVS_SINGLESEL)
@@ -3189,6 +3190,14 @@
       }
       else if (wCtrl)
       {
+        LVITEMW lvItem;
+        lvItem.state = ~LISTVIEW_GetItemState(infoPtr, nItem, LVIS_SELECTED);
+        lvItem.stateMask = LVIS_SELECTED;
+        LISTVIEW_SetItemState(infoPtr, nItem, &lvItem);
+
+        if (lvItem.state & LVIS_SELECTED)
+            infoPtr->nSelectionMark = nItem;
+
         bResult = LISTVIEW_SetItemFocus(infoPtr, nItem);
       }
       else
@@ -8016,6 +8025,10 @@
 
   switch (nVirtualKey)
   {
+  case VK_SPACE:
+    nItem = infoPtr->nFocusedItem;
+    break;
+
   case VK_RETURN:
     if ((infoPtr->nItemCount > 0) && (infoPtr->nFocusedItem != -1))
     {
@@ -8082,7 +8095,7 @@
     break;
   }
 
-  if ((nItem != -1) && (nItem != infoPtr->nFocusedItem))
+  if ((nItem != -1) && (nItem != infoPtr->nFocusedItem || nVirtualKey == VK_SPACE))
       LISTVIEW_KeySelection(infoPtr, nItem);
 
   return 0;

Modified: vendor/wine/dlls/comctl32/current/propsheet.c
--- vendor/wine/dlls/comctl32/current/propsheet.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/comctl32/current/propsheet.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -2288,6 +2288,7 @@
 static BOOL PROPSHEET_AddPage(HWND hwndDlg,
                               HPROPSHEETPAGE hpage)
 {
+  PropPageInfo * ppi;
   PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
                                                      PropSheetInfoStr);
   HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
@@ -2298,9 +2299,13 @@
   /*
    * Allocate and fill in a new PropPageInfo entry.
    */
-  psInfo->proppage = (PropPageInfo*) ReAlloc(psInfo->proppage,
-                                                      sizeof(PropPageInfo) *
-                                                      (psInfo->nPages + 1));
+  ppi = (PropPageInfo*) ReAlloc(psInfo->proppage,
+                                sizeof(PropPageInfo) *
+                                (psInfo->nPages + 1));
+  if (!ppi)
+      return FALSE;
+
+  psInfo->proppage = ppi;
   if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages))
       return FALSE;
 

Modified: vendor/wine/dlls/commdlg/current/colordlg.c
--- vendor/wine/dlls/commdlg/current/colordlg.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/commdlg/current/colordlg.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -671,7 +671,7 @@
 {
  char buffer[10];
  LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER);
- lpp->updating = TRUE;
+
  if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6) ))   /* if full size */
  {
    lpp->updating = TRUE;
@@ -938,7 +938,7 @@
     COLORREF *cr;
     LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER);
     TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam);
-    switch (wParam)
+    switch (LOWORD(wParam))
     {
           case 0x2c2:  /* edit notify RGB */
 	  case 0x2c3:
@@ -950,7 +950,7 @@
 			   g = GetGValue(lpp->lpcc->rgbResult);
 			   b= GetBValue(lpp->lpcc->rgbResult);
 			   xx = 0;
-			   switch (wParam)
+			   switch (LOWORD(wParam))
 			   {
 			    case 0x2c2: if ((xx = (i != r))) r = i; break;
 			    case 0x2c3: if ((xx = (i != g))) g = i; break;
@@ -975,9 +975,9 @@
 	  case 0x2c1:
 	       if (notifyCode == EN_UPDATE && !lpp->updating)
 			 {
-			   i = CC_CheckDigitsInEdit(hwndCtl , wParam == 0x2bf ? 239:240);
+			   i = CC_CheckDigitsInEdit(hwndCtl , LOWORD(wParam) == 0x2bf ? 239:240);
 			   xx = 0;
-			   switch (wParam)
+			   switch (LOWORD(wParam))
 			   {
 			    case 0x2bf: if ((xx = ( i != lpp->h))) lpp->h = i; break;
 			    case 0x2c0: if ((xx = ( i != lpp->s))) lpp->s = i; break;

Modified: vendor/wine/dlls/dsound/current/buffer.c
--- vendor/wine/dlls/dsound/current/buffer.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/dsound/current/buffer.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -133,7 +133,7 @@
     IDirectSoundNotifyImpl_SetNotificationPositions,
 };
 
-HRESULT WINAPI IDirectSoundNotifyImpl_Create(
+HRESULT IDirectSoundNotifyImpl_Create(
     IDirectSoundBufferImpl * dsb,
     IDirectSoundNotifyImpl **pdsn)
 {
@@ -157,7 +157,7 @@
     return DS_OK;
 }
 
-HRESULT WINAPI IDirectSoundNotifyImpl_Destroy(
+HRESULT IDirectSoundNotifyImpl_Destroy(
     IDirectSoundNotifyImpl *pdsn)
 {
     TRACE("(%p)\n",pdsn);
@@ -983,7 +983,7 @@
 	IDirectSoundBufferImpl_GetObjectInPath
 };
 
-HRESULT WINAPI IDirectSoundBufferImpl_Create(
+HRESULT IDirectSoundBufferImpl_Create(
 	IDirectSoundImpl *ds,
 	IDirectSoundBufferImpl **pdsb,
 	LPCDSBUFFERDESC dsbd)
@@ -1173,7 +1173,7 @@
 	return err;
 }
 
-HRESULT WINAPI IDirectSoundBufferImpl_Destroy(
+HRESULT IDirectSoundBufferImpl_Destroy(
     IDirectSoundBufferImpl *pdsb)
 {
     TRACE("(%p)\n",pdsb);
@@ -1478,7 +1478,7 @@
 	SecondaryBufferImpl_GetObjectInPath
 };
 
-HRESULT WINAPI SecondaryBufferImpl_Create(
+HRESULT SecondaryBufferImpl_Create(
 	IDirectSoundBufferImpl *dsb,
 	SecondaryBufferImpl **psb)
 {
@@ -1501,7 +1501,7 @@
 	return S_OK;
 }
 
-HRESULT WINAPI SecondaryBufferImpl_Destroy(
+HRESULT SecondaryBufferImpl_Destroy(
     SecondaryBufferImpl *pdsb)
 {
     TRACE("(%p)\n",pdsb);

Modified: vendor/wine/dlls/dsound/current/capture.c
--- vendor/wine/dlls/dsound/current/capture.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/dsound/current/capture.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -44,18 +44,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(dsound);
 
-static HRESULT WINAPI IDirectSoundCaptureImpl_Initialize(
-    LPDIRECTSOUNDCAPTURE iface,
-    LPCGUID lpcGUID );
-static ULONG WINAPI IDirectSoundCaptureImpl_Release(
-    LPDIRECTSOUNDCAPTURE iface );
-static ULONG WINAPI IDirectSoundCaptureBufferImpl_Release(
-    LPDIRECTSOUNDCAPTUREBUFFER8 iface );
-static HRESULT DSOUND_CreateDirectSoundCaptureBuffer(
-    IDirectSoundCaptureImpl *ipDSC,
-    LPCDSCBUFFERDESC lpcDSCBufferDesc,
-    LPVOID* ppobj );
-
 static const IDirectSoundCaptureVtbl dscvt;
 static const IDirectSoundCaptureBuffer8Vtbl dscbvt;
 
@@ -68,30 +56,7 @@
     "STATE_STOPPING"
 };
 
-HRESULT WINAPI IDirectSoundCaptureImpl_Create(
-    LPDIRECTSOUNDCAPTURE8 * ppDSC)
-{
-    IDirectSoundCaptureImpl *pDSC;
-    TRACE("(%p)\n", ppDSC);
-
-    /* Allocate memory */
-    pDSC = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundCaptureImpl));
-    if (pDSC == NULL) {
-        WARN("out of memory\n");
-        *ppDSC = NULL;
-        return DSERR_OUTOFMEMORY;
-    }
-
-    pDSC->lpVtbl = &dscvt;
-    pDSC->ref    = 0;
-    pDSC->device = NULL;
-
-    *ppDSC = (LPDIRECTSOUNDCAPTURE8)pDSC;
-
-    return DS_OK;
-}
-
-HRESULT WINAPI DSOUND_CaptureCreate(
+static HRESULT DSOUND_CaptureCreate(
     LPDIRECTSOUNDCAPTURE *ppDSC,
     IUnknown *pUnkOuter)
 {
@@ -114,7 +79,7 @@
     return hr;
 }
 
-HRESULT WINAPI DSOUND_CaptureCreate8(
+static HRESULT DSOUND_CaptureCreate8(
     LPDIRECTSOUNDCAPTURE8 *ppDSC8,
     IUnknown *pUnkOuter)
 {
@@ -249,31 +214,6 @@
     return hr;
 }
 
-static HRESULT DirectSoundCaptureDevice_Create(
-    DirectSoundCaptureDevice ** ppDevice)
-{
-    DirectSoundCaptureDevice * device;
-    TRACE("(%p)\n", ppDevice);
-
-    /* Allocate memory */
-    device = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DirectSoundCaptureDevice));
-
-    if (device == NULL) {
-	WARN("out of memory\n");
-        return DSERR_OUTOFMEMORY;
-    }
-
-    device->ref = 1;
-    device->state = STATE_STOPPED;
-
-    InitializeCriticalSection( &(device->lock) );
-    device->lock.DebugInfo->Spare[0] = (DWORD_PTR)"DSCAPTURE_lock";
-
-    *ppDevice = device;
-
-    return DS_OK;
-}
-
 /***************************************************************************
  * DirectSoundCaptureEnumerateA [DSOUND.7]
  *
@@ -451,6 +391,9 @@
     TRACE("completed\n");
 }
 
+/***************************************************************************
+ * IDirectSoundCaptureImpl
+ */
 static HRESULT WINAPI
 IDirectSoundCaptureImpl_QueryInterface(
     LPDIRECTSOUNDCAPTURE iface,
@@ -490,35 +433,6 @@
     return ref;
 }
 
-static ULONG DirectSoundCaptureDevice_Release(
-    DirectSoundCaptureDevice * device)
-{
-    ULONG ref;
-    TRACE("(%p) ref was %lu\n", device, device->ref);
-
-    device->ref--;
-    ref=device->ref;
-    if (device->ref == 0) {
-        TRACE("deleting object\n");
-        if (device->capture_buffer)
-            IDirectSoundCaptureBufferImpl_Release(
-		(LPDIRECTSOUNDCAPTUREBUFFER8) device->capture_buffer);
-
-        if (device->driver) {
-            IDsCaptureDriver_Close(device->driver);
-            IDsCaptureDriver_Release(device->driver);
-        }
-
-        HeapFree(GetProcessHeap(), 0, device->pwfx);
-        device->lock.DebugInfo->Spare[0] = 0;
-        DeleteCriticalSection( &(device->lock) );
-        DSOUND_capture[device->drvdesc.dnDevNode] = NULL;
-        HeapFree(GetProcessHeap(), 0, device);
-	TRACE("(%p) released\n", device);
-    }
-    return ref;
-}
-
 static ULONG WINAPI
 IDirectSoundCaptureImpl_Release( LPDIRECTSOUNDCAPTURE iface )
 {
@@ -757,173 +671,26 @@
     IDirectSoundCaptureImpl_Initialize
 };
 
-static HRESULT
-DSOUND_CreateDirectSoundCaptureBuffer(
-    IDirectSoundCaptureImpl *ipDSC,
-    LPCDSCBUFFERDESC lpcDSCBufferDesc,
-    LPVOID* ppobj )
+HRESULT IDirectSoundCaptureImpl_Create(
+    LPDIRECTSOUNDCAPTURE8 * ppDSC)
 {
-    LPWAVEFORMATEX  wfex;
-    TRACE( "(%p,%p)\n", lpcDSCBufferDesc, ppobj );
+    IDirectSoundCaptureImpl *pDSC;
+    TRACE("(%p)\n", ppDSC);
 
-    if (ipDSC == NULL) {
-	WARN("invalid parameter: ipDSC == NULL\n");
-	return DSERR_INVALIDPARAM;
+    /* Allocate memory */
+    pDSC = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundCaptureImpl));
+    if (pDSC == NULL) {
+        WARN("out of memory\n");
+        *ppDSC = NULL;
+        return DSERR_OUTOFMEMORY;
     }
 
-    if (lpcDSCBufferDesc == NULL) {
-	WARN("invalid parameter: lpcDSCBufferDesc == NULL\n");
-	return DSERR_INVALIDPARAM;
-    }
+    pDSC->lpVtbl = &dscvt;
+    pDSC->ref    = 0;
+    pDSC->device = NULL;
 
-    if (ppobj == NULL) {
-	WARN("invalid parameter: ppobj == NULL\n");
-	return DSERR_INVALIDPARAM;
-    }
+    *ppDSC = (LPDIRECTSOUNDCAPTURE8)pDSC;
 
-    if ( ((lpcDSCBufferDesc->dwSize != sizeof(DSCBUFFERDESC)) &&
-          (lpcDSCBufferDesc->dwSize != sizeof(DSCBUFFERDESC1))) ||
-        (lpcDSCBufferDesc->dwBufferBytes == 0) ||
-        (lpcDSCBufferDesc->lpwfxFormat == NULL) ) {
-	WARN("invalid lpcDSCBufferDesc\n");
-	*ppobj = NULL;
-	return DSERR_INVALIDPARAM;
-    }
-
-    if ( !ipDSC->device) {
-	WARN("not initialized\n");
-	*ppobj = NULL;
-	return DSERR_UNINITIALIZED;
-    }
-
-    wfex = lpcDSCBufferDesc->lpwfxFormat;
-
-    if (wfex) {
-        TRACE("(formattag=0x%04x,chans=%d,samplerate=%ld,"
-            "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d)\n",
-            wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec,
-            wfex->nAvgBytesPerSec, wfex->nBlockAlign,
-            wfex->wBitsPerSample, wfex->cbSize);
-
-        if (wfex->wFormatTag == WAVE_FORMAT_PCM) {
-	    ipDSC->device->pwfx = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEFORMATEX));
-            CopyMemory(ipDSC->device->pwfx, wfex, sizeof(WAVEFORMATEX));
-	    ipDSC->device->pwfx->cbSize = 0;
-	} else {
-	    ipDSC->device->pwfx = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEFORMATEX)+wfex->cbSize);
-            CopyMemory(ipDSC->device->pwfx, wfex, sizeof(WAVEFORMATEX)+wfex->cbSize);
-        }
-    } else {
-	WARN("lpcDSCBufferDesc->lpwfxFormat == 0\n");
-	*ppobj = NULL;
-	return DSERR_INVALIDPARAM; /* FIXME: DSERR_BADFORMAT ? */
-    }
-
-    *ppobj = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
-        sizeof(IDirectSoundCaptureBufferImpl));
-
-    if ( *ppobj == NULL ) {
-	WARN("out of memory\n");
-	*ppobj = NULL;
-	return DSERR_OUTOFMEMORY;
-    } else {
-    	HRESULT err = DS_OK;
-        LPBYTE newbuf;
-        DWORD buflen;
-        IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)*ppobj;
-
-        This->ref = 1;
-        This->dsound = ipDSC;
-        This->dsound->device->capture_buffer = This;
-	This->notify = NULL;
-	This->nrofnotifies = 0;
-	This->hwnotify = NULL;
-
-        This->pdscbd = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
-            lpcDSCBufferDesc->dwSize);
-        if (This->pdscbd)
-            CopyMemory(This->pdscbd, lpcDSCBufferDesc, lpcDSCBufferDesc->dwSize);
-        else {
-            WARN("no memory\n");
-            This->dsound->device->capture_buffer = 0;
-            HeapFree( GetProcessHeap(), 0, This );
-            *ppobj = NULL;
-            return DSERR_OUTOFMEMORY;
-        }
-
-        This->lpVtbl = &dscbvt;
-
-	if (ipDSC->device->driver) {
-            if (This->dsound->device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN)
-                FIXME("DSDDESC_DOMMSYSTEMOPEN not supported\n");
-
-            if (This->dsound->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) {
-                /* allocate buffer from system memory */
-                buflen = lpcDSCBufferDesc->dwBufferBytes;
-                TRACE("desired buflen=%ld, old buffer=%p\n", buflen, ipDSC->device->buffer);
-                if (ipDSC->device->buffer)
-                    newbuf = HeapReAlloc(GetProcessHeap(),0,ipDSC->device->buffer,buflen);
-                else
-                    newbuf = HeapAlloc(GetProcessHeap(),0,buflen);
-
-                if (newbuf == NULL) {
-                    WARN("failed to allocate capture buffer\n");
-                    err = DSERR_OUTOFMEMORY;
-                    /* but the old buffer might still exist and must be re-prepared */
-                } else {
-                    ipDSC->device->buffer = newbuf;
-                    ipDSC->device->buflen = buflen;
-                }
-            } else {
-                /* let driver allocate memory */
-                ipDSC->device->buflen = lpcDSCBufferDesc->dwBufferBytes;
-                /* FIXME: */
-                HeapFree( GetProcessHeap(), 0, ipDSC->device->buffer);
-                ipDSC->device->buffer = NULL;
-            }
-
-	    err = IDsCaptureDriver_CreateCaptureBuffer(ipDSC->device->driver,
-		ipDSC->device->pwfx,0,0,&(ipDSC->device->buflen),&(ipDSC->device->buffer),(LPVOID*)&(ipDSC->device->hwbuf));
-	    if (err != DS_OK) {
-		WARN("IDsCaptureDriver_CreateCaptureBuffer failed\n");
-		This->dsound->device->capture_buffer = 0;
-		HeapFree( GetProcessHeap(), 0, This );
-		*ppobj = NULL;
-		return err;
-	    }
-	} else {
-	    DWORD flags = CALLBACK_FUNCTION;
-	    if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
-		flags |= WAVE_DIRECTSOUND;
-            err = mmErr(waveInOpen(&(ipDSC->device->hwi),
-                ipDSC->device->drvdesc.dnDevNode, ipDSC->device->pwfx,
-                (DWORD_PTR)DSOUND_capture_callback, (DWORD)ipDSC->device, flags));
-            if (err != DS_OK) {
-                WARN("waveInOpen failed\n");
-		This->dsound->device->capture_buffer = 0;
-		HeapFree( GetProcessHeap(), 0, This );
-		*ppobj = NULL;
-		return err;
-            }
-
-	    buflen = lpcDSCBufferDesc->dwBufferBytes;
-            TRACE("desired buflen=%ld, old buffer=%p\n", buflen, ipDSC->device->buffer);
-	    if (ipDSC->device->buffer)
-                newbuf = HeapReAlloc(GetProcessHeap(),0,ipDSC->device->buffer,buflen);
-	    else
-		newbuf = HeapAlloc(GetProcessHeap(),0,buflen);
-            if (newbuf == NULL) {
-                WARN("failed to allocate capture buffer\n");
-                err = DSERR_OUTOFMEMORY;
-                /* but the old buffer might still exist and must be re-prepared */
-            } else {
-                ipDSC->device->buffer = newbuf;
-                ipDSC->device->buflen = buflen;
-            }
-	}
-    }
-
-    TRACE("returning DS_OK\n");
     return DS_OK;
 }
 
@@ -1030,7 +797,7 @@
     IDirectSoundCaptureNotifyImpl_SetNotificationPositions,
 };
 
-HRESULT WINAPI IDirectSoundCaptureNotifyImpl_Create(
+HRESULT IDirectSoundCaptureNotifyImpl_Create(
     IDirectSoundCaptureBufferImpl *dscb,
     IDirectSoundCaptureNotifyImpl **pdscn)
 {
@@ -1720,7 +1487,234 @@
     IDirectSoundCaptureBufferImpl_GetFXStatus
 };
 
+HRESULT DSOUND_CreateDirectSoundCaptureBuffer(
+    IDirectSoundCaptureImpl *ipDSC,
+    LPCDSCBUFFERDESC lpcDSCBufferDesc,
+    LPVOID* ppobj )
+{
+    LPWAVEFORMATEX  wfex;
+    TRACE( "(%p,%p)\n", lpcDSCBufferDesc, ppobj );
+
+    if (ipDSC == NULL) {
+	WARN("invalid parameter: ipDSC == NULL\n");
+	return DSERR_INVALIDPARAM;
+    }
+
+    if (lpcDSCBufferDesc == NULL) {
+	WARN("invalid parameter: lpcDSCBufferDesc == NULL\n");
+	return DSERR_INVALIDPARAM;
+    }
+
+    if (ppobj == NULL) {
+	WARN("invalid parameter: ppobj == NULL\n");
+	return DSERR_INVALIDPARAM;
+    }
+
+    if ( ((lpcDSCBufferDesc->dwSize != sizeof(DSCBUFFERDESC)) &&
+          (lpcDSCBufferDesc->dwSize != sizeof(DSCBUFFERDESC1))) ||
+        (lpcDSCBufferDesc->dwBufferBytes == 0) ||
+        (lpcDSCBufferDesc->lpwfxFormat == NULL) ) {
+	WARN("invalid lpcDSCBufferDesc\n");
+	*ppobj = NULL;
+	return DSERR_INVALIDPARAM;
+    }
+
+    if ( !ipDSC->device) {
+	WARN("not initialized\n");
+	*ppobj = NULL;
+	return DSERR_UNINITIALIZED;
+    }
+
+    wfex = lpcDSCBufferDesc->lpwfxFormat;
+
+    if (wfex) {
+        TRACE("(formattag=0x%04x,chans=%d,samplerate=%ld,"
+            "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d)\n",
+            wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec,
+            wfex->nAvgBytesPerSec, wfex->nBlockAlign,
+            wfex->wBitsPerSample, wfex->cbSize);
+
+        if (wfex->wFormatTag == WAVE_FORMAT_PCM) {
+	    ipDSC->device->pwfx = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEFORMATEX));
+            CopyMemory(ipDSC->device->pwfx, wfex, sizeof(WAVEFORMATEX));
+	    ipDSC->device->pwfx->cbSize = 0;
+	} else {
+	    ipDSC->device->pwfx = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEFORMATEX)+wfex->cbSize);
+            CopyMemory(ipDSC->device->pwfx, wfex, sizeof(WAVEFORMATEX)+wfex->cbSize);
+        }
+    } else {
+	WARN("lpcDSCBufferDesc->lpwfxFormat == 0\n");
+	*ppobj = NULL;
+	return DSERR_INVALIDPARAM; /* FIXME: DSERR_BADFORMAT ? */
+    }
+
+    *ppobj = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
+        sizeof(IDirectSoundCaptureBufferImpl));
+
+    if ( *ppobj == NULL ) {
+	WARN("out of memory\n");
+	*ppobj = NULL;
+	return DSERR_OUTOFMEMORY;
+    } else {
+    	HRESULT err = DS_OK;
+        LPBYTE newbuf;
+        DWORD buflen;
+        IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)*ppobj;
+
+        This->ref = 1;
+        This->dsound = ipDSC;
+        This->dsound->device->capture_buffer = This;
+	This->notify = NULL;
+	This->nrofnotifies = 0;
+	This->hwnotify = NULL;
+
+        This->pdscbd = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
+            lpcDSCBufferDesc->dwSize);
+        if (This->pdscbd)
+            CopyMemory(This->pdscbd, lpcDSCBufferDesc, lpcDSCBufferDesc->dwSize);
+        else {
+            WARN("no memory\n");
+            This->dsound->device->capture_buffer = 0;
+            HeapFree( GetProcessHeap(), 0, This );
+            *ppobj = NULL;
+            return DSERR_OUTOFMEMORY;
+        }
+
+        This->lpVtbl = &dscbvt;
+
+	if (ipDSC->device->driver) {
+            if (This->dsound->device->drvdesc.dwFlags & DSDDESC_DOMMSYSTEMOPEN)
+                FIXME("DSDDESC_DOMMSYSTEMOPEN not supported\n");
+
+            if (This->dsound->device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) {
+                /* allocate buffer from system memory */
+                buflen = lpcDSCBufferDesc->dwBufferBytes;
+                TRACE("desired buflen=%ld, old buffer=%p\n", buflen, ipDSC->device->buffer);
+                if (ipDSC->device->buffer)
+                    newbuf = HeapReAlloc(GetProcessHeap(),0,ipDSC->device->buffer,buflen);
+                else
+                    newbuf = HeapAlloc(GetProcessHeap(),0,buflen);
+
+                if (newbuf == NULL) {
+                    WARN("failed to allocate capture buffer\n");
+                    err = DSERR_OUTOFMEMORY;
+                    /* but the old buffer might still exist and must be re-prepared */
+                } else {
+                    ipDSC->device->buffer = newbuf;
+                    ipDSC->device->buflen = buflen;
+                }
+            } else {
+                /* let driver allocate memory */
+                ipDSC->device->buflen = lpcDSCBufferDesc->dwBufferBytes;
+                /* FIXME: */
+                HeapFree( GetProcessHeap(), 0, ipDSC->device->buffer);
+                ipDSC->device->buffer = NULL;
+            }
+
+	    err = IDsCaptureDriver_CreateCaptureBuffer(ipDSC->device->driver,
+		ipDSC->device->pwfx,0,0,&(ipDSC->device->buflen),&(ipDSC->device->buffer),(LPVOID*)&(ipDSC->device->hwbuf));
+	    if (err != DS_OK) {
+		WARN("IDsCaptureDriver_CreateCaptureBuffer failed\n");
+		This->dsound->device->capture_buffer = 0;
+		HeapFree( GetProcessHeap(), 0, This );
+		*ppobj = NULL;
+		return err;
+	    }
+	} else {
+	    DWORD flags = CALLBACK_FUNCTION;
+	    if (ds_hw_accel != DS_HW_ACCEL_EMULATION)
+		flags |= WAVE_DIRECTSOUND;
+            err = mmErr(waveInOpen(&(ipDSC->device->hwi),
+                ipDSC->device->drvdesc.dnDevNode, ipDSC->device->pwfx,
+                (DWORD_PTR)DSOUND_capture_callback, (DWORD)ipDSC->device, flags));
+            if (err != DS_OK) {
+                WARN("waveInOpen failed\n");
+		This->dsound->device->capture_buffer = 0;
+		HeapFree( GetProcessHeap(), 0, This );
+		*ppobj = NULL;
+		return err;
+            }
+
+	    buflen = lpcDSCBufferDesc->dwBufferBytes;
+            TRACE("desired buflen=%ld, old buffer=%p\n", buflen, ipDSC->device->buffer);
+	    if (ipDSC->device->buffer)
+                newbuf = HeapReAlloc(GetProcessHeap(),0,ipDSC->device->buffer,buflen);
+	    else
+		newbuf = HeapAlloc(GetProcessHeap(),0,buflen);
+            if (newbuf == NULL) {
+                WARN("failed to allocate capture buffer\n");
+                err = DSERR_OUTOFMEMORY;
+                /* but the old buffer might still exist and must be re-prepared */
+            } else {
+                ipDSC->device->buffer = newbuf;
+                ipDSC->device->buflen = buflen;
+            }
+	}
+    }
+
+    TRACE("returning DS_OK\n");
+    return DS_OK;
+}
+
 /*******************************************************************************
+ * DirectSoundCaptureDevice
+ */
+
+HRESULT DirectSoundCaptureDevice_Create(
+    DirectSoundCaptureDevice ** ppDevice)
+{
+    DirectSoundCaptureDevice * device;
+    TRACE("(%p)\n", ppDevice);
+
+    /* Allocate memory */
+    device = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DirectSoundCaptureDevice));
+
+    if (device == NULL) {
+	WARN("out of memory\n");
+        return DSERR_OUTOFMEMORY;
+    }
+
+    device->ref = 1;
+    device->state = STATE_STOPPED;
+
+    InitializeCriticalSection( &(device->lock) );
+    device->lock.DebugInfo->Spare[0] = (DWORD_PTR)"DSCAPTURE_lock";
+
+    *ppDevice = device;
+
+    return DS_OK;
+}
+
+ULONG DirectSoundCaptureDevice_Release(
+    DirectSoundCaptureDevice * device)
+{
+    ULONG ref;
+    TRACE("(%p) ref was %lu\n", device, device->ref);
+
+    device->ref--;
+    ref=device->ref;
+    if (device->ref == 0) {
+        TRACE("deleting object\n");
+        if (device->capture_buffer)
+            IDirectSoundCaptureBufferImpl_Release(
+		(LPDIRECTSOUNDCAPTUREBUFFER8) device->capture_buffer);
+
+        if (device->driver) {
+            IDsCaptureDriver_Close(device->driver);
+            IDsCaptureDriver_Release(device->driver);
+        }
+
+        HeapFree(GetProcessHeap(), 0, device->pwfx);
+        device->lock.DebugInfo->Spare[0] = 0;
+        DeleteCriticalSection( &(device->lock) );
+        DSOUND_capture[device->drvdesc.dnDevNode] = NULL;
+        HeapFree(GetProcessHeap(), 0, device);
+	TRACE("(%p) released\n", device);
+    }
+    return ref;
+}
+
+/*******************************************************************************
  * DirectSoundCapture ClassFactory
  */
 

Modified: vendor/wine/dlls/dsound/current/dsound.c
--- vendor/wine/dlls/dsound/current/dsound.c	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/dsound/current/dsound.c	2006-01-06 16:28:07 UTC (rev 20613)
@@ -584,10 +584,16 @@
     IDirectSoundImpl *This = (IDirectSoundImpl *)iface;
     TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level));
 
+    if (This->device == NULL) {
+        WARN("not initialized\n");
+        return DSERR_UNINITIALIZED;
+    }
+
     if (level==DSSCL_PRIORITY || level==DSSCL_EXCLUSIVE) {
         WARN("level=%s not fully supported\n",
              level==DSSCL_PRIORITY ? "DSSCL_PRIORITY" : "DSSCL_EXCLUSIVE");
     }
+
     This->device->priolevel = level;
     return DS_OK;
 }
@@ -1010,7 +1016,7 @@
     return ref;
 }
 
-HRESULT WINAPI IDirectSoundImpl_Create(
+HRESULT IDirectSoundImpl_Create(
     LPDIRECTSOUND8 * ppDS)
 {
     IDirectSoundImpl* pDS;
@@ -1076,7 +1082,7 @@
     IDirectSound_IUnknown_Release
 };
 
-HRESULT WINAPI IDirectSound_IUnknown_Create(
+HRESULT IDirectSound_IUnknown_Create(
     LPDIRECTSOUND8 pds,
     LPUNKNOWN * ppunk)
 {
@@ -1237,7 +1243,7 @@
     IDirectSound_IDirectSound_Initialize
 };
 
-HRESULT WINAPI IDirectSound_IDirectSound_Create(
+HRESULT IDirectSound_IDirectSound_Create(
     LPDIRECTSOUND8  pds,
     LPDIRECTSOUND * ppds)
 {
@@ -1315,7 +1321,7 @@
     IDirectSound8_IUnknown_Release
 };
 
-HRESULT WINAPI IDirectSound8_IUnknown_Create(
+HRESULT IDirectSound8_IUnknown_Create(
     LPDIRECTSOUND8 pds,
     LPUNKNOWN * ppunk)
 {
@@ -1476,7 +1482,7 @@
     IDirectSound8_IDirectSound_Initialize
 };
 
-HRESULT WINAPI IDirectSound8_IDirectSound_Create(
+HRESULT IDirectSound8_IDirectSound_Create(
     LPDIRECTSOUND8 pds,
     LPDIRECTSOUND * ppds)
 {
@@ -1647,7 +1653,7 @@
     IDirectSound8_IDirectSound8_VerifyCertification
 };
 
-HRESULT WINAPI IDirectSound8_IDirectSound8_Create(
+HRESULT IDirectSound8_IDirectSound8_Create(
     LPDIRECTSOUND8 pds,
     LPDIRECTSOUND8 * ppds)
 {
@@ -1682,7 +1688,7 @@
     return DS_OK;
 }
 
-HRESULT WINAPI DSOUND_Create(
+HRESULT DSOUND_Create(
     LPDIRECTSOUND *ppDS,
     IUnknown *pUnkOuter)
 {
@@ -1763,7 +1769,7 @@
     return hr;
 }
 
-HRESULT WINAPI DSOUND_Create8(
+HRESULT DSOUND_Create8(
     LPDIRECTSOUND8 *ppDS,
     IUnknown *pUnkOuter)
 {

Modified: vendor/wine/dlls/dsound/current/dsound_private.h
--- vendor/wine/dlls/dsound/current/dsound_private.h	2006-01-06 15:42:12 UTC (rev 20612)
+++ vendor/wine/dlls/dsound/current/dsound_private.h	2006-01-06 16:28:07 UTC (rev 20613)
@@ -122,14 +122,14 @@
     LPBYTE                      memory;
 } BufferMemory;
 
-HRESULT WINAPI IDirectSoundImpl_Create(
+HRESULT IDirectSoundImpl_Create(
     LPDIRECTSOUND8 * ppds);
 
-HRESULT WINAPI DSOUND_Create(
+HRESULT DSOUND_Create(
     LPDIRECTSOUND *ppDS,
     IUnknown *pUnkOuter);
 
-HRESULT WINAPI DSOUND_Create8(
+HRESULT DSOUND_Create8(
     LPDIRECTSOUND8 *ppDS,
     IUnknown *pUnkOuter);
 
@@ -142,7 +142,7 @@
     LPDIRECTSOUND8              pds;
 };
 
-HRESULT WINAPI IDirectSound_IUnknown_Create(
+HRESULT IDirectSound_IUnknown_Create(
     LPDIRECTSOUND8 pds,
     LPUNKNOWN * ppunk);
 
@@ -152,7 +152,7 @@
     LPDIRECTSOUND8              pds;
 };
 
-HRESULT WINAPI IDirectSound_IDirectSound_Create(
+HRESULT IDirectSound_IDirectSound_Create(
     LPDIRECTSOUND8 pds,
     LPDIRECTSOUND * ppds);
 
@@ -165,7 +165,7 @@
     LPDIRECTSOUND8              pds;
 };
 
-HRESULT WINAPI IDirectSound8_IUnknown_Create(
+HRESULT IDirectSound8_IUnknown_Create(
     LPDIRECTSOUND8 pds,
     LPUNKNOWN * ppunk);
 
@@ -175,7 +175,7 @@
     LPDIRECTSOUND8              pds;
 };
 
-HRESULT WINAPI IDirectSound8_IDirectSound_Create(
+HRESULT IDirectSound8_IDirectSound_Create(
     LPDIRECTSOUND8 pds,
     LPDIRECTSOUND * ppds);
 
@@ -185,7 +185,7 @@
     LPDIRECTSOUND8              pds;
 };
 
-HRESULT WINAPI IDirectSound8_IDirectSound8_Create(
+HRESULT IDirectSound8_IDirectSound8_Create(
     LPDIRECTSOUND8 pds,
     LPDIRECTSOUND8 * ppds);
 
@@ -234,11 +234,11 @@
     IKsBufferPropertySetImpl*   iks;
 };
 
-HRESULT WINAPI IDirectSoundBufferImpl_Create(
+HRESULT IDirectSoundBufferImpl_Create(
     IDirectSoundImpl *ds,
     IDirectSoundBufferImpl **pdsb,
     LPCDSBUFFERDESC dsbd);
-HRESULT WINAPI IDirectSoundBufferImpl_Destroy(
+HRESULT IDirectSoundBufferImpl_Destroy(
     IDirectSoundBufferImpl *pdsb);
 
 /*****************************************************************************
@@ -251,10 +251,10 @@
     IDirectSoundBufferImpl*     dsb;
 };
 
-HRESULT WINAPI SecondaryBufferImpl_Create(
+HRESULT SecondaryBufferImpl_Create(
     IDirectSoundBufferImpl *dsb,
     SecondaryBufferImpl **pdsb);
-HRESULT WINAPI SecondaryBufferImpl_Destroy(
+HRESULT SecondaryBufferImpl_Destroy(
     SecondaryBufferImpl *pdsb);
 
 /*****************************************************************************
@@ -267,7 +267,7 @@
     IDirectSoundImpl*           dsound;
 };
 
-HRESULT WINAPI PrimaryBufferImpl_Create(
+HRESULT PrimaryBufferImpl_Create(
     IDirectSoundImpl *ds,
     PrimaryBufferImpl **pdsb,
     LPCDSBUFFERDESC dsbd);
@@ -284,6 +284,12 @@
     DirectSoundCaptureDevice          *device;
 };
 
+HRESULT IDirectSoundCaptureImpl_Create(
+    LPDIRECTSOUNDCAPTURE8 * ppds);
+
+/*****************************************************************************
+ * DirectSoundCaptureDevice implementation structure
+ */
 struct DirectSoundCaptureDevice
 {
     /* IDirectSoundCaptureImpl fields */
@@ -314,16 +320,14 @@
     CRITICAL_SECTION                   lock;
 };
 
-HRESULT WINAPI IDirectSoundCaptureImpl_Create(
-    LPDIRECTSOUNDCAPTURE8 * ppds);
[truncated at 1000 lines; 3035 more skipped]