ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2006
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
586 discussions
Start a n
N
ew thread
[gvg] 20613: Wine-0_9_5 vendor drop
by gvg@svn.reactos.org
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(IDirectSoundCaptureIm pl)); - 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(IDirectSoundCaptureIm pl)); + 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]
18 years, 10 months
1
0
0
0
[weiden] 20612: implemented ExpandEnvironmentStringsForUserA/W
by weiden@svn.reactos.org
implemented ExpandEnvironmentStringsForUserA/W Modified: trunk/reactos/lib/userenv/environment.c Modified: trunk/reactos/lib/userenv/userenv.def _____ Modified: trunk/reactos/lib/userenv/environment.c --- trunk/reactos/lib/userenv/environment.c 2006-01-06 14:50:56 UTC (rev 20611) +++ trunk/reactos/lib/userenv/environment.c 2006-01-06 15:42:12 UTC (rev 20612) @@ -394,4 +394,126 @@ return TRUE; } + +BOOL WINAPI +ExpandEnvironmentStringsForUserW(IN HANDLE hToken, + IN LPCWSTR lpSrc, + OUT LPWSTR lpDest, + IN DWORD dwSize) +{ + PVOID lpEnvironment; + BOOL Ret = FALSE; + + if (lpSrc == NULL || lpDest == NULL || dwSize == 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (CreateEnvironmentBlock(&lpEnvironment, + hToken, + FALSE)) + { + UNICODE_STRING SrcU, DestU; + NTSTATUS Status; + + /* initialize the strings */ + RtlInitUnicodeString(&SrcU, + lpSrc); + DestU.Length = 0; + DestU.MaximumLength = dwSize * sizeof(WCHAR); + DestU.Buffer = lpDest; + + /* expand the strings */ + Status = RtlExpandEnvironmentStrings_U((PWSTR)lpEnvironment, + &SrcU, + &DestU, + NULL); + + DestroyEnvironmentBlock(lpEnvironment); + + if (NT_SUCCESS(Status)) + { + Ret = TRUE; + } + else + { + SetLastError(RtlNtStatusToDosError(Status)); + } + } + + return Ret; +} + + +BOOL WINAPI +ExpandEnvironmentStringsForUserA(IN HANDLE hToken, + IN LPCSTR lpSrc, + OUT LPSTR lpDest, + IN DWORD dwSize) +{ + DWORD dwSrcLen; + LPWSTR lpSrcW = NULL, lpDestW = NULL; + BOOL Ret = FALSE; + + if (lpSrc == NULL || lpDest == NULL || dwSize == 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + dwSrcLen = strlen(lpSrc); + lpSrcW = (LPWSTR)GlobalAlloc(GMEM_FIXED, + (dwSrcLen + 1) * sizeof(WCHAR)); + if (lpSrcW == NULL || + MultiByteToWideChar(CP_ACP, + 0, + lpSrc, + -1, + lpSrcW, + dwSrcLen + 1) == 0) + { + goto Cleanup; + } + + lpDestW = (LPWSTR)GlobalAlloc(GMEM_FIXED, + dwSize * sizeof(WCHAR)); + if (lpDestW == NULL) + { + goto Cleanup; + } + + Ret = ExpandEnvironmentStringsForUserW(hToken, + lpSrcW, + lpDestW, + dwSize); + if (Ret) + { + if (WideCharToMultiByte(CP_ACP, + 0, + lpDestW, + -1, + lpDest, + dwSize, + NULL, + NULL) == 0) + { + Ret = FALSE; + } + } + +Cleanup: + if (lpSrcW != NULL) + { + GlobalFree((HGLOBAL)lpSrcW); + } + + if (lpDestW != NULL) + { + GlobalFree((HGLOBAL)lpDestW); + } + + return Ret; +} + /* EOF */ _____ Modified: trunk/reactos/lib/userenv/userenv.def --- trunk/reactos/lib/userenv/userenv.def 2006-01-06 14:50:56 UTC (rev 20611) +++ trunk/reactos/lib/userenv/userenv.def 2006-01-06 15:42:12 UTC (rev 20612) @@ -19,6 +19,8 @@ DeleteDesktopItemW@8 @116 NONAME CreateEnvironmentBlock@12 DestroyEnvironmentBlock@4 +ExpandEnvironmentStringsForUserA@16 +ExpandEnvironmentStringsForUserW@16 GetAllUsersProfileDirectoryA@8 GetAllUsersProfileDirectoryW@8 GetDefaultUserProfileDirectoryA@8
18 years, 10 months
1
0
0
0
[jimtabor] 20611: Removed DPRINT1, 8^D
by jimtabor@svn.reactos.org
Removed DPRINT1, 8^D Modified: trunk/reactos/subsys/win32k/ntuser/menu.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/menu.c --- trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 14:23:26 UTC (rev 20610) +++ trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 14:50:56 UTC (rev 20611) @@ -1659,7 +1659,7 @@ MENUBARINFO kmbi; DECLARE_RETURN(BOOL); - DPRINT1("Enter NtUserGetMenuBarInfo\n"); + DPRINT("Enter NtUserGetMenuBarInfo\n"); UserEnterShared(); if (!(WindowObject = UserGetWindowObject(hwnd))) @@ -1849,7 +1849,7 @@ RETURN(Res); CLEANUP: - DPRINT1("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); + DPRINT("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; } @@ -1887,7 +1887,7 @@ PMENU_ITEM MenuItem; DECLARE_RETURN(BOOL); - DPRINT1("Enter NtUserGetMenuItemRect\n"); + DPRINT("Enter NtUserGetMenuItemRect\n"); UserEnterShared(); if (!(Menu = UserGetMenuObject(hMenu))) @@ -1923,7 +1923,7 @@ RETURN( TRUE); CLEANUP: - DPRINT1("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); + DPRINT("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; }
18 years, 10 months
1
0
0
0
[jimtabor] 20610: Revert, thx Thomas, wasnt sure.
by jimtabor@svn.reactos.org
Revert, thx Thomas, wasnt sure. Modified: trunk/reactos/subsys/win32k/ntuser/menu.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/menu.c --- trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 13:57:38 UTC (rev 20609) +++ trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 14:23:26 UTC (rev 20610) @@ -33,7 +33,7 @@ #define NDEBUG #include <debug.h> -extern PMENU_OBJECT FASTCALL +PMENU_OBJECT FASTCALL IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu); @@ -1659,7 +1659,7 @@ MENUBARINFO kmbi; DECLARE_RETURN(BOOL); - DPRINT("Enter NtUserGetMenuBarInfo\n"); + DPRINT1("Enter NtUserGetMenuBarInfo\n"); UserEnterShared(); if (!(WindowObject = UserGetWindowObject(hwnd))) @@ -1849,7 +1849,7 @@ RETURN(Res); CLEANUP: - DPRINT("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); + DPRINT1("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; } @@ -1887,7 +1887,7 @@ PMENU_ITEM MenuItem; DECLARE_RETURN(BOOL); - DPRINT("Enter NtUserGetMenuItemRect\n"); + DPRINT1("Enter NtUserGetMenuItemRect\n"); UserEnterShared(); if (!(Menu = UserGetMenuObject(hMenu))) @@ -1923,7 +1923,7 @@ RETURN( TRUE); CLEANUP: - DPRINT("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); + DPRINT1("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; }
18 years, 10 months
1
0
0
0
[jimtabor] 20609: Should have placed extern in there.
by jimtabor@svn.reactos.org
Should have placed extern in there. Modified: trunk/reactos/subsys/win32k/ntuser/menu.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/menu.c --- trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 11:58:17 UTC (rev 20608) +++ trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 13:57:38 UTC (rev 20609) @@ -33,7 +33,7 @@ #define NDEBUG #include <debug.h> -PMENU_OBJECT FASTCALL +extern PMENU_OBJECT FASTCALL IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu);
18 years, 10 months
1
0
0
0
[weiden] 20608: fixed uninitialized variable warnings
by weiden@svn.reactos.org
fixed uninitialized variable warnings Modified: trunk/reactos/ntoskrnl/ke/wait.c _____ Modified: trunk/reactos/ntoskrnl/ke/wait.c --- trunk/reactos/ntoskrnl/ke/wait.c 2006-01-06 11:36:43 UTC (rev 20607) +++ trunk/reactos/ntoskrnl/ke/wait.c 2006-01-06 11:58:17 UTC (rev 20608) @@ -105,7 +105,7 @@ PKWAIT_BLOCK TimerWaitBlock; PKTIMER ThreadTimer; PKTHREAD CurrentThread = KeGetCurrentThread(); - NTSTATUS WaitStatus; + NTSTATUS WaitStatus = STATUS_SUCCESS; DPRINT("Entering KeDelayExecutionThread\n"); /* Check if the lock is already held */ @@ -238,7 +238,7 @@ PKWAIT_BLOCK TimerWaitBlock; PKTIMER ThreadTimer; PKTHREAD CurrentThread = KeGetCurrentThread(); - NTSTATUS WaitStatus; + NTSTATUS WaitStatus = STATUS_SUCCESS; DPRINT("Entering KeWaitForSingleObject\n"); /* Check if the lock is already held */ @@ -436,7 +436,7 @@ PKTHREAD CurrentThread = KeGetCurrentThread(); ULONG AllObjectsSignaled; ULONG WaitIndex; - NTSTATUS WaitStatus; + NTSTATUS WaitStatus = STATUS_SUCCESS; DPRINT("Entering KeWaitForMultipleObjects(Count %lu Object[] %p) " "PsGetCurrentThread() %x, Timeout %x\n", Count, Object, PsGetCurrentThread(), Timeout);
18 years, 10 months
1
0
0
0
[hbirr] 20607: Fixed the register saving in ExfInterlockedCompareExchange64.
by hbirr@svn.reactos.org
Fixed the register saving in ExfInterlockedCompareExchange64. Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S _____ Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S --- trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S 2006-01-06 08:37:46 UTC (rev 20606) +++ trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S 2006-01-06 11:36:43 UTC (rev 20607) @@ -611,8 +611,8 @@ @ExfInterlockedCompareExchange64@12: /* Save registers */ + push ebx push ebp - push ebp /* Get desination pointer, exchange value and comperand value/address */ mov ebp, ecx
18 years, 10 months
1
0
0
0
[ion] 20606: - Fix Status/WaitStatus/Thread->WaitStatus confusion/mess and reduce to a signle variable.
by ion@svn.reactos.org
- Fix Status/WaitStatus/Thread->WaitStatus confusion/mess and reduce to a signle variable. Modified: trunk/reactos/ntoskrnl/ke/wait.c _____ Modified: trunk/reactos/ntoskrnl/ke/wait.c --- trunk/reactos/ntoskrnl/ke/wait.c 2006-01-06 08:00:09 UTC (rev 20605) +++ trunk/reactos/ntoskrnl/ke/wait.c 2006-01-06 08:37:46 UTC (rev 20606) @@ -105,7 +105,7 @@ PKWAIT_BLOCK TimerWaitBlock; PKTIMER ThreadTimer; PKTHREAD CurrentThread = KeGetCurrentThread(); - NTSTATUS Status; + NTSTATUS WaitStatus; DPRINT("Entering KeDelayExecutionThread\n"); /* Check if the lock is already held */ @@ -138,8 +138,11 @@ } /* Chceck if we can do an alertable wait, if requested */ - if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status)) break; + if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &WaitStatus)) break; + /* Set status */ + CurrentThread->WaitStatus = STATUS_WAIT_0; + /* Set Timer */ ThreadTimer = &CurrentThread->Timer; @@ -159,7 +162,7 @@ if (!KiInsertTimer(ThreadTimer, *Interval)) { /* FIXME: The timer already expired, we should find a new ready thread */ - Status = STATUS_SUCCESS; + WaitStatus = STATUS_SUCCESS; break; } @@ -179,16 +182,16 @@ /* Find a new thread to run */ DPRINT("Swapping threads\n"); - Status = KiSwapThread(); + WaitStatus = KiSwapThread(); /* Check if we were executing an APC or if we timed out */ - if (Status != STATUS_KERNEL_APC) + if (WaitStatus != STATUS_KERNEL_APC) { /* This is a good thing */ - if (Status == STATUS_TIMEOUT) Status = STATUS_SUCCESS; + if (WaitStatus == STATUS_TIMEOUT) WaitStatus = STATUS_SUCCESS; /* Return Status */ - return Status; + return WaitStatus; } /* FIXME: Fixup interval */ @@ -204,7 +207,7 @@ DPRINT("Returning from KeDelayExecutionThread(), %x. Status: %d\n", KeGetCurrentThread(), Status); KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); - return Status; + return WaitStatus; } /* @@ -235,7 +238,6 @@ PKWAIT_BLOCK TimerWaitBlock; PKTIMER ThreadTimer; PKTHREAD CurrentThread = KeGetCurrentThread(); - NTSTATUS Status; NTSTATUS WaitStatus; DPRINT("Entering KeWaitForSingleObject\n"); @@ -265,8 +267,8 @@ goto SkipWait; } - /* Get the current Wait Status */ - WaitStatus = CurrentThread->WaitStatus; + /* Set default status */ + CurrentThread->WaitStatus = STATUS_WAIT_0; /* Append wait block to the KTHREAD wait block list */ CurrentThread->WaitBlockList = WaitBlock = &CurrentThread->WaitBlock[0]; @@ -286,7 +288,7 @@ { /* It has a normal signal state, so unwait it and return */ KiSatisfyMutantWait(CurrentObject, CurrentThread); - Status = STATUS_WAIT_0; + WaitStatus = CurrentThread->WaitStatus; goto DontWait; } else @@ -301,23 +303,20 @@ { /* Another satisfied object */ KiSatisfyNonMutantWait(CurrentObject, CurrentThread); - Status = STATUS_WAIT_0; + WaitStatus = STATUS_WAIT_0; goto DontWait; } /* Set up the Wait Block */ WaitBlock->Object = CurrentObject; WaitBlock->Thread = CurrentThread; - WaitBlock->WaitKey = (USHORT)(STATUS_WAIT_0); + WaitBlock->WaitKey = (USHORT)(STATUS_SUCCESS); WaitBlock->WaitType = WaitAny; WaitBlock->NextWaitBlock = WaitBlock; /* Make sure we can satisfy the Alertable request */ - if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status)) break; + if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &WaitStatus)) break; - /* Set the Wait Status */ - CurrentThread->WaitStatus = Status; - /* Enable the Timeout Timer if there was any specified */ if (Timeout) { @@ -325,7 +324,7 @@ if (!Timeout->QuadPart) { /* Return a timeout */ - Status = STATUS_TIMEOUT; + WaitStatus = STATUS_TIMEOUT; goto DontWait; } @@ -352,7 +351,7 @@ if (!KiInsertTimer(ThreadTimer, *Timeout)) { /* Return a timeout if we couldn't insert the timer */ - Status = STATUS_TIMEOUT; + WaitStatus = STATUS_TIMEOUT; goto DontWait; } } @@ -377,13 +376,13 @@ /* Find a new thread to run */ DPRINT("Swapping threads\n"); - Status = KiSwapThread(); + WaitStatus = KiSwapThread(); /* Check if we were executing an APC */ - if (Status != STATUS_KERNEL_APC) + if (WaitStatus != STATUS_KERNEL_APC) { /* Return Status */ - return Status; + return WaitStatus; } /* Check if we had a timeout */ @@ -401,9 +400,9 @@ /* Release the Lock, we are done */ DPRINT("Returning from KeWaitForMultipleObjects(), %x. Status: %d\n", - KeGetCurrentThread(), Status); + KeGetCurrentThread(), WaitStatus); KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); - return Status; + return WaitStatus; DontWait: /* Adjust the Quantum */ @@ -411,15 +410,16 @@ /* Release & Return */ DPRINT("Quick-return from KeWaitForMultipleObjects(), %x. Status: %d\n.", - KeGetCurrentThread(), Status); + KeGetCurrentThread(), WaitStatus); KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); - return Status; + return WaitStatus; } /* * @implemented */ -NTSTATUS STDCALL +NTSTATUS +STDCALL KeWaitForMultipleObjects(ULONG Count, PVOID Object[], WAIT_TYPE WaitType, @@ -436,7 +436,6 @@ PKTHREAD CurrentThread = KeGetCurrentThread(); ULONG AllObjectsSignaled; ULONG WaitIndex; - NTSTATUS Status; NTSTATUS WaitStatus; DPRINT("Entering KeWaitForMultipleObjects(Count %lu Object[] %p) " "PsGetCurrentThread() %x, Timeout %x\n", @@ -486,12 +485,12 @@ goto SkipWait; } - /* Get the current Wait Status */ - WaitStatus = CurrentThread->WaitStatus; - /* Append wait block to the KTHREAD wait block list */ CurrentThread->WaitBlockList = WaitBlock = WaitBlockArray; + /* Set default wait status */ + CurrentThread->WaitStatus = STATUS_WAIT_0; + /* Check if the wait is (already) satisfied */ AllObjectsSignaled = TRUE; @@ -516,7 +515,7 @@ { /* Normal signal state, so unwait it and return */ KiSatisfyMutantWait(CurrentObject, CurrentThread); - Status = STATUS_WAIT_0 | WaitIndex; + WaitStatus = CurrentThread->WaitStatus | WaitIndex; goto DontWait; } else @@ -531,7 +530,7 @@ { /* Another signaled object, unwait and return */ KiSatisfyNonMutantWait(CurrentObject, CurrentThread); - Status = WaitIndex; + WaitStatus = WaitIndex; goto DontWait; } } @@ -585,16 +584,13 @@ /* Satisfy their Waits and return to the caller */ KiSatisifyMultipleObjectWaits(WaitBlock); - Status = STATUS_WAIT_0; + WaitStatus = CurrentThread->WaitStatus; goto DontWait; } /* Make sure we can satisfy the Alertable request */ - if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status)) break; + if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &WaitStatus)) break; - /* Set the Wait Status */ - CurrentThread->WaitStatus = Status; - /* Enable the Timeout Timer if there was any specified */ if (Timeout) { @@ -602,7 +598,7 @@ if (!Timeout->QuadPart) { /* Return a timeout */ - Status = STATUS_TIMEOUT; + WaitStatus = STATUS_TIMEOUT; goto DontWait; } @@ -627,7 +623,7 @@ if (!KiInsertTimer(ThreadTimer, *Timeout)) { /* Return a timeout if we couldn't insert the timer */ - Status = STATUS_TIMEOUT; + WaitStatus = STATUS_TIMEOUT; goto DontWait; } } @@ -664,14 +660,14 @@ /* Find a new thread to run */ DPRINT("Swapping threads\n"); - Status = KiSwapThread(); + WaitStatus = KiSwapThread(); /* Check if we were executing an APC */ DPRINT("Thread is back\n"); - if (Status != STATUS_KERNEL_APC) + if (WaitStatus != STATUS_KERNEL_APC) { /* Return Status */ - return Status; + return WaitStatus; } /* Check if we had a timeout */ @@ -688,9 +684,9 @@ while (TRUE); /* Release the Lock, we are done */ - DPRINT("Returning, %x. Status: %d\n", KeGetCurrentThread(), Status); + DPRINT("Returning, %x. Status: %d\n", KeGetCurrentThread(), WaitStatus); KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); - return Status; + return WaitStatus; DontWait: /* Adjust the Quantum */ @@ -698,9 +694,9 @@ /* Release & Return */ DPRINT("Returning, %x. Status: %d\n. We did not wait.", - KeGetCurrentThread(), Status); + KeGetCurrentThread(), WaitStatus); KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); - return Status; + return WaitStatus; } VOID
18 years, 10 months
1
0
0
0
[ion] 20605: - Invert CONFIG_SMP defines as requested by Hartmut
by ion@svn.reactos.org
- Invert CONFIG_SMP defines as requested by Hartmut - Remove KiBlockThread and replace by more elegant KiSwapThread which will also make moving to the new scheduler easier. - Handle special case where we have kernel apcs pending and your previous irql was below apc_level during the wait code. - Remove hack to manually unwait a thread during a status of kernel apc. Modified: trunk/reactos/ntoskrnl/include/internal/ke.h Modified: trunk/reactos/ntoskrnl/ke/gate.c Modified: trunk/reactos/ntoskrnl/ke/kthread.c Modified: trunk/reactos/ntoskrnl/ke/queue.c Modified: trunk/reactos/ntoskrnl/ke/wait.c _____ Modified: trunk/reactos/ntoskrnl/include/internal/ke.h --- trunk/reactos/ntoskrnl/include/internal/ke.h 2006-01-06 06:38:47 UTC (rev 20604) +++ trunk/reactos/ntoskrnl/include/internal/ke.h 2006-01-06 08:00:09 UTC (rev 20605) @@ -48,13 +48,7 @@ * On UP machines, we don't actually have a spinlock, we merely raise * IRQL to DPC level. */ -#ifndef CONFIG_SMP -#define KeInitializeDispatcher() -#define KeAcquireDispatcherDatabaseLock() KeRaiseIrqlToDpcLevel(); -#define KeReleaseDispatcherDatabaseLock(OldIrql) KiExitDispatcher(OldIrql); -#define KeAcquireDispatcherDatabaseLockAtDpcLevel() -#define KeReleaseDispatcherDatabaseLockFromDpcLevel() -#else +#ifdef CONFIG_SMP #define KeInitializeDispatcher() KeInitializeSpinLock(&DispatcherDatabaseLock); #define KeAcquireDispatcherDatabaseLock() KfAcquireSpinLock(&DispatcherDatabaseLock); #define KeAcquireDispatcherDatabaseLockAtDpcLevel() \ @@ -64,6 +58,12 @@ #define KeReleaseDispatcherDatabaseLock(OldIrql) \ KeReleaseSpinLockFromDpcLevel(&DispatcherDatabaseLock); \ KiExitDispatcher(OldIrql); +#else +#define KeInitializeDispatcher() +#define KeAcquireDispatcherDatabaseLock() KeRaiseIrqlToDpcLevel(); +#define KeReleaseDispatcherDatabaseLock(OldIrql) KiExitDispatcher(OldIrql); +#define KeAcquireDispatcherDatabaseLockAtDpcLevel() +#define KeReleaseDispatcherDatabaseLockFromDpcLevel() #endif /* The following macro initializes a dispatcher object's header */ @@ -232,14 +232,11 @@ STDCALL KiDispatchThread(ULONG NewThreadStatus); -/* Puts a Thread into a block state. */ -VOID -STDCALL -KiBlockThread( - PNTSTATUS Status, - UCHAR Alertable, - ULONG WaitMode, - UCHAR WaitReason +/* Finds a new thread to run */ +NTSTATUS +NTAPI +KiSwapThread( + VOID ); /* Removes a thread out of a block state. */ _____ Modified: trunk/reactos/ntoskrnl/ke/gate.c --- trunk/reactos/ntoskrnl/ke/gate.c 2006-01-06 06:38:47 UTC (rev 20604) +++ trunk/reactos/ntoskrnl/ke/gate.c 2006-01-06 08:00:09 UTC (rev 20605) @@ -78,13 +78,16 @@ KiWakeQueue(CurrentThread->Queue); } - /* Block the Thread */ - DPRINT("Blocking the Thread: %x\n", CurrentThread); - KiBlockThread(&Status, - CurrentThread->Alertable, - WaitMode, - WaitReason); + /* Setup the wait information */ + CurrentThread->WaitMode = WaitMode; + CurrentThread->WaitReason = WaitReason; + CurrentThread->WaitTime = 0; + CurrentThread->State = Waiting; + /* Find a new thread to run */ + DPRINT("Swapping threads\n"); + Status = KiSwapThread(); + /* Check if we were executing an APC */ if (Status != STATUS_KERNEL_APC) return; _____ Modified: trunk/reactos/ntoskrnl/ke/kthread.c --- trunk/reactos/ntoskrnl/ke/kthread.c 2006-01-06 06:38:47 UTC (rev 20604) +++ trunk/reactos/ntoskrnl/ke/kthread.c 2006-01-06 08:00:09 UTC (rev 20605) @@ -172,48 +172,22 @@ KEBUGCHECK(0); } -VOID -STDCALL -KiBlockThread(PNTSTATUS Status, - UCHAR Alertable, - ULONG WaitMode, - UCHAR WaitReason) +NTSTATUS +NTAPI +KiSwapThread(VOID) { - PKTHREAD Thread = KeGetCurrentThread(); - PKWAIT_BLOCK WaitBlock; + PKTHREAD CurrentThread = KeGetCurrentThread(); - if (Thread->ApcState.KernelApcPending) { + /* Find a new thread to run */ + DPRINT("Dispatching Thread as blocked\n"); + KiDispatchThreadNoLock(Waiting); - DPRINT("Dispatching Thread as ready (APC!)\n"); + /* Lower IRQL back */ + DPRINT("Lowering IRQL \n"); + KfLowerIrql(CurrentThread->WaitIrql); - /* Remove Waits */ - WaitBlock = Thread->WaitBlockList; - do { - RemoveEntryList (&WaitBlock->WaitListEntry); - WaitBlock = WaitBlock->NextWaitBlock; - } while (WaitBlock != Thread->WaitBlockList); - Thread->WaitBlockList = NULL; - - /* Dispatch it and return status */ - KiDispatchThreadNoLock (Ready); - if (Status != NULL) *Status = STATUS_KERNEL_APC; - - } else { - - /* Set the Thread Data as Requested */ - DPRINT("Dispatching Thread as blocked: %d\n", Thread->WaitStatus); - Thread->Alertable = Alertable; - Thread->WaitMode = (UCHAR)WaitMode; - Thread->WaitReason = WaitReason; - - /* Dispatch it and return status */ - KiDispatchThreadNoLock(Waiting); - DPRINT("Dispatching Thread as blocked: %d\n", Thread->WaitStatus); - if (Status != NULL) *Status = Thread->WaitStatus; - } - - DPRINT("Releasing Dispatcher Lock\n"); - KfLowerIrql(Thread->WaitIrql); + /* Return the wait status */ + return CurrentThread->WaitStatus; } VOID _____ Modified: trunk/reactos/ntoskrnl/ke/queue.c --- trunk/reactos/ntoskrnl/ke/queue.c 2006-01-06 06:38:47 UTC (rev 20604) +++ trunk/reactos/ntoskrnl/ke/queue.c 2006-01-06 08:00:09 UTC (rev 20605) @@ -286,13 +286,17 @@ InsertTailList(&Queue->Header.WaitListHead, &WaitBlock->WaitListEntry); - /* Block the Thread */ - DPRINT("Blocking the Thread: %x %x!\n", KeGetCurrentThread(), Thread); - KiBlockThread(&Status, - FALSE, - WaitMode, - WrQueue); + /* Setup the wait information */ + Thread->WaitMode = WaitMode; + Thread->WaitReason = WrQueue; + Thread->Alertable = FALSE; + Thread->WaitTime = 0; + Thread->State = Waiting; + /* Find a new thread to run */ + DPRINT("Swapping threads\n"); + Status = KiSwapThread(); + /* Reset the wait reason */ Thread->WaitReason = 0; _____ Modified: trunk/reactos/ntoskrnl/ke/wait.c --- trunk/reactos/ntoskrnl/ke/wait.c 2006-01-06 06:38:47 UTC (rev 20604) +++ trunk/reactos/ntoskrnl/ke/wait.c 2006-01-06 08:00:09 UTC (rev 20605) @@ -106,7 +106,6 @@ PKTIMER ThreadTimer; PKTHREAD CurrentThread = KeGetCurrentThread(); NTSTATUS Status; - DPRINT("Entering KeDelayExecutionThread\n"); /* Check if the lock is already held */ @@ -129,6 +128,15 @@ /* Start Wait Loop */ do { + /* Check if a kernel APC is pending and we were below APC_LEVEL */ + if ((CurrentThread->ApcState.KernelApcPending) && + (CurrentThread->WaitIrql < APC_LEVEL)) + { + /* Unlock the dispatcher */ + KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); + goto SkipWait; + } + /* Chceck if we can do an alertable wait, if requested */ if (KiCheckAlertability(Alertable, CurrentThread, WaitMode, &Status)) break; @@ -162,14 +170,17 @@ KiWakeQueue(CurrentThread->Queue); } - /* Block the Thread */ - DPRINT("Blocking the Thread: %d, %d, %x\n", - Alertable, WaitMode, KeGetCurrentThread()); - KiBlockThread(&Status, - Alertable, - WaitMode, - DelayExecution); + /* Setup the wait information */ + CurrentThread->Alertable = Alertable; + CurrentThread->WaitMode = WaitMode; + CurrentThread->WaitReason = DelayExecution; + CurrentThread->WaitTime = 0; + CurrentThread->State = Waiting; + /* Find a new thread to run */ + DPRINT("Swapping threads\n"); + Status = KiSwapThread(); + /* Check if we were executing an APC or if we timed out */ if (Status != STATUS_KERNEL_APC) { @@ -180,7 +191,11 @@ return Status; } - DPRINT("Looping Again\n"); // FIXME: Need to modify interval + /* FIXME: Fixup interval */ + + /* Acquire again the lock */ +SkipWait: + DPRINT("Looping again\n"); CurrentThread->WaitIrql = KeAcquireDispatcherDatabaseLock(); } while (TRUE); @@ -241,6 +256,15 @@ /* Start the actual Loop */ do { + /* Check if a kernel APC is pending and we were below APC_LEVEL */ + if ((CurrentThread->ApcState.KernelApcPending) && + (CurrentThread->WaitIrql < APC_LEVEL)) + { + /* Unlock the dispatcher */ + KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); + goto SkipWait; + } + /* Get the current Wait Status */ WaitStatus = CurrentThread->WaitStatus; @@ -344,14 +368,17 @@ KiWakeQueue(CurrentThread->Queue); } - /* Block the Thread */ - DPRINT("Blocking the Thread: %d, %d, %d, %x\n", - Alertable, WaitMode, WaitReason, KeGetCurrentThread()); - KiBlockThread(&Status, - Alertable, - WaitMode, - (UCHAR)WaitReason); + /* Setup the wait information */ + CurrentThread->Alertable = Alertable; + CurrentThread->WaitMode = WaitMode; + CurrentThread->WaitReason = WaitReason; + CurrentThread->WaitTime = 0; + CurrentThread->State = Waiting; + /* Find a new thread to run */ + DPRINT("Swapping threads\n"); + Status = KiSwapThread(); + /* Check if we were executing an APC */ if (Status != STATUS_KERNEL_APC) { @@ -359,8 +386,15 @@ return Status; } - /* Loop again and acquire the dispatcher lock */ - DPRINT("Looping Again\n"); // FIXME: Change interval + /* Check if we had a timeout */ + if (Timeout) + { + /* FIXME: Fixup interval */ + } + + /* Acquire again the lock */ +SkipWait: + DPRINT("Looping again\n"); CurrentThread->WaitIrql = KeAcquireDispatcherDatabaseLock(); } while (TRUE); @@ -443,6 +477,15 @@ /* Start the actual Loop */ do { + /* Check if a kernel APC is pending and we were below APC_LEVEL */ + if ((CurrentThread->ApcState.KernelApcPending) && + (CurrentThread->WaitIrql < APC_LEVEL)) + { + /* Unlock the dispatcher */ + KeReleaseDispatcherDatabaseLock(CurrentThread->WaitIrql); + goto SkipWait; + } + /* Get the current Wait Status */ WaitStatus = CurrentThread->WaitStatus; @@ -612,14 +655,17 @@ KiWakeQueue(CurrentThread->Queue); } - /* Block the Thread */ - DPRINT("Blocking the Thread: %d, %d, %d, %x\n", - Alertable, WaitMode, WaitReason, KeGetCurrentThread()); - KiBlockThread(&Status, - Alertable, - WaitMode, - (UCHAR)WaitReason); + /* Setup the wait information */ + CurrentThread->Alertable = Alertable; + CurrentThread->WaitMode = WaitMode; + CurrentThread->WaitReason = WaitReason; + CurrentThread->WaitTime = 0; + CurrentThread->State = Waiting; + /* Find a new thread to run */ + DPRINT("Swapping threads\n"); + Status = KiSwapThread(); + /* Check if we were executing an APC */ DPRINT("Thread is back\n"); if (Status != STATUS_KERNEL_APC) @@ -628,8 +674,15 @@ return Status; } - /* Loop again and re-acquire the dispatcher lock */ - DPRINT("Looping Again\n"); // FIXME: Fix-up the interval */ + /* Check if we had a timeout */ + if (Timeout) + { + /* FIXME: Fixup interval */ + } + + /* Acquire again the lock */ +SkipWait: + DPRINT("Looping again\n"); CurrentThread->WaitIrql = KeAcquireDispatcherDatabaseLock(); } while (TRUE);
18 years, 10 months
1
0
0
0
[jimtabor] 20604: Need extra proto.
by jimtabor@svn.reactos.org
Need extra proto. Modified: trunk/reactos/subsys/win32k/ntuser/menu.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/menu.c --- trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 06:32:05 UTC (rev 20603) +++ trunk/reactos/subsys/win32k/ntuser/menu.c 2006-01-06 06:38:47 UTC (rev 20604) @@ -33,7 +33,11 @@ #define NDEBUG #include <debug.h> +PMENU_OBJECT FASTCALL +IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu); + + /* STATIC FUNCTION ***********************************************************/ static
18 years, 10 months
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200