winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
734 discussions
Start a n
N
ew thread
Michael Stefaniuc : kernel32: Do not cast zero.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: c9a10b32b438d8b2563c9e6a9a41d256a74cfee6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9a10b32b438d8b2563c9e6a9…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 3 22:35:08 2008 +0100 kernel32: Do not cast zero. --- dlls/kernel32/ne_module.c | 2 +- dlls/kernel32/task.c | 8 ++++---- dlls/kernel32/tests/sync.c | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/kernel32/ne_module.c b/dlls/kernel32/ne_module.c index dae1a0d..0342a5c 100644 --- a/dlls/kernel32/ne_module.c +++ b/dlls/kernel32/ne_module.c @@ -1750,7 +1750,7 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, LPCSTR name ) ordinal = LOWORD(name); TRACE("%04x %04x\n", hModule, ordinal ); } - if (!ordinal) return (FARPROC16)0; + if (!ordinal) return NULL; ret = NE_GetEntryPoint( hModule, ordinal ); diff --git a/dlls/kernel32/task.c b/dlls/kernel32/task.c index fcba2e9..553d1b3 100644 --- a/dlls/kernel32/task.c +++ b/dlls/kernel32/task.c @@ -205,7 +205,7 @@ static SEGPTR TASK_AllocThunk(void) { sel = GLOBAL_Alloc( GMEM_FIXED, sizeof(THUNKS) + (MIN_THUNKS-1)*8, pTask->hPDB, WINE_LDT_FLAGS_CODE ); - if (!sel) return (SEGPTR)0; + if (!sel) return 0; TASK_CreateThunks( sel, 0, MIN_THUNKS ); pThunk->next = sel; } @@ -860,7 +860,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance ) if (!HIWORD(func)) { /* Win95 actually protects via SEH, but this is better for debugging */ WARN("Ouch ! Called with invalid func %p !\n", func); - return (FARPROC16)0; + return NULL; } if ( (GlobalHandleToSel16(CURRENT_DS) != hInstanceSelector) @@ -884,7 +884,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance ) return func; thunkaddr = TASK_AllocThunk(); - if (!thunkaddr) return (FARPROC16)0; + if (!thunkaddr) return NULL; thunk = MapSL( thunkaddr ); lfunc = MapSL( (SEGPTR)func ); @@ -990,7 +990,7 @@ HANDLE16 WINAPI GetCodeHandle16( FARPROC16 proc ) SEGTABLEENTRY *pSeg; if ( !TASK_GetCodeSegment( proc, NULL, &pSeg, NULL ) ) - return (HANDLE16)0; + return 0; return pSeg->hSeg; } diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index dbf7929..ade9b74 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -740,8 +740,7 @@ static void test_timer_queue(void) /* Run once and finish quickly (should be done when we delete it). */ t1 = NULL; - ret = pCreateTimerQueueTimer(&t1, q, timer_queue_cb5, (PVOID) 0, 0, - 0, 0); + ret = pCreateTimerQueueTimer(&t1, q, timer_queue_cb5, NULL, 0, 0, 0); ok(ret, "CreateTimerQueueTimer\n"); ok(t1 != NULL, "CreateTimerQueueTimer\n"); @@ -754,8 +753,7 @@ static void test_timer_queue(void) /* Run once and finish quickly (should be done when we delete it). */ t3 = NULL; - ret = pCreateTimerQueueTimer(&t3, q, timer_queue_cb5, (PVOID) 0, 0, - 0, 0); + ret = pCreateTimerQueueTimer(&t3, q, timer_queue_cb5, NULL, 0, 0, 0); ok(ret, "CreateTimerQueueTimer\n"); ok(t3 != NULL, "CreateTimerQueueTimer\n");
1
0
0
0
Michael Stefaniuc : riched20: Remove superflous casts.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: 90024d03b2d1ee694f6fa56c45157f168efd9554 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=90024d03b2d1ee694f6fa56c4…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 3 22:36:03 2008 +0100 riched20: Remove superflous casts. --- dlls/riched20/clipboard.c | 4 ++-- dlls/riched20/editor.c | 10 +++++----- dlls/riched20/para.c | 2 +- dlls/riched20/string.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/riched20/clipboard.c b/dlls/riched20/clipboard.c index ce986ed..b26222d 100644 --- a/dlls/riched20/clipboard.c +++ b/dlls/riched20/clipboard.c @@ -334,7 +334,7 @@ static HGLOBAL get_unicode_text(ME_TextEditor *editor, const CHARRANGE *lpchrg) pars = ME_CountParagraphsBetween(editor, lpchrg->cpMin, lpchrg->cpMax); len = lpchrg->cpMax-lpchrg->cpMin; ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(WCHAR)*(len+pars+1)); - data = (WCHAR *)GlobalLock(ret); + data = GlobalLock(ret); len = ME_GetTextW(editor, data, lpchrg->cpMin, len, TRUE); data[len] = 0; GlobalUnlock(ret); @@ -359,7 +359,7 @@ static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG int nNewSize = (((nMaxSize+cb+1)|0x1FFFF)+1) & 0xFFFE0000; pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0); } - pDest = (BYTE *)GlobalLock(pData->hData); + pDest = GlobalLock(pData->hData); memcpy(pDest + pData->nLength, lpBuff, cb); pData->nLength += cb; pDest[pData->nLength] = '\0'; diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index ce754b9..29aa577 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1952,7 +1952,7 @@ static DWORD CALLBACK ME_ReadFromHGLOBALUnicode(DWORD_PTR dwCookie, LPBYTE lpBuf cb = cb >> 1; pDest = (WORD *)lpBuff; - pSrc = (WORD *)GlobalLock(pData->hData); + pSrc = GlobalLock(pData->hData); for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) { pDest[i] = pSrc[pData->nLength+i]; } @@ -1969,7 +1969,7 @@ static DWORD CALLBACK ME_ReadFromHGLOBALRTF(DWORD_PTR dwCookie, LPBYTE lpBuff, L BYTE *pSrc, *pDest; pDest = lpBuff; - pSrc = (BYTE *)GlobalLock(pData->hData); + pSrc = GlobalLock(pData->hData); for (i = 0; i<cb && pSrc[pData->nLength+i]; i++) { pDest[i] = pSrc[pData->nLength+i]; } @@ -4332,7 +4332,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance) wcW.hInstance = NULL; /* hInstance would register DLL-local class */ wcW.hIcon = NULL; wcW.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM)); - wcW.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); + wcW.hbrBackground = GetStockObject(NULL_BRUSH); wcW.lpszMenuName = NULL; if (is_version_nt()) @@ -4358,7 +4358,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance) wcA.hInstance = NULL; /* hInstance would register DLL-local class */ wcA.hIcon = NULL; wcA.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM)); - wcA.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); + wcA.hbrBackground = GetStockObject(NULL_BRUSH); wcA.lpszMenuName = NULL; wcA.lpszClassName = "RichEdit20A"; if (!RegisterClassA(&wcA)) return FALSE; @@ -4658,7 +4658,7 @@ BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, int sel_min, int sel_max) { if (sel_max - sel_min < prefixes[i].length) continue; if (bufferW == NULL) { - bufferW = (LPWSTR)heap_alloc((sel_max - sel_min + 1) * sizeof(WCHAR)); + bufferW = heap_alloc((sel_max - sel_min + 1) * sizeof(WCHAR)); } ME_GetTextW(editor, bufferW, sel_min, min(sel_max - sel_min, strlen(prefixes[i].text)), 0); MultiByteToWideChar(CP_ACP, 0, prefixes[i].text, -1, bufW, 32); diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index 565e323..9cf4d97 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -38,7 +38,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) ME_InitContext(&c, editor, GetDC(editor->hWnd)); - hf = (HFONT)GetStockObject(SYSTEM_FONT); + hf = GetStockObject(SYSTEM_FONT); assert(hf); GetObjectW(hf, sizeof(LOGFONTW), &lf); ZeroMemory(&cf, sizeof(cf)); diff --git a/dlls/riched20/string.c b/dlls/riched20/string.c index 7da521c..4a5d590 100644 --- a/dlls/riched20/string.c +++ b/dlls/riched20/string.c @@ -342,7 +342,7 @@ ME_CallWordBreakProc(ME_TextEditor *editor, ME_String *str, INT start, INT code) int result; int buffer_size = WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen, NULL, 0, NULL, NULL); - char *buffer = (char*)heap_alloc(buffer_size); + char *buffer = heap_alloc(buffer_size); WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen, buffer, buffer_size, NULL, NULL); result = editor->pfnWordBreak(str->szData, start, str->nLen, code);
1
0
0
0
Michael Stefaniuc : wined3d: Use the integer variant of zero instead of casting "0.0".
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: efeab9d2004fc63e13181933ab9b7aee548a7c96 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=efeab9d2004fc63e13181933a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 3 22:34:44 2008 +0100 wined3d: Use the integer variant of zero instead of casting "0.0". --- dlls/wined3d/stateblock.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 7d7d45b..0d99134 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1206,13 +1206,13 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat This->textureState[i][WINED3DTSS_ALPHAOP ] = (i==0)? WINED3DTOP_SELECTARG1 : WINED3DTOP_DISABLE; This->textureState[i][WINED3DTSS_ALPHAARG1 ] = WINED3DTA_TEXTURE; This->textureState[i][WINED3DTSS_ALPHAARG2 ] = WINED3DTA_CURRENT; - This->textureState[i][WINED3DTSS_BUMPENVMAT00 ] = (DWORD) 0.0; - This->textureState[i][WINED3DTSS_BUMPENVMAT01 ] = (DWORD) 0.0; - This->textureState[i][WINED3DTSS_BUMPENVMAT10 ] = (DWORD) 0.0; - This->textureState[i][WINED3DTSS_BUMPENVMAT11 ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_BUMPENVMAT00 ] = 0; + This->textureState[i][WINED3DTSS_BUMPENVMAT01 ] = 0; + This->textureState[i][WINED3DTSS_BUMPENVMAT10 ] = 0; + This->textureState[i][WINED3DTSS_BUMPENVMAT11 ] = 0; This->textureState[i][WINED3DTSS_TEXCOORDINDEX ] = i; - This->textureState[i][WINED3DTSS_BUMPENVLSCALE ] = (DWORD) 0.0; - This->textureState[i][WINED3DTSS_BUMPENVLOFFSET ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_BUMPENVLSCALE ] = 0; + This->textureState[i][WINED3DTSS_BUMPENVLOFFSET ] = 0; This->textureState[i][WINED3DTSS_TEXTURETRANSFORMFLAGS ] = WINED3DTTFF_DISABLE; This->textureState[i][WINED3DTSS_ADDRESSW ] = WINED3DTADDRESS_WRAP; This->textureState[i][WINED3DTSS_COLORARG0 ] = WINED3DTA_CURRENT;
1
0
0
0
Michael Stefaniuc : comctl32/tests: Use MAKELPARAM instead of "(LPARAM) MAKELONG".
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: 06c4de04612851f9112878010739950daf8bb856 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06c4de04612851f9112878010…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Nov 3 22:32:30 2008 +0100 comctl32/tests: Use MAKELPARAM instead of "(LPARAM) MAKELONG". --- dlls/comctl32/tests/listview.c | 16 ++++++++-------- dlls/comctl32/tests/tooltips.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 7f7d7cb..56d9bf0 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -78,9 +78,9 @@ static const struct message redraw_listview_seq[] = { }; static const struct message listview_icon_spacing_seq[] = { - { LVM_SETICONSPACING, sent|lparam, 0, (LPARAM) MAKELONG(20, 30) }, - { LVM_SETICONSPACING, sent|lparam, 0, (LPARAM) MAKELONG(25, 35) }, - { LVM_SETICONSPACING, sent|lparam, 0, (LPARAM) MAKELONG(-1, -1) }, + { LVM_SETICONSPACING, sent|lparam, 0, MAKELPARAM(20, 30) }, + { LVM_SETICONSPACING, sent|lparam, 0, MAKELPARAM(25, 35) }, + { LVM_SETICONSPACING, sent|lparam, 0, MAKELPARAM(-1, -1) }, { 0 } }; @@ -866,10 +866,10 @@ static void test_icon_spacing(void) expect(NFR_ANSI, r); /* reset the icon spacing to defaults */ - SendMessage(hwnd, LVM_SETICONSPACING, 0, (LPARAM) MAKELONG(-1, -1)); + SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1, -1)); /* now we can request what the defaults are */ - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, (LPARAM) MAKELONG(-1, -1)); + r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1, -1)); w = LOWORD(r); h = HIWORD(r); @@ -877,15 +877,15 @@ static void test_icon_spacing(void) trace("test icon spacing\n"); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, (LPARAM) MAKELONG(20, 30)); + r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(20, 30)); ok(r == MAKELONG(w, h) || broken(r == MAKELONG(w, w)), /* win98 */ "Expected %d, got %d\n", MAKELONG(w, h), r); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, (LPARAM) MAKELONG(25, 35)); + r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(25, 35)); expect(MAKELONG(20,30), r); - r = SendMessage(hwnd, LVM_SETICONSPACING, 0, (LPARAM) MAKELONG(-1,-1)); + r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELPARAM(-1,-1)); expect(MAKELONG(25,35), r); ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_icon_spacing_seq, "test icon spacing seq", FALSE); diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 7454b6f..1ce8ae0 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -213,7 +213,7 @@ static void test_customdraw(void) { ok(lResult, "Adding the tool to the tooltip failed\n"); /* Make tooltip appear quickly */ - SendMessage(hwndTip, TTM_SETDELAYTIME, (WPARAM)TTDT_INITIAL, (LPARAM)MAKELONG(1,0)); + SendMessage(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); /* Put cursor inside window, tooltip will appear immediately */ SetCursorPos(100, 100);
1
0
0
0
Nikolay Sivov : gdiplus: Added CachedBitmap calls.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: 1cca99dc23b5e9e47511fced1dd4d3fd791e93cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1cca99dc23b5e9e47511fced1…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Nov 4 08:54:32 2008 +0300 gdiplus: Added CachedBitmap calls. --- dlls/gdiplus/gdiplus.spec | 6 ++-- dlls/gdiplus/gdiplus_private.h | 4 ++ dlls/gdiplus/image.c | 61 ++++++++++++++++++++++++++++++++++++++++ include/gdiplusgpstubs.h | 2 + 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 5c47126..a2790a3 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -81,7 +81,7 @@ @ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr) @ stdcall GdipCreateBitmapFromStream(ptr ptr) @ stdcall GdipCreateBitmapFromStreamICM(ptr ptr) -@ stub GdipCreateCachedBitmap +@ stdcall GdipCreateCachedBitmap(ptr ptr ptr) @ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr) @ stub GdipCreateEffect @ stdcall GdipCreateFont(ptr long long long ptr) @@ -137,7 +137,7 @@ @ stdcall GdipCreateTextureIA(ptr ptr long long long long ptr) @ stdcall GdipCreateTextureIAI(ptr ptr long long long long ptr) @ stdcall GdipDeleteBrush(ptr) -@ stub GdipDeleteCachedBitmap +@ stdcall GdipDeleteCachedBitmap(ptr) @ stdcall GdipDeleteCustomLineCap(ptr) @ stub GdipDeleteEffect @ stdcall GdipDeleteFont(ptr) @@ -158,7 +158,7 @@ @ stdcall GdipDrawBezierI(ptr ptr long long long long long long long long) @ stdcall GdipDrawBeziers(ptr ptr ptr long) @ stdcall GdipDrawBeziersI(ptr ptr ptr long) -@ stub GdipDrawCachedBitmap +@ stdcall GdipDrawCachedBitmap(ptr ptr long long) @ stdcall GdipDrawClosedCurve2(ptr ptr ptr long long) @ stdcall GdipDrawClosedCurve2I(ptr ptr ptr long long) @ stdcall GdipDrawClosedCurve(ptr ptr ptr long) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 05549b4..d3dce6a 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -195,6 +195,10 @@ struct GpBitmap{ BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */ }; +struct GpCachedBitmap{ + GpBitmap *bmp; +}; + struct GpImageAttributes{ WrapMode wrap; }; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 9dbefc0..1627995 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -547,6 +547,67 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream, return GdipCreateBitmapFromStream(stream, bitmap); } +GpStatus WINGDIPAPI GdipCreateCachedBitmap(GpBitmap *bitmap, GpGraphics *graphics, + GpCachedBitmap **cachedbmp) +{ + GpStatus stat; + GpImage *copy; + + TRACE("%p %p %p\n", bitmap, graphics, cachedbmp); + + if(!bitmap || !graphics || !cachedbmp) + return InvalidParameter; + + *cachedbmp = GdipAlloc(sizeof(GpCachedBitmap)); + if(!*cachedbmp) + return OutOfMemory; + (*cachedbmp)->bmp = GdipAlloc(sizeof(GpBitmap)); + if(!(*cachedbmp)->bmp){ + GdipFree(*cachedbmp); + return OutOfMemory; + } + + copy = &(*cachedbmp)->bmp->image; + stat = GdipCloneImage(&(bitmap->image), ©); + if(stat != Ok){ + GdipFree(*cachedbmp); + return stat; + } + + (*cachedbmp)->bmp->width = bitmap->width; + (*cachedbmp)->bmp->height = bitmap->height; + (*cachedbmp)->bmp->format = bitmap->format; + (*cachedbmp)->bmp->lockmode = 0; + (*cachedbmp)->bmp->numlocks = 0; + (*cachedbmp)->bmp->bitmapbits = NULL; + + return Ok; +} + +GpStatus WINGDIPAPI GdipDeleteCachedBitmap(GpCachedBitmap *cachedbmp) +{ + TRACE("%p\n", cachedbmp); + + if(!cachedbmp) + return InvalidParameter; + + GdipDisposeImage(&cachedbmp->bmp->image); + GdipFree(cachedbmp->bmp); + + return Ok; +} + +GpStatus WINGDIPAPI GdipDrawCachedBitmap(GpGraphics *graphics, + GpCachedBitmap *cachedbmp, INT x, INT y) +{ + TRACE("%p %p %d %d\n", graphics, cachedbmp, x, y); + + if(!graphics || !cachedbmp) + return InvalidParameter; + + return GdipDrawImage(graphics, &cachedbmp->bmp->image, (REAL)x, (REAL)y); +} + GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) { HDC hdc; diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 917097e..e1d1706 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -32,6 +32,7 @@ class GpAdjustableArrowCap : public GpCustomLineCap {}; class GpImage {}; class GpMetafile : public GpImage {}; class GpImageAttributes {}; +class GpCachedBitmap {}; class GpBitmap : public GpImage {}; class GpPathGradient : public GpBrush {}; class GpLineGradient : public GpBrush {}; @@ -57,6 +58,7 @@ typedef struct GpAdjustableArrowCap GpAdjustableArrowCap; typedef struct GpImage GpImage; typedef struct GpMetafile GpMetafile; typedef struct GpImageAttributes GpImageAttributes; +typedef struct GpCachedBitmap GpCachedBitmap; typedef struct GpBitmap GpBitmap; typedef struct GpPathGradient GpPathGradient; typedef struct GpLineGradient GpLineGradient;
1
0
0
0
James Hawkins : msi: Remove an unused registry function.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: 7051bf5e224486335608cc621a9cab5a216354a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7051bf5e224486335608cc621…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Nov 3 22:17:04 2008 -0600 msi: Remove an unused registry function. --- dlls/msi/msipriv.h | 2 -- dlls/msi/registry.c | 21 --------------------- 2 files changed, 0 insertions(+), 23 deletions(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index d83fae5..f856e66 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -775,13 +775,11 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); -extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalSystemInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); -extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 3ed08f7..26b872d 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -950,27 +950,6 @@ UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); } -UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create) -{ - UINT rc; - WCHAR squished_pc[GUID_SIZE]; - WCHAR keypath[0x200]; - - TRACE("%s\n",debugstr_w(szProduct)); - if (!squash_guid(szProduct,squished_pc)) - return ERROR_FUNCTION_FAILED; - TRACE("squished (%s)\n", debugstr_w(squished_pc)); - - sprintfW(keypath,szInstaller_Products_fmt,squished_pc); - - if (create) - rc = RegCreateKeyW(HKEY_LOCAL_MACHINE,keypath,key); - else - rc = RegOpenKeyW(HKEY_LOCAL_MACHINE,keypath,key); - - return rc; -} - UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) { WCHAR squished_pc[GUID_SIZE];
1
0
0
0
James Hawkins : msi: Factor out the code to open the UserData features key.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: e3074348fc5768124304b329a24382d0ee63e0dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e3074348fc5768124304b329a…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Nov 3 22:16:54 2008 -0600 msi: Factor out the code to open the UserData features key. --- dlls/msi/action.c | 21 ++++++--------------- dlls/msi/msi.c | 8 ++++++-- dlls/msi/msipriv.h | 4 ++-- dlls/msi/registry.c | 48 +++++++++++++++++++----------------------------- 4 files changed, 33 insertions(+), 48 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 55e8fd2..5d9ba65 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3846,20 +3846,10 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) goto end; - if (package->Context == MSIINSTALLCONTEXT_MACHINE) - { - rc = MSIREG_OpenLocalUserDataFeaturesKey(package->ProductCode, - &userdata, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - } - else - { - rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, - &userdata, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - } + rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, package->Context, + &userdata, TRUE); + if (rc != ERROR_SUCCESS) + goto end; /* here the guids are base 85 encoded */ LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry ) @@ -3965,7 +3955,8 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature) RegCloseKey(hkey); } - r = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, &hkey, FALSE); + r = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, package->Context, + &hkey, FALSE); if (r == ERROR_SUCCESS) { RegDeleteValueW(hkey, feature->Feature); diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 91792d4..2b3b635 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1958,9 +1958,13 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) return r; if (machine) - rc = MSIREG_OpenLocalUserDataFeaturesKey(szProduct, &hkey, FALSE); + rc = MSIREG_OpenUserDataFeaturesKey(szProduct, + MSIINSTALLCONTEXT_MACHINE, + &hkey, FALSE); else - rc = MSIREG_OpenUserDataFeaturesKey(szProduct, &hkey, FALSE); + rc = MSIREG_OpenUserDataFeaturesKey(szProduct, + MSIINSTALLCONTEXT_USERUNMANAGED, + &hkey, FALSE); if (rc != ERROR_SUCCESS) return INSTALLSTATE_ADVERTISED; diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index b853915..d83fae5 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -770,7 +770,8 @@ extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, HKEY *key, BOOL create); extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); -extern UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create); +UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, + HKEY *key, BOOL create); extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); @@ -788,7 +789,6 @@ extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct); extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct); extern UINT MSIREG_OpenLocalSystemProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create); extern UINT MSIREG_OpenLocalSystemComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); -extern UINT MSIREG_OpenLocalUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create); extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct); extern UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent); extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index f1059f7..3ed08f7 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -684,47 +684,37 @@ UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create) return rc; } -UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create) +UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, + HKEY *key, BOOL create) { - UINT rc; + UINT r; + LPWSTR usersid; WCHAR squished_pc[GUID_SIZE]; WCHAR keypath[0x200]; - LPWSTR usersid; - TRACE("%s\n", debugstr_w(szProduct)); + TRACE("(%s, %d, %d)\n", debugstr_w(szProduct), context, create); + if (!squash_guid(szProduct, squished_pc)) return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_pc)); - rc = get_user_sid(&usersid); - if (rc != ERROR_SUCCESS || !usersid) + if (context == MSIINSTALLCONTEXT_MACHINE) { - ERR("Failed to retrieve user SID: %d\n", rc); - return rc; + sprintfW(keypath, szUserDataFeatures_fmt, localsid, squished_pc); } - - sprintfW(keypath, szUserDataFeatures_fmt, usersid, squished_pc); - - if (create) - rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); else - rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); - - LocalFree(usersid); - return rc; -} - -UINT MSIREG_OpenLocalUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create) -{ - WCHAR squished_pc[GUID_SIZE]; - WCHAR keypath[0x200]; - - TRACE("%s\n", debugstr_w(szProduct)); - if (!squash_guid(szProduct, squished_pc)) - return ERROR_FUNCTION_FAILED; - TRACE("squished (%s)\n", debugstr_w(squished_pc)); + { + r = get_user_sid(&usersid); + if (r != ERROR_SUCCESS || !usersid) + { + ERR("Failed to retrieve user SID: %d\n", r); + return r; + } - sprintfW(keypath, szUserDataFeatures_fmt, localsid, squished_pc); + sprintfW(keypath, szUserDataFeatures_fmt, usersid, squished_pc); + LocalFree(usersid); + } if (create) return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key);
1
0
0
0
James Hawkins : msi: Factor out the code to open the features key.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: 0c01c586c70b84d5d68a17d2e3004bc5a5bdda34 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0c01c586c70b84d5d68a17d2e…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Nov 3 22:16:50 2008 -0600 msi: Factor out the code to open the features key. --- dlls/msi/action.c | 17 ++++----- dlls/msi/msi.c | 9 +++-- dlls/msi/msipriv.h | 7 ++-- dlls/msi/registry.c | 97 ++++++++++++++++++-------------------------------- 4 files changed, 51 insertions(+), 79 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index fda0059..55e8fd2 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3841,13 +3841,13 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) if (!msi_check_publish(package)) return ERROR_SUCCESS; + rc = MSIREG_OpenFeaturesKey(package->ProductCode, package->Context, + &hkey, TRUE); + if (rc != ERROR_SUCCESS) + goto end; + if (package->Context == MSIINSTALLCONTEXT_MACHINE) { - rc = MSIREG_OpenLocalClassesFeaturesKey(package->ProductCode, - &hkey, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - rc = MSIREG_OpenLocalUserDataFeaturesKey(package->ProductCode, &userdata, TRUE); if (rc != ERROR_SUCCESS) @@ -3855,10 +3855,6 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) } else { - rc = MSIREG_OpenUserFeaturesKey(package->ProductCode, &hkey, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, &userdata, TRUE); if (rc != ERROR_SUCCESS) @@ -3961,7 +3957,8 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature) TRACE("unpublishing feature %s\n", debugstr_w(feature->Feature)); - r = MSIREG_OpenUserFeaturesKey(package->ProductCode, &hkey, FALSE); + r = MSIREG_OpenFeaturesKey(package->ProductCode, package->Context, + &hkey, FALSE); if (r == ERROR_SUCCESS) { RegDeleteValueW(hkey, feature->Feature); diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index b629bc6..91792d4 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1933,10 +1933,13 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) if (!squash_guid( szProduct, squishProduct )) return INSTALLSTATE_INVALIDARG; - if (MSIREG_OpenManagedFeaturesKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && - MSIREG_OpenUserFeaturesKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS) + if (MSIREG_OpenFeaturesKey(szProduct, MSIINSTALLCONTEXT_USERMANAGED, + &hkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenFeaturesKey(szProduct, MSIINSTALLCONTEXT_USERUNMANAGED, + &hkey, FALSE) != ERROR_SUCCESS) { - rc = MSIREG_OpenLocalClassesFeaturesKey(szProduct, &hkey, FALSE); + rc = MSIREG_OpenFeaturesKey(szProduct, MSIINSTALLCONTEXT_MACHINE, + &hkey, FALSE); if (rc != ERROR_SUCCESS) return INSTALLSTATE_UNKNOWN; diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 3aa1a85..b853915 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -766,8 +766,10 @@ extern UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_DeleteUninstallKey(LPCWSTR szProduct); extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, HKEY* key, BOOL create); +extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, + HKEY *key, BOOL create); extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); -extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); +extern UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create); extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); @@ -778,7 +780,6 @@ extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL cre extern UINT MSIREG_OpenLocalUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenLocalSystemInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); -extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create); extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create); @@ -787,8 +788,6 @@ extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct); extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct); extern UINT MSIREG_OpenLocalSystemProductKey(LPCWSTR szProductCode, HKEY *key, BOOL create); extern UINT MSIREG_OpenLocalSystemComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create); -extern UINT MSIREG_OpenLocalClassesFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create); -extern UINT MSIREG_OpenManagedFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create); extern UINT MSIREG_OpenLocalUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create); extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct); extern UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 85907eb..f1059f7 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -605,25 +605,48 @@ UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) return rc; } -UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create) +UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, + HKEY *key, BOOL create) { - UINT rc; + UINT r; + LPWSTR usersid; + HKEY root = HKEY_LOCAL_MACHINE; WCHAR squished_pc[GUID_SIZE]; - WCHAR keypath[0x200]; + WCHAR keypath[MAX_PATH]; - TRACE("%s\n",debugstr_w(szProduct)); - if (!squash_guid(szProduct,squished_pc)) + TRACE("(%s, %d, %d)\n", debugstr_w(szProduct), context, create); + + if (!squash_guid(szProduct, squished_pc)) return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_pc)); - sprintfW(keypath,szUserFeatures_fmt,squished_pc); + if (context == MSIINSTALLCONTEXT_MACHINE) + { + sprintfW(keypath, szInstaller_LocalClassesFeat_fmt, squished_pc); + } + else if (context == MSIINSTALLCONTEXT_USERUNMANAGED) + { + root = HKEY_CURRENT_USER; + sprintfW(keypath, szUserFeatures_fmt, squished_pc); + } + else + { + r = get_user_sid(&usersid); + if (r != ERROR_SUCCESS || !usersid) + { + ERR("Failed to retrieve user SID: %d\n", r); + return r; + } + + sprintfW(keypath, szInstaller_LocalManagedFeat_fmt, usersid, squished_pc); + LocalFree(usersid); + } if (create) - rc = RegCreateKeyW(HKEY_CURRENT_USER,keypath,key); - else - rc = RegOpenKeyW(HKEY_CURRENT_USER,keypath,key); + return RegCreateKeyW(root, keypath, key); - return rc; + return RegOpenKeyW(root, keypath, key); } UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) @@ -640,7 +663,7 @@ UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) return RegDeleteTreeW(HKEY_CURRENT_USER, keypath); } -UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create) +UINT MSIREG_OpenInstallerFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create) { UINT rc; WCHAR squished_pc[GUID_SIZE]; @@ -1108,26 +1131,6 @@ UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); } -UINT MSIREG_OpenLocalClassesFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create) -{ - WCHAR squished_pc[GUID_SIZE]; - WCHAR keypath[0x200]; - - TRACE("%s\n", debugstr_w(szProductCode)); - - if (!squash_guid(szProductCode, squished_pc)) - return ERROR_FUNCTION_FAILED; - - TRACE("squished (%s)\n", debugstr_w(squished_pc)); - - sprintfW(keypath, szInstaller_LocalClassesFeat_fmt, squished_pc); - - if (create) - return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); - - return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); -} - UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) { WCHAR squished_pc[GUID_SIZE]; @@ -1145,36 +1148,6 @@ UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); } -UINT MSIREG_OpenManagedFeaturesKey(LPCWSTR szProductCode, HKEY *key, BOOL create) -{ - WCHAR squished_pc[GUID_SIZE]; - WCHAR keypath[0x200]; - LPWSTR usersid; - UINT r; - - TRACE("%s\n", debugstr_w(szProductCode)); - - if (!squash_guid(szProductCode, squished_pc)) - return ERROR_FUNCTION_FAILED; - - TRACE("squished (%s)\n", debugstr_w(squished_pc)); - - r = get_user_sid(&usersid); - if (r != ERROR_SUCCESS || !usersid) - { - ERR("Failed to retrieve user SID: %d\n", r); - return r; - } - - sprintfW(keypath, szInstaller_LocalManagedFeat_fmt, usersid, squished_pc); - LocalFree(usersid); - - if (create) - return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); - - return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); -} - UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create) { WCHAR squished_pc[GUID_SIZE]; @@ -1381,7 +1354,7 @@ UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index, if( !szProduct ) return ERROR_INVALID_PARAMETER; - r = MSIREG_OpenFeaturesKey(szProduct,&hkeyProduct,FALSE); + r = MSIREG_OpenInstallerFeaturesKey(szProduct,&hkeyProduct,FALSE); if( r != ERROR_SUCCESS ) return ERROR_NO_MORE_ITEMS;
1
0
0
0
James Hawkins : msi: Factor out the code to open a product key.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: 70be1e77460a767366808593cfd961bf24cc8cc5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=70be1e77460a767366808593c…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Nov 3 22:16:43 2008 -0600 msi: Factor out the code to open a product key. --- dlls/msi/action.c | 13 +++---- dlls/msi/msi.c | 81 +++++++++++++++++++++++--------------------- dlls/msi/msipriv.h | 5 +-- dlls/msi/registry.c | 93 ++++++++++++++++++--------------------------------- dlls/msi/source.c | 12 ++++--- dlls/msi/upgrade.c | 7 ++-- 6 files changed, 93 insertions(+), 118 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=70be1e77460a767366808…
1
0
0
0
James Hawkins : msi: Factor out the table insertion code.
by Alexandre Julliard
04 Nov '08
04 Nov '08
Module: wine Branch: master Commit: f12b9cea99475fae63ab87c3f60dba379a1f450f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f12b9cea99475fae63ab87c3f…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Nov 3 22:16:30 2008 -0600 msi: Factor out the table insertion code. --- dlls/msi/tests/format.c | 131 ++++++++++++++-------------------------------- 1 files changed, 40 insertions(+), 91 deletions(-) diff --git a/dlls/msi/tests/format.c b/dlls/msi/tests/format.c index 00d3856..c4be429 100644 --- a/dlls/msi/tests/format.c +++ b/dlls/msi/tests/format.c @@ -108,97 +108,46 @@ static UINT create_custom_action_table( MSIHANDLE hdb ) "PRIMARY KEY `Action`)" ); } -static UINT add_feature_entry( MSIHANDLE hdb, const char *values ) -{ - char insert[] = "INSERT INTO `Feature` (`Feature`, `Feature_Parent`, " - "`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )"; - char *query; - UINT sz, r; - - sz = strlen(values) + sizeof insert; - query = HeapAlloc(GetProcessHeap(),0,sz); - sprintf(query,insert,values); - r = run_query( hdb, query ); - HeapFree(GetProcessHeap(), 0, query); - return r; -} +#define make_add_entry(type, qtext) \ + static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \ + { \ + char insert[] = qtext; \ + char *query; \ + UINT sz, r; \ + sz = strlen(values) + sizeof insert; \ + query = HeapAlloc(GetProcessHeap(),0,sz); \ + sprintf(query,insert,values); \ + r = run_query( hdb, query ); \ + HeapFree(GetProcessHeap(), 0, query); \ + return r; \ + } -static UINT add_component_entry( MSIHANDLE hdb, const char *values ) -{ - char insert[] = "INSERT INTO `Component` " - "(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) " - "VALUES( %s )"; - char *query; - UINT sz, r; - - sz = strlen(values) + sizeof insert; - query = HeapAlloc(GetProcessHeap(),0,sz); - sprintf(query,insert,values); - r = run_query( hdb, query ); - HeapFree(GetProcessHeap(), 0, query); - return r; -} +make_add_entry(feature, + "INSERT INTO `Feature` " + "(`Feature`, `Feature_Parent`, `Title`, `Description`, " + "`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )") -static UINT add_feature_components_entry( MSIHANDLE hdb, const char *values ) -{ - char insert[] = "INSERT INTO `FeatureComponents` " - "(`Feature_`, `Component_`) " - "VALUES( %s )"; - char *query; - UINT sz, r; - - sz = strlen(values) + sizeof insert; - query = HeapAlloc(GetProcessHeap(),0,sz); - sprintf(query,insert,values); - r = run_query( hdb, query ); - HeapFree(GetProcessHeap(), 0, query); - return r; -} +make_add_entry(component, + "INSERT INTO `Component` " + "(`Component`, `ComponentId`, `Directory_`, " + "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )") -static UINT add_file_entry( MSIHANDLE hdb, const char *values ) -{ - char insert[] = "INSERT INTO `File` " - "(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) " - "VALUES( %s )"; - char *query; - UINT sz, r; - - sz = strlen(values) + sizeof insert; - query = HeapAlloc(GetProcessHeap(),0,sz); - sprintf(query,insert,values); - r = run_query( hdb, query ); - HeapFree(GetProcessHeap(), 0, query); - return r; -} +make_add_entry(feature_components, + "INSERT INTO `FeatureComponents` " + "(`Feature_`, `Component_`) VALUES( %s )") -static UINT add_directory_entry( MSIHANDLE hdb, const char *values ) -{ - char insert[] = "INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )"; - char *query; - UINT sz, r; - - sz = strlen(values) + sizeof insert; - query = HeapAlloc(GetProcessHeap(),0,sz); - sprintf(query,insert,values); - r = run_query( hdb, query ); - HeapFree(GetProcessHeap(), 0, query); - return r; -} +make_add_entry(file, + "INSERT INTO `File` " + "(`File`, `Component_`, `FileName`, `FileSize`, " + "`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )") -static UINT add_custom_action_entry( MSIHANDLE hdb, const char *values ) -{ - char insert[] = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, " - "`Target`) VALUES( %s )"; - char *query; - UINT sz, r; - - sz = strlen(values) + sizeof insert; - query = HeapAlloc(GetProcessHeap(),0,sz); - sprintf(query,insert,values); - r = run_query( hdb, query ); - HeapFree(GetProcessHeap(), 0, query); - return r; -} +make_add_entry(directory, + "INSERT INTO `Directory` " + "(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )") + +make_add_entry(custom_action, + "INSERT INTO `CustomAction` " + "(`Action`, `Type`, `Source`, `Target`) VALUES( %s )") static UINT set_summary_info(MSIHANDLE hdb) {
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200