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
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
List overview
Download
Ros-diffs
September 2005
----- 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
ros-diffs@reactos.org
22 participants
582 discussions
Start a n
N
ew thread
[gvg] 17721: Sync to Wine-20050830:
by gvg@svn.reactos.com
Sync to Wine-20050830: Alexandre Julliard <julliard(a)winehq.org> - Removed a useless header file. Deleted: trunk/reactos/subsys/system/msiexec/Makefile.in Modified: trunk/reactos/subsys/system/msiexec/msiexec.c _____ Deleted: trunk/reactos/subsys/system/msiexec/Makefile.in --- trunk/reactos/subsys/system/msiexec/Makefile.in 2005-09-07 16:23:24 UTC (rev 17720) +++ trunk/reactos/subsys/system/msiexec/Makefile.in 2005-09-07 16:28:09 UTC (rev 17721) @@ -1,16 +0,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = msiexec.exe -APPMODE = -mconsole -IMPORTS = msi ole32 advapi32 user32 kernel32 - -C_SRCS = \ - msiexec.c - -RC_SRCS = version.rc - -@MAKE_PROG_RULES@ - -### Dependencies: _____ Modified: trunk/reactos/subsys/system/msiexec/msiexec.c --- trunk/reactos/subsys/system/msiexec/msiexec.c 2005-09-07 16:23:24 UTC (rev 17720) +++ trunk/reactos/subsys/system/msiexec/msiexec.c 2005-09-07 16:28:09 UTC (rev 17721) @@ -24,13 +24,14 @@ #include <objbase.h> #include <stdio.h> -#include "msiexec.h" - #include "wine/debug.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msiexec); +typedef HRESULT (WINAPI *DLLREGISTERSERVER)(void); +typedef HRESULT (WINAPI *DLLUNREGISTERSERVER)(void); + struct string_list { struct string_list *next;
19 years, 3 months
1
0
0
0
[gvg] 17720: Add AC_SRC constants
by gvg@svn.reactos.com
Add AC_SRC constants Modified: trunk/reactos/w32api/include/wingdi.h _____ Modified: trunk/reactos/w32api/include/wingdi.h --- trunk/reactos/w32api/include/wingdi.h 2005-09-07 16:22:51 UTC (rev 17719) +++ trunk/reactos/w32api/include/wingdi.h 2005-09-07 16:23:24 UTC (rev 17720) @@ -15,6 +15,9 @@ #define SYSPAL_NOSTATIC256 3 #define WINGDIAPI + +#define AC_SRC_OVER 0 +#define AC_SRC_ALPHA 1 #define BI_RGB 0 #define BI_RLE8 1 #define BI_RLE4 2
19 years, 3 months
1
0
0
0
[gvg] 17719: Sync to Wine-20050830:
by gvg@svn.reactos.com
Sync to Wine-20050830: Kevin Koltzau <kevin(a)plop.org> - Fix 'cast to pointer from integer of different size' warnings in 64bit. Frank Richter <frank.richter(a)gmail.com> - Add support for the BT_NONE background type. - Better computations to have uniformly sized parts scaled in both directions. - Implement GetThemeBackgroundExtent(). - Implement DrawThemeEdge(). - Implement support for the ST_TILE background stretching mode. - Implementation for GetThemePartSize() (not entirely equivalent to native uxtheme, but sensibly useable). - Enhance uxtheme to store the themed system metrics in the registry and also backup the old metrics. That way, themed system colors are set even uxtheme was not loaded and initialized yet, and when a theme is deactivated, the colors prior to the activation are restored as well. - Also, not having to set the system colors in uxtheme startup works around weird problems where SetSystemColors() ended up being called from inside window creation and this seemingly led to some creation message being sent twice. - Make GetThemeMargins() return default values (0 margin) if the function does not succeed. - More elaborate IsThemeBackgroundPartiallyTransparent() implementation; also returns TRUE for theme parts with 32bpp images. - Since theme images are reused now it's not really a good idea to delete them in drawing functions. - Pass around what kind of transparency an image actually needs. Use alpha-blending for 32bpp images. - Set some default values for truesize sizing that seem closer to Windows. - If a MINSIZEn property is not present, fall back to actual size of nth image to determine whether it is suitable. - EnumThemeColors() and EnumThemeSizes() actually do not return a single string with the color/size name, but rather a struct containing three strings - name, display name and tooltip. - The default image layout is HORIZONTAL, not VERTICAL. - Take a common computation out of two if-branches in UXTHEME_LoadImage(). - Compare result of RegQueryValueExW() with ERROR_SUCCESS. - Another fix to use magenta as the default transparent color. - Implement "manual" image sharing(as opposed to using LoadImage() with LR_SHARED) by keeping the loaded images in a list. This is needed for proper alpha support later on since once-per-image preparations will be needed then. - Add support for horizontal & vertical alignment when doing truesize sizing. - Whatever TrueSizeStretchMark is for - it's not what Wine uxtheme used it for. Native uxtheme always stretches "truesize" parts when the destination is smaller than the part image size, but TrueSizeStretchMark doesn't seem to have an influence. Deleted: trunk/reactos/lib/uxtheme/Makefile.in Modified: trunk/reactos/lib/uxtheme/draw.c Modified: trunk/reactos/lib/uxtheme/msstyles.c Modified: trunk/reactos/lib/uxtheme/msstyles.h Modified: trunk/reactos/lib/uxtheme/property.c Modified: trunk/reactos/lib/uxtheme/system.c Modified: trunk/reactos/lib/uxtheme/uxtheme.spec Modified: trunk/reactos/lib/uxtheme/uxthemedll.h _____ Deleted: trunk/reactos/lib/uxtheme/Makefile.in --- trunk/reactos/lib/uxtheme/Makefile.in 2005-09-07 16:02:32 UTC (rev 17718) +++ trunk/reactos/lib/uxtheme/Makefile.in 2005-09-07 16:22:51 UTC (rev 17719) @@ -1,25 +0,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = uxtheme.dll -IMPORTLIB = libuxtheme.$(IMPLIBEXT) -IMPORTS = shlwapi user32 gdi32 advapi32 kernel32 ntdll -DELAYIMPORTS = msimg32 -EXTRALIBS = $(LIBUNICODE) - -C_SRCS = \ - draw.c \ - main.c \ - metric.c \ - msstyles.c \ - property.c \ - stylemap.c \ - system.c \ - uxini.c - -RC_SRCS = version.rc - -@MAKE_DLL_RULES@ - -### Dependencies: _____ Modified: trunk/reactos/lib/uxtheme/draw.c --- trunk/reactos/lib/uxtheme/draw.c 2005-09-07 16:02:32 UTC (rev 17718) +++ trunk/reactos/lib/uxtheme/draw.c 2005-09-07 16:22:51 UTC (rev 17719) @@ -187,12 +187,42 @@ POINT size = {pRect->right-pRect->left, pRect->bottom-pRect->top}; POINT reqsize; for(i=4; i>=0; i--) { - if(SUCCEEDED(GetThemePosition(hTheme, iPartId, iStateId, i + TMT_MINSIZE1, &reqsize))) { - if(reqsize.x >= size.x && reqsize.y >= size.y) { - TRACE("Using image size %ldx%ld, image %d\n", reqsize.x, reqsize.y, i + TMT_IMAGEFILE1); - return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, i + TMT_IMAGEFILE1); + PTHEME_PROPERTY fileProp = + MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, i + TMT_IMAGEFILE1); + if (!fileProp) continue; + if(FAILED(GetThemePosition(hTheme, iPartId, iStateId, i + TMT_MINSIZE1, &reqsize))) { + /* fall back to size of Nth image */ + WCHAR szPath[MAX_PATH]; + int imagelayout = IL_HORIZONTAL; + int imagecount = 1; + int imagenum; + BITMAP bmp; + HBITMAP hBmp; + BOOL hasAlpha; + + lstrcpynW(szPath, fileProp->lpValue, + min(fileProp->dwValueLen+1, sizeof(szPath)/sizeof(szPath[0]))); + hBmp = MSSTYLES_LoadBitmap(hTheme, szPath, &hasAlpha); + if(!hBmp) continue; + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_IMAGELAYOUT, &imagelayout); + GetThemeInt(hTheme, iPartId, iStateId, TMT_IMAGECOUNT, &imagecount); + + imagenum = max (min (imagecount, iStateId), 1) - 1; + GetObjectW(hBmp, sizeof(bmp), &bmp); + if(imagelayout == IL_VERTICAL) { + reqsize.x = bmp.bmWidth; + reqsize.y = bmp.bmHeight/imagecount; } + else { + reqsize.x = bmp.bmWidth/imagecount; + reqsize.y = bmp.bmHeight; + } } + if(reqsize.x <= size.x && reqsize.y <= size.y) { + TRACE("Using image size %ldx%ld, image %d\n", reqsize.x, reqsize.y, i + TMT_IMAGEFILE1); + return fileProp; + } } /* If an image couldnt be selected, choose the smallest one */ return MSSTYLES_FindProperty(hTheme, iPartId, iStateId, TMT_FILENAME, TMT_IMAGEFILE1); @@ -206,10 +236,11 @@ * Load image for part/state */ static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, BOOL glyph, - HBITMAP *hBmp, RECT *bmpRect) + HBITMAP *hBmp, RECT *bmpRect, BOOL* hasImageAlpha) { - int imagelayout = IL_VERTICAL; + int imagelayout = IL_HORIZONTAL; int imagecount = 1; + int imagenum; BITMAP bmp; WCHAR szPath[MAX_PATH]; PTHEME_PROPERTY tp = UXTHEME_SelectImage(hTheme, hdc, iPartId, iStateId, pRect, glyph); @@ -218,7 +249,7 @@ return E_PROP_ID_UNSUPPORTED; } lstrcpynW(szPath, tp->lpValue, min(tp->dwValueLen+1, sizeof(szPath)/sizeof(szPath[0]))); - *hBmp = MSSTYLES_LoadBitmap(hdc, hTheme, szPath); + *hBmp = MSSTYLES_LoadBitmap(hTheme, szPath, hasImageAlpha); if(!*hBmp) { TRACE("Failed to load bitmap %s\n", debugstr_w(szPath)); return HRESULT_FROM_WIN32(GetLastError()); @@ -227,17 +258,18 @@ GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_IMAGELAYOUT, &imagelayout); GetThemeInt(hTheme, iPartId, iStateId, TMT_IMAGECOUNT, &imagecount); + imagenum = max (min (imagecount, iStateId), 1) - 1; GetObjectW(*hBmp, sizeof(bmp), &bmp); if(imagelayout == IL_VERTICAL) { int height = bmp.bmHeight/imagecount; bmpRect->left = 0; bmpRect->right = bmp.bmWidth; - bmpRect->top = (max(min(imagecount, iStateId), 1)-1) * height; + bmpRect->top = imagenum * height; bmpRect->bottom = bmpRect->top + height; } else { int width = bmp.bmWidth/imagecount; - bmpRect->left = (max(min(imagecount, iStateId), 1)-1) * width; + bmpRect->left = imagenum * width; bmpRect->right = bmpRect->left + width; bmpRect->top = 0; bmpRect->bottom = bmp.bmHeight; @@ -248,22 +280,35 @@ /*********************************************************************** * UXTHEME_StretchBlt * - * Psudo TransparentBlt/StretchBlt + * Pseudo TransparentBlt/StretchBlt */ static inline BOOL UXTHEME_StretchBlt(HDC hdcDst, int nXOriginDst, int nYOriginDst, int nWidthDst, int nHeightDst, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, - BOOL transparent, COLORREF transcolor) + INT transparent, COLORREF transcolor) { - if(transparent) { + static const BLENDFUNCTION blendFunc = + { + AC_SRC_OVER, /* BlendOp */ + 0, /* BlendFlag */ + 255, /* SourceConstantAlpha */ + AC_SRC_ALPHA /* AlphaFormat */ + }; + if (transparent == ALPHABLEND_BINARY) { /* Ensure we don't pass any negative values to TransparentBlt */ return TransparentBlt(hdcDst, nXOriginDst, nYOriginDst, abs(nWidthDst), abs(nHeightDst), hdcSrc, nXOriginSrc, nYOriginSrc, abs(nWidthSrc), abs(nHeightSrc), transcolor); } - /* This should be using AlphaBlend */ - return StretchBlt(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst, - hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, - SRCCOPY); + if ((transparent == ALPHABLEND_NONE) || + !AlphaBlend(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst, + hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, + blendFunc)) + { + return StretchBlt(hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst, + hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, + SRCCOPY); + } + return TRUE; } /*********************************************************************** @@ -273,14 +318,88 @@ */ static inline BOOL UXTHEME_Blt(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, - BOOL transparent, COLORREF transcolor) + INT transparent, COLORREF transcolor) { return UXTHEME_StretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthDest, nHeightDest, transparent, transcolor); } +/********************************************************************** * + * UXTHEME_SizedBlt + * + * Stretches or tiles, depending on sizingtype. + */ +static inline BOOL UXTHEME_SizedBlt (HDC hdcDst, int nXOriginDst, int nYOriginDst, + int nWidthDst, int nHeightDst, + HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, + int nWidthSrc, int nHeightSrc, + int sizingtype, + INT transparent, COLORREF transcolor) +{ + if (sizingtype == ST_TILE) + { + int yOfs = nYOriginDst; + int yRemaining = nHeightDst; + while (yRemaining > 0) + { + int bltHeight = min (yRemaining, nHeightSrc); + int xOfs = nXOriginDst; + int xRemaining = nWidthDst; + while (xRemaining > 0) + { + int bltWidth = min (xRemaining, nWidthSrc); + if (!UXTHEME_Blt (hdcDst, xOfs, yOfs, bltWidth, bltHeight, + hdcSrc, nXOriginSrc, nYOriginSrc, + transparent, transcolor)) + return FALSE; + xOfs += nWidthSrc; + xRemaining -= nWidthSrc; + } + yOfs += nHeightSrc; + yRemaining -= nHeightSrc; + } + return TRUE; + } + else + { + return UXTHEME_StretchBlt (hdcDst, nXOriginDst, nYOriginDst, nWidthDst, nHeightDst, + hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, + transparent, transcolor); + } +} +/* Get transparency parameters passed to UXTHEME_StretchBlt() - the parameters + * depend on whether the image has full alpha or whether it is + * color-transparent or just opaque. */ +static inline void get_transparency (HTHEME hTheme, int iPartId, int iStateId, + BOOL hasImageAlpha, INT* transparent, + COLORREF* transparentcolor, BOOL glyph) +{ + if (hasImageAlpha) + { + *transparent = ALPHABLEND_FULL; + *transparentcolor = RGB (255, 0, 255); + } + else + { + BOOL trans = FALSE; + GetThemeBool(hTheme, iPartId, iStateId, + glyph ? TMT_GLYPHTRANSPARENT : TMT_TRANSPARENT, &trans); + if(trans) { + *transparent = ALPHABLEND_BINARY; + if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, + glyph ? TMT_GLYPHTRANSPARENTCOLOR : TMT_TRANSPARENTCOLOR, + transparentcolor))) { + /* If image is transparent, but no color was specified, use magenta */ + *transparentcolor = RGB(255, 0, 255); + } + } + else + *transparent = ALPHABLEND_NONE; + } +} + /*********************************************************************** * UXTHEME_DrawImageGlyph * @@ -295,20 +414,21 @@ HDC hdcSrc = NULL; HGDIOBJ oldSrc = NULL; RECT rcSrc; - BOOL transparent = FALSE; - COLORREF transparentcolor = 0; + INT transparent = FALSE; + COLORREF transparentcolor; int valign = VA_CENTER; int halign = HA_CENTER; POINT dstSize; POINT srcSize; POINT topleft; + BOOL hasAlpha; - hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, TRUE, &bmpSrc, &rcSrc); + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, TRUE, + &bmpSrc, &rcSrc, &hasAlpha); if(FAILED(hr)) return hr; hdcSrc = CreateCompatibleDC(hdc); if(!hdcSrc) { hr = HRESULT_FROM_WIN32(GetLastError()); - DeleteObject(bmpSrc); return hr; } oldSrc = SelectObject(hdcSrc, bmpSrc); @@ -318,13 +438,8 @@ srcSize.x = rcSrc.right-rcSrc.left; srcSize.y = rcSrc.bottom-rcSrc.top; - GetThemeBool(hTheme, iPartId, iStateId, TMT_GLYPHTRANSPARENT, &transparent); - if(transparent) { - if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_GLYPHTRANSPARENTCOLOR, &transparentcolor))) { - /* If image is transparent, but no color was specified, use magenta */ - transparentcolor = RGB(255, 0, 255); - } - } + get_transparency (hTheme, iPartId, iStateId, hasAlpha, &transparent, + &transparentcolor, TRUE); GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_VALIGN, &valign); GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_HALIGN, &halign); @@ -343,7 +458,6 @@ SelectObject(hdcSrc, oldSrc); DeleteDC(hdcSrc); - DeleteObject(bmpSrc); return hr; } @@ -371,6 +485,110 @@ } /*********************************************************************** + * get_image_part_size + * + * Used by GetThemePartSize and UXTHEME_DrawImageBackground + */ +static HRESULT get_image_part_size (HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, RECT *prc, THEMESIZE eSize, + POINT *psz) +{ + HRESULT hr = S_OK; + HBITMAP bmpSrc; + RECT rcSrc; + BOOL hasAlpha; + + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, prc, FALSE, + &bmpSrc, &rcSrc, &hasAlpha); + if (FAILED(hr)) return hr; + + switch (eSize) + { + case TS_DRAW: + if (prc != NULL) + { + RECT rcDst; + POINT dstSize; + POINT srcSize; + int sizingtype = ST_STRETCH; + BOOL uniformsizing = FALSE; + + CopyRect(&rcDst, prc); + + dstSize.x = rcDst.right-rcDst.left; + dstSize.y = rcDst.bottom-rcDst.top; + srcSize.x = rcSrc.right-rcSrc.left; + srcSize.y = rcSrc.bottom-rcSrc.top; + + GetThemeBool(hTheme, iPartId, iStateId, TMT_UNIFORMSIZING, &uniformsizing); + if(uniformsizing) { + /* Scale height and width equally */ + if (dstSize.x*srcSize.y < dstSize.y*srcSize.x) + { + dstSize.y = MulDiv (srcSize.y, dstSize.x, srcSize.x); + rcDst.bottom = rcDst.top + dstSize.y; + } + else + { + dstSize.x = MulDiv (srcSize.x, dstSize.y, srcSize.y); + rcDst.right = rcDst.left + dstSize.x; + } + } + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_SIZINGTYPE, &sizingtype); + if(sizingtype == ST_TRUESIZE) { + int truesizestretchmark = 100; + + if(dstSize.x < 0 || dstSize.y < 0) { + BOOL mirrorimage = TRUE; + GetThemeBool(hTheme, iPartId, iStateId, TMT_MIRRORIMAGE, &mirrorimage); + if(mirrorimage) { + if(dstSize.x < 0) { + rcDst.left += dstSize.x; + rcDst.right += dstSize.x; + } + if(dstSize.y < 0) { + rcDst.top += dstSize.y; + rcDst.bottom += dstSize.y; + } + } + } + /* Whatever TrueSizeStretchMark does - it does not seem to + * be what's outlined below. It appears as if native + * uxtheme always stretches if dest is smaller than source + * (ie as if TrueSizeStretchMark==100 with the code below) */ +#if 0 + /* Only stretch when target exceeds source by truesizestretchmark percent */ + GetThemeInt(hTheme, iPartId, iStateId, TMT_TRUESIZESTRETCHMARK, &truesizestretchmark); +#endif + if(dstSize.x < 0 || dstSize.y < 0 || + (MulDiv(srcSize.x, 100, dstSize.x) > truesizestretchmark && + MulDiv(srcSize.y, 100, dstSize.y) > truesizestretchmark)) { + memcpy (psz, &dstSize, sizeof (SIZE)); + } + else { + memcpy (psz, &srcSize, sizeof (SIZE)); + } + } + else + { + psz->x = abs(dstSize.x); + psz->y = abs(dstSize.y); + } + break; + } + /* else fall through */ + case TS_MIN: + /* FIXME: couldn't figure how native uxtheme computes min size */ + case TS_TRUE: + psz->x = rcSrc.right - rcSrc.left; + psz->y = rcSrc.bottom - rcSrc.top; + break; + } + return hr; +} + +/********************************************************************** * * UXTHEME_DrawImageBackground * * Draw an imagefile background @@ -387,143 +605,101 @@ RECT rcDst; POINT dstSize; POINT srcSize; - int sizingtype = ST_TRUESIZE; - BOOL uniformsizing = FALSE; - BOOL transparent = FALSE; + POINT drawSize; + int sizingtype = ST_STRETCH; + INT transparent; COLORREF transparentcolor = 0; + BOOL hasAlpha; - hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, FALSE, &bmpSrc, &rcSrc); + hr = UXTHEME_LoadImage(hTheme, hdc, iPartId, iStateId, pRect, FALSE, + &bmpSrc, &rcSrc, &hasAlpha); if(FAILED(hr)) return hr; hdcSrc = CreateCompatibleDC(hdc); if(!hdcSrc) { hr = HRESULT_FROM_WIN32(GetLastError()); - DeleteObject(bmpSrc); return hr; } oldSrc = SelectObject(hdcSrc, bmpSrc); CopyRect(&rcDst, pRect); - GetThemeBool(hTheme, iPartId, iStateId, TMT_TRANSPARENT, &transparent); - if(transparent) { - if(FAILED(GetThemeColor(hTheme, iPartId, iStateId, TMT_TRANSPARENTCOLOR, &transparentcolor))) { - /* If image is transparent, but no color was specified, get the color of the upper left corner */ - transparentcolor = GetPixel(hdcSrc, 0, 0); - } - } + get_transparency (hTheme, iPartId, iStateId, hasAlpha, &transparent, + &transparentcolor, FALSE); dstSize.x = rcDst.right-rcDst.left; dstSize.y = rcDst.bottom-rcDst.top; srcSize.x = rcSrc.right-rcSrc.left; srcSize.y = rcSrc.bottom-rcSrc.top; - GetThemeBool(hTheme, iPartId, iStateId, TMT_UNIFORMSIZING, &uniformsizing); - if(uniformsizing) { - /* Scale height and width equally */ - int widthDiff = abs(srcSize.x-dstSize.x); - int heightDiff = abs(srcSize.y-dstSize.x); - if(widthDiff > heightDiff) { - dstSize.y -= widthDiff-heightDiff; - rcDst.bottom = rcDst.top + dstSize.y; - } - else if(heightDiff > widthDiff) { - dstSize.x -= heightDiff-widthDiff; - rcDst.right = rcDst.left + dstSize.x; - } - } - GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_SIZINGTYPE, &sizingtype); if(sizingtype == ST_TRUESIZE) { - int truesizestretchmark = 0; + int valign = VA_CENTER, halign = HA_CENTER; - if(dstSize.x < 0 || dstSize.y < 0) { - BOOL mirrorimage = TRUE; - GetThemeBool(hTheme, iPartId, iStateId, TMT_MIRRORIMAGE, &mirrorimage); - if(mirrorimage) { - if(dstSize.x < 0) { - rcDst.left += dstSize.x; - rcDst.right += dstSize.x; - } - if(dstSize.y < 0) { - rcDst.top += dstSize.y; - rcDst.bottom += dstSize.y; - } - } - } - /* Only stretch when target exceeds source by truesizestretchmark percent */ - GetThemeInt(hTheme, iPartId, iStateId, TMT_TRUESIZESTRETCHMARK, &truesizestretchmark); - if(dstSize.x < 0 || dstSize.y < 0 || - MulDiv(srcSize.x, 100, dstSize.x) > truesizestretchmark || - MulDiv(srcSize.y, 100, dstSize.y) > truesizestretchmark) { - if(!UXTHEME_StretchBlt(hdc, rcDst.left, rcDst.top, dstSize.x, dstSize.y, - hdcSrc, rcSrc.left, rcSrc.top, srcSize.x, srcSize.y, - transparent, transparentcolor)) - hr = HRESULT_FROM_WIN32(GetLastError()); - } - else { - rcDst.left += (dstSize.x/2)-(srcSize.x/2); - rcDst.top += (dstSize.y/2)-(srcSize.y/2); - rcDst.right = rcDst.left + srcSize.x; - rcDst.bottom = rcDst.top + srcSize.y; - if(!UXTHEME_Blt(hdc, rcDst.left, rcDst.top, srcSize.x, srcSize.y, - hdcSrc, rcSrc.left, rcSrc.top, - transparent, transparentcolor)) - hr = HRESULT_FROM_WIN32(GetLastError()); - } + get_image_part_size (hTheme, hdc, iPartId, iStateId, pRect, TS_DRAW, &drawSize); + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_VALIGN, &valign); + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_HALIGN, &halign); + + if (halign == HA_CENTER) + rcDst.left += (dstSize.x/2)-(drawSize.x/2); + else if (halign == HA_RIGHT) + rcDst.left = rcDst.right - drawSize.x; + if (valign == VA_CENTER) + rcDst.top += (dstSize.y/2)-(drawSize.y/2); + else if (valign == VA_BOTTOM) + rcDst.top = rcDst.bottom - drawSize.y; + rcDst.right = rcDst.left + drawSize.x; + rcDst.bottom = rcDst.top + drawSize.y; + if(!UXTHEME_StretchBlt(hdc, rcDst.left, rcDst.top, drawSize.x, drawSize.y, + hdcSrc, rcSrc.left, rcSrc.top, srcSize.x, srcSize.y, + transparent, transparentcolor)) + hr = HRESULT_FROM_WIN32(GetLastError()); } else { HDC hdcDst = NULL; - HBITMAP bmpDst = NULL; - HGDIOBJ oldDst = NULL; MARGINS sm; + POINT org; dstSize.x = abs(dstSize.x); dstSize.y = abs(dstSize.y); GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_SIZINGMARGINS, NULL, &sm); - hdcDst = CreateCompatibleDC(hdc); - if(!hdcDst) { - hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; - } - bmpDst = CreateCompatibleBitmap(hdc, dstSize.x, dstSize.y); - if(!bmpDst) { - hr = HRESULT_FROM_WIN32(GetLastError()); - goto draw_error; - } - oldDst = SelectObject(hdcDst, bmpDst); + hdcDst = hdc; + OffsetViewportOrgEx(hdcDst, rcDst.left, rcDst.top, &org); /* Upper left corner */ - if(!BitBlt(hdcDst, 0, 0, sm.cxLeftWidth, sm.cyTopHeight, - hdcSrc, rcSrc.left, rcSrc.top, SRCCOPY)) { + if(!UXTHEME_Blt(hdcDst, 0, 0, sm.cxLeftWidth, sm.cyTopHeight, + hdcSrc, rcSrc.left, rcSrc.top, + transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } /* Upper right corner */ - if(!BitBlt(hdcDst, dstSize.x-sm.cxRightWidth, 0, sm.cxRightWidth, sm.cyTopHeight, - hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top, SRCCOPY)) { + if(!UXTHEME_Blt (hdcDst, dstSize.x-sm.cxRightWidth, 0, + sm.cxRightWidth, sm.cyTopHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top, + transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } /* Lower left corner */ - if(!BitBlt(hdcDst, 0, dstSize.y-sm.cyBottomHeight, sm.cxLeftWidth, sm.cyBottomHeight, - hdcSrc, rcSrc.left, rcSrc.bottom-sm.cyBottomHeight, SRCCOPY)) { + if(!UXTHEME_Blt (hdcDst, 0, dstSize.y-sm.cyBottomHeight, + sm.cxLeftWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.left, rcSrc.bottom-sm.cyBottomHeight, + transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } /* Lower right corner */ - if(!BitBlt(hdcDst, dstSize.x-sm.cxRightWidth, dstSize.y-sm.cyBottomHeight, sm.cxRightWidth, sm.cyBottomHeight, - hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.bottom-sm.cyBottomHeight, SRCCOPY)) { + if(!UXTHEME_Blt (hdcDst, dstSize.x-sm.cxRightWidth, dstSize.y-sm.cyBottomHeight, + sm.cxRightWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.bottom-sm.cyBottomHeight, + transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } - if(sizingtype == ST_TILE) { - FIXME("Tile\n"); - sizingtype = ST_STRETCH; /* Just use stretch for now */ - } - if(sizingtype == ST_STRETCH) { + if ((sizingtype == ST_STRETCH) || (sizingtype == ST_TILE)) { int destCenterWidth = dstSize.x - (sm.cxLeftWidth + sm.cxRightWidth); int srcCenterWidth = srcSize.x - (sm.cxLeftWidth + sm.cxRightWidth); int destCenterHeight = dstSize.y - (sm.cyTopHeight + sm.cyBottomHeight); @@ -531,28 +707,41 @@ if(destCenterWidth > 0) { /* Center top */ - if(!StretchBlt(hdcDst, sm.cxLeftWidth, 0, destCenterWidth, sm.cyTopHeight, - hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top, srcCenterWidth, sm.cyTopHeight, SRCCOPY)) { + if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, 0, + destCenterWidth, sm.cyTopHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top, + srcCenterWidth, sm.cyTopHeight, + sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } /* Center bottom */ - if(!StretchBlt(hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight, destCenterWidth, sm.cyBottomHeight, - hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight, srcCenterWidth, sm.cyTopHeight, SRCCOPY)) { + if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight, + destCenterWidth, sm.cyBottomHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight, + srcCenterWidth, sm.cyBottomHeight, + sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } } if(destCenterHeight > 0) { /* Left center */ - if(!StretchBlt(hdcDst, 0, sm.cyTopHeight, sm.cxLeftWidth, destCenterHeight, - hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight, sm.cxLeftWidth, srcCenterHeight, SRCCOPY)) { + if(!UXTHEME_SizedBlt (hdcDst, 0, sm.cyTopHeight, + sm.cxLeftWidth, destCenterHeight, + hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight, + sm.cxLeftWidth, srcCenterHeight, + sizingtype, + transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } /* Right center */ - if(!StretchBlt(hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight, sm.cxRightWidth, destCenterHeight, - hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight, sm.cxRightWidth, srcCenterHeight, SRCCOPY)) { + if(!UXTHEME_SizedBlt (hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight, + sm.cxRightWidth, destCenterHeight, + hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight, + sm.cxRightWidth, srcCenterHeight, + sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } @@ -562,8 +751,11 @@ GetThemeBool(hTheme, iPartId, iStateId, TMT_BORDERONLY, &borderonly); if(!borderonly) { /* Center */ - if(!StretchBlt(hdcDst, sm.cxLeftWidth, sm.cyTopHeight, destCenterWidth, destCenterHeight, - hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight, srcCenterWidth, srcCenterHeight, SRCCOPY)) { + if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, sm.cyTopHeight, + destCenterWidth, destCenterHeight, + hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight, + srcCenterWidth, srcCenterHeight, + sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error; } @@ -571,20 +763,10 @@ } } - if(!UXTHEME_Blt(hdc, rcDst.left, rcDst.top, dstSize.x, dstSize.y, - hdcDst, 0, 0, - transparent, transparentcolor)) - hr = HRESULT_FROM_WIN32(GetLastError()); - draw_error: - if(hdcDst) { - SelectObject(hdcDst, oldDst); - DeleteDC(hdcDst); - } - if(bmpDst) DeleteObject(bmpDst); + SetViewportOrgEx (hdcDst, org.x, org.y, NULL); } SelectObject(hdcSrc, oldSrc); - DeleteObject(bmpSrc); DeleteDC(hdcSrc); CopyRect(pRect, &rcDst); return hr; @@ -751,6 +933,9 @@ if(!hTheme) return E_HANDLE; + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype); + if (bgtype == BT_NONE) return S_OK; + /* Ensure we have a DTBGOPTS structure available, simplifies some of the code */ opts = pOptions; if(!opts) opts = &defaultOpts; @@ -765,7 +950,6 @@ } CopyRect(&rt, pRect); - GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype); if(bgtype == BT_IMAGEFILE) hr = UXTHEME_DrawImageBackground(hTheme, hdc, iPartId, iStateId, &rt, opts); else if(bgtype == BT_BORDERFILL) @@ -787,19 +971,557 @@ return hr; } +/* + * DrawThemeEdge() implementation + * + * Since it basically is DrawEdge() with different colors, I copied its code + * from user32's uitools.c. + */ + +enum +{ + EDGE_LIGHT, + EDGE_HIGHLIGHT, + EDGE_SHADOW, + EDGE_DARKSHADOW, + EDGE_FILL, + + EDGE_WINDOW, + EDGE_WINDOWFRAME, + + EDGE_NUMCOLORS +}; + +static const struct +{ + int themeProp; + int sysColor; +} EdgeColorMap[EDGE_NUMCOLORS] = { + {TMT_EDGELIGHTCOLOR, COLOR_3DLIGHT}, + {TMT_EDGEHIGHLIGHTCOLOR, COLOR_BTNHIGHLIGHT}, + {TMT_EDGESHADOWCOLOR, COLOR_BTNSHADOW}, + {TMT_EDGEDKSHADOWCOLOR, COLOR_3DDKSHADOW}, + {TMT_EDGEFILLCOLOR, COLOR_BTNFACE}, + {-1, COLOR_WINDOW}, + {-1, COLOR_WINDOWFRAME} +}; + +static const signed char LTInnerNormal[] = { + -1, -1, -1, -1, + -1, EDGE_HIGHLIGHT, EDGE_HIGHLIGHT, -1, + -1, EDGE_DARKSHADOW, EDGE_DARKSHADOW, -1, + -1, -1, -1, -1 +}; + +static const signed char LTOuterNormal[] = { + -1, EDGE_LIGHT, EDGE_SHADOW, -1, + EDGE_HIGHLIGHT, EDGE_LIGHT, EDGE_SHADOW, -1, + EDGE_DARKSHADOW, EDGE_LIGHT, EDGE_SHADOW, -1, + -1, EDGE_LIGHT, EDGE_SHADOW, -1 +}; + +static const signed char RBInnerNormal[] = { + -1, -1, -1, -1, + -1, EDGE_SHADOW, EDGE_SHADOW, -1, + -1, EDGE_LIGHT, EDGE_LIGHT, -1, + -1, -1, -1, -1 +}; + +static const signed char RBOuterNormal[] = { + -1, EDGE_DARKSHADOW, EDGE_HIGHLIGHT, -1, + EDGE_SHADOW, EDGE_DARKSHADOW, EDGE_HIGHLIGHT, -1, + EDGE_LIGHT, EDGE_DARKSHADOW, EDGE_HIGHLIGHT, -1, + -1, EDGE_DARKSHADOW, EDGE_HIGHLIGHT, -1 +}; + +static const signed char LTInnerSoft[] = { + -1, -1, -1, -1, + -1, EDGE_LIGHT, EDGE_LIGHT, -1, + -1, EDGE_SHADOW, EDGE_SHADOW, -1, + -1, -1, -1, -1 +}; + +static const signed char LTOuterSoft[] = { + -1, EDGE_HIGHLIGHT, EDGE_DARKSHADOW, -1, + EDGE_LIGHT, EDGE_HIGHLIGHT, EDGE_DARKSHADOW, -1, + EDGE_SHADOW, EDGE_HIGHLIGHT, EDGE_DARKSHADOW, -1, + -1, EDGE_HIGHLIGHT, EDGE_DARKSHADOW, -1 +}; + +#define RBInnerSoft RBInnerNormal /* These are the same */ +#define RBOuterSoft RBOuterNormal + +static const signed char LTRBOuterMono[] = { + -1, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, + EDGE_WINDOW, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, + EDGE_WINDOW, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, + EDGE_WINDOW, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, EDGE_WINDOWFRAME, +}; + +static const signed char LTRBInnerMono[] = { + -1, -1, -1, -1, + -1, EDGE_WINDOW, EDGE_WINDOW, EDGE_WINDOW, + -1, EDGE_WINDOW, EDGE_WINDOW, EDGE_WINDOW, + -1, EDGE_WINDOW, EDGE_WINDOW, EDGE_WINDOW, +}; + +static const signed char LTRBOuterFlat[] = { + -1, EDGE_SHADOW, EDGE_SHADOW, EDGE_SHADOW, + EDGE_FILL, EDGE_SHADOW, EDGE_SHADOW, EDGE_SHADOW, + EDGE_FILL, EDGE_SHADOW, EDGE_SHADOW, EDGE_SHADOW, + EDGE_FILL, EDGE_SHADOW, EDGE_SHADOW, EDGE_SHADOW, +}; + +static const signed char LTRBInnerFlat[] = { + -1, -1, -1, -1, + -1, EDGE_FILL, EDGE_FILL, EDGE_FILL, + -1, EDGE_FILL, EDGE_FILL, EDGE_FILL, + -1, EDGE_FILL, EDGE_FILL, EDGE_FILL, +}; + +static COLORREF get_edge_color (int edgeType, HTHEME theme, int part, int state) +{ + COLORREF col; + if ((EdgeColorMap[edgeType].themeProp == -1) + || FAILED (GetThemeColor (theme, part, state, + EdgeColorMap[edgeType].themeProp, &col))) + col = GetSysColor (EdgeColorMap[edgeType].sysColor); + return col; +} + +static inline HPEN get_edge_pen (int edgeType, HTHEME theme, int part, int state) +{ + return CreatePen (PS_SOLID, 1, get_edge_color (edgeType, theme, part, state)); +} + +static inline HBRUSH get_edge_brush (int edgeType, HTHEME theme, int part, int state) +{ + return CreateSolidBrush (get_edge_color (edgeType, theme, part, state)); +} + /*********************************************************************** + * draw_diag_edge + * + * Same as DrawEdge invoked with BF_DIAGONAL + */ +static HRESULT draw_diag_edge (HDC hdc, HTHEME theme, int part, int state, + const RECT* rc, UINT uType, + UINT uFlags, LPRECT contentsRect) +{ + POINT Points[4]; + signed char InnerI, OuterI; + HPEN InnerPen, OuterPen; + POINT SavePoint; + HPEN SavePen; + int spx, spy; + int epx, epy; + int Width = rc->right - rc->left; + int Height= rc->bottom - rc->top; + int SmallDiam = Width > Height ? Height : Width; + HRESULT retval = (((uType & BDR_INNER) == BDR_INNER + || (uType & BDR_OUTER) == BDR_OUTER) + && !(uFlags & (BF_FLAT|BF_MONO)) ) ? E_FAIL : S_OK; + int add = (LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0) + + (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0); + + /* Init some vars */ + OuterPen = InnerPen = (HPEN)GetStockObject(NULL_PEN); + SavePen = (HPEN)SelectObject(hdc, InnerPen); + spx = spy = epx = epy = 0; /* Satisfy the compiler... */ + + /* Determine the colors of the edges */ + if(uFlags & BF_MONO) + { + InnerI = LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)]; + OuterI = LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)]; + } + else if(uFlags & BF_FLAT) + { + InnerI = LTRBInnerFlat[uType & (BDR_INNER|BDR_OUTER)]; + OuterI = LTRBOuterFlat[uType & (BDR_INNER|BDR_OUTER)]; + } + else if(uFlags & BF_SOFT) + { + if(uFlags & BF_BOTTOM) + { + InnerI = RBInnerSoft[uType & (BDR_INNER|BDR_OUTER)]; + OuterI = RBOuterSoft[uType & (BDR_INNER|BDR_OUTER)]; + } + else + { + InnerI = LTInnerSoft[uType & (BDR_INNER|BDR_OUTER)]; + OuterI = LTOuterSoft[uType & (BDR_INNER|BDR_OUTER)]; + } + } + else + { + if(uFlags & BF_BOTTOM) + { + InnerI = RBInnerNormal[uType & (BDR_INNER|BDR_OUTER)]; + OuterI = RBOuterNormal[uType & (BDR_INNER|BDR_OUTER)]; + } + else + { + InnerI = LTInnerNormal[uType & (BDR_INNER|BDR_OUTER)]; + OuterI = LTOuterNormal[uType & (BDR_INNER|BDR_OUTER)]; + } + } + + if(InnerI != -1) InnerPen = get_edge_pen (InnerI, theme, part, state); + if(OuterI != -1) OuterPen = get_edge_pen (OuterI, theme, part, state); + + MoveToEx(hdc, 0, 0, &SavePoint); + + /* Don't ask me why, but this is what is visible... */ + /* This must be possible to do much simpler, but I fail to */ + /* see the logic in the MS implementation (sigh...). */ + /* So, this might look a bit brute force here (and it is), but */ + /* it gets the job done;) */ + + switch(uFlags & BF_RECT) + { + case 0: + case BF_LEFT: + case BF_BOTTOM: + case BF_BOTTOMLEFT: + /* Left bottom endpoint */ + epx = rc->left-1; + spx = epx + SmallDiam; + epy = rc->bottom; + spy = epy - SmallDiam; + break; + + case BF_TOPLEFT: + case BF_BOTTOMRIGHT: + /* Left top endpoint */ + epx = rc->left-1; + spx = epx + SmallDiam; + epy = rc->top-1; + spy = epy + SmallDiam; + break; + + case BF_TOP: + case BF_RIGHT: + case BF_TOPRIGHT: + case BF_RIGHT|BF_LEFT: + case BF_RIGHT|BF_LEFT|BF_TOP: + case BF_BOTTOM|BF_TOP: + case BF_BOTTOM|BF_TOP|BF_LEFT: + case BF_BOTTOMRIGHT|BF_LEFT: + case BF_BOTTOMRIGHT|BF_TOP: + case BF_RECT: + /* Right top endpoint */ + spx = rc->left; + epx = spx + SmallDiam; + spy = rc->bottom-1; + epy = spy - SmallDiam; + break; + } + + MoveToEx(hdc, spx, spy, NULL); + SelectObject(hdc, OuterPen); + LineTo(hdc, epx, epy); + + SelectObject(hdc, InnerPen); + + switch(uFlags & (BF_RECT|BF_DIAGONAL)) + { + case BF_DIAGONAL_ENDBOTTOMLEFT: + case (BF_DIAGONAL|BF_BOTTOM): + case BF_DIAGONAL: + case (BF_DIAGONAL|BF_LEFT): + MoveToEx(hdc, spx-1, spy, NULL); + LineTo(hdc, epx, epy-1); + Points[0].x = spx-add; + Points[0].y = spy; + Points[1].x = rc->left; + Points[1].y = rc->top; + Points[2].x = epx+1; + Points[2].y = epy-1-add; + Points[3] = Points[2]; + break; + + case BF_DIAGONAL_ENDBOTTOMRIGHT: + MoveToEx(hdc, spx-1, spy, NULL); + LineTo(hdc, epx, epy+1); + Points[0].x = spx-add; + Points[0].y = spy; + Points[1].x = rc->left; + Points[1].y = rc->bottom-1; + Points[2].x = epx+1; + Points[2].y = epy+1+add; + Points[3] = Points[2]; + break; + + case (BF_DIAGONAL|BF_BOTTOM|BF_RIGHT|BF_TOP): [truncated at 1000 lines; 1215 more skipped]
19 years, 3 months
1
0
0
0
[ion] 17718: Return correct size. This fixes bug 756
by ion@svn.reactos.com
Return correct size. This fixes bug 756 Modified: trunk/reactos/lib/rtl/unicode.c _____ Modified: trunk/reactos/lib/rtl/unicode.c --- trunk/reactos/lib/rtl/unicode.c 2005-09-07 15:57:31 UTC (rev 17717) +++ trunk/reactos/lib/rtl/unicode.c 2005-09-07 16:02:32 UTC (rev 17718) @@ -1748,7 +1748,7 @@ NTSTATUS Status; ULONG Length; /* including nullterm */ - Length = RtlUnicodeStringToAnsiSize(UniSource); + Length = RtlUnicodeStringToOemSize(UniSource); if (Length > 0x0000FFFF) return STATUS_INVALID_PARAMETER_2;
19 years, 3 months
1
0
0
0
[gvg] 17717: Sync to Wine-20050830:
by gvg@svn.reactos.com
Sync to Wine-20050830: Francois Gouget <fgouget(a)free.fr> - Add missing WINAPI to MSXML_DllGetClassObject(). Standardize the DllGetClassObject() prototypes so they match the MSDN definition. Alexandre Julliard <julliard(a)winehq.org> - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. Deleted: trunk/reactos/lib/urlmon/Makefile.in Modified: trunk/reactos/lib/urlmon/regsvr.c Modified: trunk/reactos/lib/urlmon/urlmon.spec Modified: trunk/reactos/lib/urlmon/urlmon_main.c _____ Deleted: trunk/reactos/lib/urlmon/Makefile.in --- trunk/reactos/lib/urlmon/Makefile.in 2005-09-07 15:52:47 UTC (rev 17716) +++ trunk/reactos/lib/urlmon/Makefile.in 2005-09-07 15:57:31 UTC (rev 17717) @@ -1,23 +0,0 @@ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = urlmon.dll -IMPORTLIB = liburlmon.$(IMPLIBEXT) -IMPORTS = cabinet ole32 shlwapi wininet user32 advapi32 kernel32 ntdll -EXTRALIBS = -luuid - -C_SRCS = \ - regsvr.c \ - sec_mgr.c \ - umon.c \ - umstream.c \ - urlmon_main.c - -RC_SRCS = rsrc.rc - -SUBDIRS = tests - -@MAKE_DLL_RULES@ - -### Dependencies: _____ Modified: trunk/reactos/lib/urlmon/regsvr.c --- trunk/reactos/lib/urlmon/regsvr.c 2005-09-07 15:52:47 UTC (rev 17716) +++ trunk/reactos/lib/urlmon/regsvr.c 2005-09-07 15:57:31 UTC (rev 17717) @@ -624,7 +624,7 @@ /*********************************************************************** * DllRegisterServer (URLMON.@) */ -HRESULT WINAPI URLMON_DllRegisterServer(void) +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -641,7 +641,7 @@ /*********************************************************************** * DllUnregisterServer (URLMON.@) */ -HRESULT WINAPI URLMON_DllUnregisterServer(void) +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; _____ Modified: trunk/reactos/lib/urlmon/urlmon.spec --- trunk/reactos/lib/urlmon/urlmon.spec 2005-09-07 15:52:47 UTC (rev 17716) +++ trunk/reactos/lib/urlmon/urlmon.spec 2005-09-07 15:57:31 UTC (rev 17717) @@ -1,82 +1,82 @@ -# Up until Windows 2000 these APIs have hardcoded ordinals. -# Keep it that way for compatibility. -1 stub CDLGetLongPathNameA -2 stub CDLGetLongPathNameW -# IsJITInProgress has a hardcoded ordinal on WinME and Windows 2000 -#3 stub IsJITInProgress - -@ stub AsyncGetClassBits -@ stub AsyncInstallDistributionUnit -@ stub BindAsyncMoniker -@ stdcall CoGetClassObjectFromURL(ptr wstr long long wstr ptr long ptr ptr ptr) -@ stub CoInstall -@ stdcall CoInternetCombineUrl(wstr wstr long wstr long ptr long) -@ stdcall CoInternetCompareUrl(wstr wstr long) -@ stdcall CoInternetCreateSecurityManager(ptr ptr long) -@ stdcall CoInternetCreateZoneManager(ptr ptr long) -@ stub CoInternetGetProtocolFlags -@ stub CoInternetGetSecurityUrl -@ stdcall CoInternetGetSession(long ptr long) -@ stub CoInternetParseUrl -@ stdcall CoInternetQueryInfo(ptr long long ptr long ptr long) -@ stub CompareSecurityIds -@ stub CopyBindInfo -@ stub CopyStgMedium -@ stdcall CreateAsyncBindCtx(long ptr ptr ptr) -@ stdcall CreateAsyncBindCtxEx(ptr long ptr ptr ptr long) -@ stub CreateFormatEnumerator -@ stdcall CreateURLMoniker(ptr wstr ptr) -@ stdcall -private DllCanUnloadNow() URLMON_DllCanUnloadNow -@ stdcall -private DllGetClassObject(ptr ptr ptr) URLMON_DllGetClassObject -@ stdcall DllInstall(long ptr) URLMON_DllInstall -@ stdcall -private DllRegisterServer() URLMON_DllRegisterServer -@ stdcall -private DllRegisterServerEx() URLMON_DllRegisterServerEx -@ stdcall -private DllUnregisterServer() URLMON_DllUnregisterServer -@ stdcall Extract(long ptr) cabinet.Extract -@ stdcall FaultInIEFeature(long ptr ptr long) -@ stub FindMediaType -@ stub FindMediaTypeClass -@ stdcall FindMimeFromData(long ptr ptr long ptr long ptr long) -@ stub GetClassFileOrMime -@ stub GetClassURL -@ stub GetComponentIDFromCLSSPEC -@ stub GetMarkOfTheWeb -@ stdcall GetSoftwareUpdateInfo(ptr ptr) -@ stub HlinkGoBack -@ stub HlinkGoForward -@ stub HlinkNavigateMoniker -@ stdcall HlinkNavigateString(ptr wstr) -@ stub HlinkSimpleNavigateToMoniker -@ stdcall HlinkSimpleNavigateToString(wstr wstr wstr ptr ptr ptr long long) -@ stdcall IsAsyncMoniker(ptr) -@ stub IsLoggingEnabledA -@ stub IsLoggingEnabledW -@ stdcall IsValidURL(ptr wstr long) -@ stdcall MkParseDisplayNameEx(ptr ptr ptr ptr) ole32.MkParseDisplayName -@ stdcall ObtainUserAgentString(long str ptr) -@ stub PrivateCoInstall -@ stdcall RegisterBindStatusCallback(ptr ptr ptr long) -@ stub RegisterFormatEnumerator -@ stub RegisterMediaTypeClass -@ stub RegisterMediaTypes -@ stdcall ReleaseBindInfo(ptr) -@ stdcall RevokeBindStatusCallback(ptr ptr) -@ stub RevokeFormatEnumerator -@ stub SetSoftwareUpdateAdvertisementState -@ stub URLDownloadA -@ stub URLDownloadToCacheFileA -@ stub URLDownloadToCacheFileW -@ stdcall URLDownloadToFileA(ptr str str long ptr) -@ stdcall URLDownloadToFileW(ptr wstr wstr long ptr) -@ stub URLDownloadW -@ stub URLOpenBlockingStreamA -@ stub URLOpenBlockingStreamW -@ stub URLOpenPullStreamA -@ stub URLOpenPullStreamW -@ stub URLOpenStreamA -@ stub URLOpenStreamW -@ stub UrlMkBuildVersion -@ stdcall UrlMkGetSessionOption(long ptr long ptr long) -@ stdcall UrlMkSetSessionOption(long ptr long long) -@ stub WriteHitLogging -@ stub ZonesReInit +# Up until Windows 2000 these APIs have hardcoded ordinals. +# Keep it that way for compatibility. +1 stub CDLGetLongPathNameA +2 stub CDLGetLongPathNameW +# IsJITInProgress has a hardcoded ordinal on WinME and Windows 2000 +#3 stub IsJITInProgress + +@ stub AsyncGetClassBits +@ stub AsyncInstallDistributionUnit +@ stub BindAsyncMoniker +@ stdcall CoGetClassObjectFromURL(ptr wstr long long wstr ptr long ptr ptr ptr) +@ stub CoInstall +@ stdcall CoInternetCombineUrl(wstr wstr long wstr long ptr long) +@ stdcall CoInternetCompareUrl(wstr wstr long) +@ stdcall CoInternetCreateSecurityManager(ptr ptr long) +@ stdcall CoInternetCreateZoneManager(ptr ptr long) +@ stub CoInternetGetProtocolFlags +@ stub CoInternetGetSecurityUrl +@ stdcall CoInternetGetSession(long ptr long) +@ stub CoInternetParseUrl +@ stdcall CoInternetQueryInfo(ptr long long ptr long ptr long) +@ stub CompareSecurityIds +@ stub CopyBindInfo +@ stub CopyStgMedium +@ stdcall CreateAsyncBindCtx(long ptr ptr ptr) +@ stdcall CreateAsyncBindCtxEx(ptr long ptr ptr ptr long) +@ stub CreateFormatEnumerator +@ stdcall CreateURLMoniker(ptr wstr ptr) +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllInstall(long wstr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllRegisterServerEx() +@ stdcall -private DllUnregisterServer() +@ stdcall Extract(long ptr) cabinet.Extract +@ stdcall FaultInIEFeature(long ptr ptr long) +@ stub FindMediaType +@ stub FindMediaTypeClass +@ stdcall FindMimeFromData(long ptr ptr long ptr long ptr long) +@ stub GetClassFileOrMime +@ stub GetClassURL +@ stub GetComponentIDFromCLSSPEC +@ stub GetMarkOfTheWeb +@ stdcall GetSoftwareUpdateInfo(ptr ptr) +@ stub HlinkGoBack +@ stub HlinkGoForward +@ stub HlinkNavigateMoniker +@ stdcall HlinkNavigateString(ptr wstr) +@ stub HlinkSimpleNavigateToMoniker +@ stdcall HlinkSimpleNavigateToString(wstr wstr wstr ptr ptr ptr long long) +@ stdcall IsAsyncMoniker(ptr) +@ stub IsLoggingEnabledA +@ stub IsLoggingEnabledW +@ stdcall IsValidURL(ptr wstr long) +@ stdcall MkParseDisplayNameEx(ptr ptr ptr ptr) ole32.MkParseDisplayName +@ stdcall ObtainUserAgentString(long str ptr) +@ stub PrivateCoInstall +@ stdcall RegisterBindStatusCallback(ptr ptr ptr long) +@ stub RegisterFormatEnumerator +@ stub RegisterMediaTypeClass +@ stub RegisterMediaTypes +@ stdcall ReleaseBindInfo(ptr) +@ stdcall RevokeBindStatusCallback(ptr ptr) +@ stub RevokeFormatEnumerator +@ stub SetSoftwareUpdateAdvertisementState +@ stub URLDownloadA +@ stub URLDownloadToCacheFileA +@ stub URLDownloadToCacheFileW +@ stdcall URLDownloadToFileA(ptr str str long ptr) +@ stdcall URLDownloadToFileW(ptr wstr wstr long ptr) +@ stub URLDownloadW +@ stub URLOpenBlockingStreamA +@ stub URLOpenBlockingStreamW +@ stub URLOpenPullStreamA +@ stub URLOpenPullStreamW +@ stub URLOpenStreamA +@ stub URLOpenStreamW +@ stub UrlMkBuildVersion +@ stdcall UrlMkGetSessionOption(long ptr long ptr long) +@ stdcall UrlMkSetSessionOption(long ptr long long) +@ stub WriteHitLogging +@ stub ZonesReInit Property changes on: trunk/reactos/lib/urlmon/urlmon.spec ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/urlmon/urlmon_main.c --- trunk/reactos/lib/urlmon/urlmon_main.c 2005-09-07 15:52:47 UTC (rev 17716) +++ trunk/reactos/lib/urlmon/urlmon_main.c 2005-09-07 15:57:31 UTC (rev 17717) @@ -65,7 +65,7 @@ /*********************************************************************** * DllInstall (URLMON.@) */ -HRESULT WINAPI URLMON_DllInstall(BOOL bInstall, LPCWSTR cmdline) +HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline) { FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", debugstr_w(cmdline)); @@ -76,7 +76,7 @@ /*********************************************************************** * DllCanUnloadNow (URLMON.@) */ -HRESULT WINAPI URLMON_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { return URLMON_refCount != 0 ? S_FALSE : S_OK; } @@ -199,7 +199,7 @@ * E_UNEXPECTED */ -DWORD WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { int i; IClassFactoryImpl *factory; @@ -240,7 +240,7 @@ /*********************************************************************** * DllRegisterServerEx (URLMON.@) */ -HRESULT WINAPI URLMON_DllRegisterServerEx(void) +HRESULT WINAPI DllRegisterServerEx(void) { FIXME("(void): stub\n");
19 years, 3 months
1
0
0
0
[gvg] 17716: Sync to Wine-20050830:
by gvg@svn.reactos.com
Sync to Wine-20050830: Huw Davies <huw(a)codeweavers.com> - IUnknown_SetSite calls IObjectWithSite_SetSite or IInternetSecurityManager_SetSecuritySite. - Fix call to GetMenuItemInfo and unicodify while we're at it. - Implement SHLoadIndirectString. - _CreateAllAccessSecurityAttributes takes three parameters. - Forward ordinals 457,458 to GetLongPathNameW,A. - Implement SHLoadRegUIStringW. - Partial implementation of DeleteMenuWrap. - Implement IUnknown_EnumObjects. - Implement and add tests for the FDSA functions. Alexandre Julliard <julliard(a)winehq.org> - Don't prefix the functions DllInstall and DllGetVersion with the dll name so that the compiler can check the prototypes. Vincent Beron <vberon(a)mecano.gme.usherb.ca> - Correct typo in format string. Mike McCormack <mike(a)codeweavers.com> - gcc 4.0 warning fixes. Steven Edwards <steven_ed4153(a)yahoo.com> - Correct RegCreateKeyEx[A/W] prototype to match the PSDK. Deleted: trunk/reactos/include/wine/urlmon.h Modified: trunk/reactos/lib/shlwapi/istream.c Modified: trunk/reactos/lib/shlwapi/ordinal.c Modified: trunk/reactos/lib/shlwapi/reg.c Modified: trunk/reactos/lib/shlwapi/regstream.c Modified: trunk/reactos/lib/shlwapi/shlwapi.spec Modified: trunk/reactos/lib/shlwapi/shlwapi_main.c Modified: trunk/reactos/lib/shlwapi/string.c Modified: trunk/reactos/lib/shlwapi/thread.c Added: trunk/reactos/w32api/include/msxml.h Modified: trunk/reactos/w32api/include/ocidl.h Modified: trunk/reactos/w32api/include/shlwapi.h Added: trunk/reactos/w32api/include/urlmon.h _____ Deleted: trunk/reactos/include/wine/urlmon.h --- trunk/reactos/include/wine/urlmon.h 2005-09-07 15:09:06 UTC (rev 17715) +++ trunk/reactos/include/wine/urlmon.h 2005-09-07 15:52:47 UTC (rev 17716) @@ -1,2286 +0,0 @@ -/*** Autogenerated by WIDL 0.1 from urlmon.idl - Do not edit ***/ -#include <rpc.h> -#include <rpcndr.h> - -#ifndef __WIDL_URLMON_H -#define __WIDL_URLMON_H -#ifdef __cplusplus -extern "C" { -#endif -#include <objidl.h> -#include <oleidl.h> -#include <servprov.h> -#ifndef __IBinding_FWD_DEFINED__ -#define __IBinding_FWD_DEFINED__ -typedef struct IBinding IBinding; -#endif - -typedef IBinding *LPBINDING; - -/********************************************************************** ******* - * IBinding interface - */ -#ifndef __IBinding_INTERFACE_DEFINED__ -#define __IBinding_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IBinding, 0x79eac9c0, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b); -#if defined(__cplusplus) && !defined(CINTERFACE) -struct IBinding : public IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE Abort( - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE Suspend( - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE Resume( - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPriority( - LONG nPriority) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPriority( - LONG* pnPriority) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBindResult( - CLSID* pclsidProtocol, - DWORD* pdwResult, - LPOLESTR* pszResult, - DWORD* pdwReserved) = 0; - -}; -#else -typedef struct IBindingVtbl IBindingVtbl; -struct IBinding { - const IBindingVtbl* lpVtbl; -}; -struct IBindingVtbl { - BEGIN_INTERFACE - - /*** IUnknown methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInterface)( - IBinding* This, - REFIID riid, - void** ppvObject); - - ULONG (STDMETHODCALLTYPE *AddRef)( - IBinding* This); - - ULONG (STDMETHODCALLTYPE *Release)( - IBinding* This); - - /*** IBinding methods ***/ - HRESULT (STDMETHODCALLTYPE *Abort)( - IBinding* This); - - HRESULT (STDMETHODCALLTYPE *Suspend)( - IBinding* This); - - HRESULT (STDMETHODCALLTYPE *Resume)( - IBinding* This); - - HRESULT (STDMETHODCALLTYPE *SetPriority)( - IBinding* This, - LONG nPriority); - - HRESULT (STDMETHODCALLTYPE *GetPriority)( - IBinding* This, - LONG* pnPriority); - - HRESULT (STDMETHODCALLTYPE *GetBindResult)( - IBinding* This, - CLSID* pclsidProtocol, - DWORD* pdwResult, - LPOLESTR* pszResult, - DWORD* pdwReserved); - - END_INTERFACE -}; - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IBinding_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IBinding_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IBinding_Release(p) (p)->lpVtbl->Release(p) -/*** IBinding methods ***/ -#define IBinding_Abort(p) (p)->lpVtbl->Abort(p) -#define IBinding_Suspend(p) (p)->lpVtbl->Suspend(p) -#define IBinding_Resume(p) (p)->lpVtbl->Resume(p) -#define IBinding_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) -#define IBinding_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a) -#define IBinding_GetBindResult(p,a,b,c,d) (p)->lpVtbl->GetBindResult(p,a,b,c,d) -#endif - -#endif - -HRESULT CALLBACK IBinding_Abort_Proxy( - IBinding* This); -void __RPC_STUB IBinding_Abort_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBinding_Suspend_Proxy( - IBinding* This); -void __RPC_STUB IBinding_Suspend_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBinding_Resume_Proxy( - IBinding* This); -void __RPC_STUB IBinding_Resume_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBinding_SetPriority_Proxy( - IBinding* This, - LONG nPriority); -void __RPC_STUB IBinding_SetPriority_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBinding_GetPriority_Proxy( - IBinding* This, - LONG* pnPriority); -void __RPC_STUB IBinding_GetPriority_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBinding_RemoteGetBindResult_Proxy( - IBinding* This, - CLSID* pclsidProtocol, - DWORD* pdwResult, - LPOLESTR* pszResult, - DWORD dwReserved); -void __RPC_STUB IBinding_RemoteGetBindResult_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBinding_GetBindResult_Proxy( - IBinding* This, - CLSID* pclsidProtocol, - DWORD* pdwResult, - LPOLESTR* pszResult, - DWORD* pdwReserved); -HRESULT __RPC_STUB IBinding_GetBindResult_Stub( - IBinding* This, - CLSID* pclsidProtocol, - DWORD* pdwResult, - LPOLESTR* pszResult, - DWORD dwReserved); - -#endif /* __IBinding_INTERFACE_DEFINED__ */ - -#ifndef __IBindStatusCallback_FWD_DEFINED__ -#define __IBindStatusCallback_FWD_DEFINED__ -typedef struct IBindStatusCallback IBindStatusCallback; -#endif - -typedef IBindStatusCallback *LPBINDSTATUSCALLBACK; - -typedef enum { - BINDF_ASYNCHRONOUS = 0x1, - BINDF_ASYNCSTORAGE = 0x2, - BINDF_NOPROGRESSIVERENDERING = 0x4, - BINDF_OFFLINEOPERATION = 0x8, - BINDF_GETNEWESTVERSION = 0x10, - BINDF_NOWRITECACHE = 0x20, - BINDF_NEEDFILE = 0x40, - BINDF_PULLDATA = 0x80, - BINDF_IGNORESECURITYPROBLEM = 0x100, - BINDF_RESYNCHRONIZE = 0x200, - BINDF_HYPERLINK = 0x400, - BINDF_NO_UI = 0x800, - BINDF_SILENTOPERATION = 0x1000, - BINDF_PRAGMA_NO_CACHE = 0x2000, - BINDF_GETCLASSOBJECT = 0x4000, - BINDF_RESERVED_1 = 0x8000, - BINDF_FREE_THREADED = 0x10000, - BINDF_DIRECT_READ = 0x20000, - BINDF_FORMS_SUBMIT = 0x40000, - BINDF_GETFROMCACHE_IF_NET_FAIL = 0x80000, - BINDF_FROMURLMON = 0x100000, - BINDF_FWD_BACK = 0x200000, - BINDF_PREFERDEFAULTHANDLER = 0x400000, - BINDF_ENFORCERESTRICTED = 0x800000 -} BINDF; - -typedef struct _tagBINDINFO { - ULONG cbSize; - LPWSTR szExtraInfo; - STGMEDIUM stgmedData; - DWORD grfBindInfoF; - DWORD dwBindVerb; - LPWSTR szCustomVerb; - DWORD cbStgmedData; - DWORD dwOptions; - DWORD dwOptionsFlags; - DWORD dwCodePage; - SECURITY_ATTRIBUTES securityAttributes; - IID iid; - IUnknown *pUnk; - DWORD dwReserved; -} BINDINFO; - -typedef struct _REMSECURITY_ATTRIBUTES { - DWORD nLength; - DWORD lpSecurityDescriptor; - BOOL bInheritHandle; -} REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES; - -typedef struct _tagRemBINDINFO { - ULONG cbSize; - LPWSTR szExtraInfo; - DWORD grfBindInfoF; - DWORD dwBindVerb; - LPWSTR szCustomVerb; - DWORD cbstgmedData; - DWORD dwOptions; - DWORD dwOptionsFlags; - DWORD dwCodePage; - REMSECURITY_ATTRIBUTES securityAttributes; - IID iid; - IUnknown *pUnk; - DWORD dwReserved; -} RemBINDINFO; - -typedef struct tagRemFORMATETC { - DWORD cfFormat; - DWORD ptd; - DWORD dwAspect; - LONG lindex; - DWORD tymed; -} RemFORMATETC, *LPREMFORMATETC; - -typedef enum { - BSCF_FIRSTDATANOTIFICATION = 0x1, - BSCF_INTERMEDIATEDATANOTIFICATION = 0x2, - BSCF_LASTDATANOTIFICATION = 0x4, - BSCF_DATAFULLYAVAILABLE = 0x8, - BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10 -} BSCF; - -typedef enum BINDSTATUS { - BINDSTATUS_FINDINGRESOURCE = 1, - BINDSTATUS_CONNECTING, - BINDSTATUS_REDIRECTING, - BINDSTATUS_BEGINDOWNLOADDATA, - BINDSTATUS_DOWNLOADINGDATA, - BINDSTATUS_ENDDOWNLOADDATA, - BINDSTATUS_BEGINDOWNLOADCOMPONENTS, - BINDSTATUS_INSTALLINGCOMPONENTS, - BINDSTATUS_ENDDOWNLOADCOMPONENTS, - BINDSTATUS_USINGCACHEDCOPY, - BINDSTATUS_SENDINGREQUEST, - BINDSTATUS_CLASSIDAVAILABLE, - BINDSTATUS_MIMETYPEAVAILABLE, - BINDSTATUS_CACHEFILENAMEAVAILABLE, - BINDSTATUS_BEGINSYNCOPERATION, - BINDSTATUS_ENDSYNCOPERATION, - BINDSTATUS_BEGINUPLOADDATA, - BINDSTATUS_UPLOADINGDATA, - BINDSTATUS_ENDUPLOADINGDATA, - BINDSTATUS_PROTOCOLCLASSID, - BINDSTATUS_ENCODING, - BINDSTATUS_VERFIEDMIMETYPEAVAILABLE, - BINDSTATUS_CLASSINSTALLLOCATION, - BINDSTATUS_DECODING, - BINDSTATUS_LOADINGMIMEHANDLER, - BINDSTATUS_CONTENTDISPOSITIONATTACH, - BINDSTATUS_FILTERREPORTMIMETYPE, - BINDSTATUS_CLSIDCANINSTANTIATE, - BINDSTATUS_IUNKNOWNAVAILABLE, - BINDSTATUS_DIRECTBIND, - BINDSTATUS_RAWMIMETYPE, - BINDSTATUS_PROXYDETECTING, - BINDSTATUS_ACCEPTRANGES, - BINDSTATUS_COOKIE_SENT, - BINDSTATUS_COMPACT_POLICY_RECEIVED, - BINDSTATUS_COOKIE_SUPPRESSED, - BINDSTATUS_COOKIE_STATE_UNKNOWN, - BINDSTATUS_COOKIE_STATE_ACCEPT, - BINDSTATUS_COOKIE_STATE_REJECT, - BINDSTATUS_COOKIE_STATE_PROMPT, - BINDSTATUS_COOKIE_STATE_LEASH, - BINDSTATUS_COOKIE_STATE_DOWNGRADE, - BINDSTATUS_POLICY_HREF, - BINDSTATUS_P3P_HEADER, - BINDSTATUS_SESSION_COOKIE_RECEIVED, - BINDSTATUS_PERSISTENT_COOKIE_RECEIVED, - BINDSTATUS_SESSION_COOKIES_ALLOWED, - BINDSTATUS_CACHECONTROL -} BINDSTATUS; - -/********************************************************************** ******* - * IBindStatusCallback interface - */ -#ifndef __IBindStatusCallback_INTERFACE_DEFINED__ -#define __IBindStatusCallback_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IBindStatusCallback, 0x79eac9c1, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b); -#if defined(__cplusplus) && !defined(CINTERFACE) -struct IBindStatusCallback : public IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE OnStartBinding( - DWORD dwReserved, - IBinding* pib) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPriority( - LONG* pnPriority) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnLowResource( - DWORD reserved) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnProgress( - ULONG ulProgress, - ULONG ulProgressMax, - ULONG ulStatusCode, - LPCWSTR szStatusText) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnStopBinding( - HRESULT hresult, - LPCWSTR szError) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBindInfo( - DWORD* grfBINDF, - BINDINFO* pbindinfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnDataAvailable( - DWORD grfBSCF, - DWORD dwSize, - FORMATETC* pformatetc, - STGMEDIUM* pstgmed) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnObjectAvailable( - REFIID riid, - IUnknown* punk) = 0; - -}; -#else -typedef struct IBindStatusCallbackVtbl IBindStatusCallbackVtbl; -struct IBindStatusCallback { - const IBindStatusCallbackVtbl* lpVtbl; -}; -struct IBindStatusCallbackVtbl { - BEGIN_INTERFACE - - /*** IUnknown methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInterface)( - IBindStatusCallback* This, - REFIID riid, - void** ppvObject); - - ULONG (STDMETHODCALLTYPE *AddRef)( - IBindStatusCallback* This); - - ULONG (STDMETHODCALLTYPE *Release)( - IBindStatusCallback* This); - - /*** IBindStatusCallback methods ***/ - HRESULT (STDMETHODCALLTYPE *OnStartBinding)( - IBindStatusCallback* This, - DWORD dwReserved, - IBinding* pib); - - HRESULT (STDMETHODCALLTYPE *GetPriority)( - IBindStatusCallback* This, - LONG* pnPriority); - - HRESULT (STDMETHODCALLTYPE *OnLowResource)( - IBindStatusCallback* This, - DWORD reserved); - - HRESULT (STDMETHODCALLTYPE *OnProgress)( - IBindStatusCallback* This, - ULONG ulProgress, - ULONG ulProgressMax, - ULONG ulStatusCode, - LPCWSTR szStatusText); - - HRESULT (STDMETHODCALLTYPE *OnStopBinding)( - IBindStatusCallback* This, - HRESULT hresult, - LPCWSTR szError); - - HRESULT (STDMETHODCALLTYPE *GetBindInfo)( - IBindStatusCallback* This, - DWORD* grfBINDF, - BINDINFO* pbindinfo); - - HRESULT (STDMETHODCALLTYPE *OnDataAvailable)( - IBindStatusCallback* This, - DWORD grfBSCF, - DWORD dwSize, - FORMATETC* pformatetc, - STGMEDIUM* pstgmed); - - HRESULT (STDMETHODCALLTYPE *OnObjectAvailable)( - IBindStatusCallback* This, - REFIID riid, - IUnknown* punk); - - END_INTERFACE -}; - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IBindStatusCallback_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IBindStatusCallback_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IBindStatusCallback_Release(p) (p)->lpVtbl->Release(p) -/*** IBindStatusCallback methods ***/ -#define IBindStatusCallback_OnStartBinding(p,a,b) (p)->lpVtbl->OnStartBinding(p,a,b) -#define IBindStatusCallback_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a) -#define IBindStatusCallback_OnLowResource(p,a) (p)->lpVtbl->OnLowResource(p,a) -#define IBindStatusCallback_OnProgress(p,a,b,c,d) (p)->lpVtbl->OnProgress(p,a,b,c,d) -#define IBindStatusCallback_OnStopBinding(p,a,b) (p)->lpVtbl->OnStopBinding(p,a,b) -#define IBindStatusCallback_GetBindInfo(p,a,b) (p)->lpVtbl->GetBindInfo(p,a,b) -#define IBindStatusCallback_OnDataAvailable(p,a,b,c,d) (p)->lpVtbl->OnDataAvailable(p,a,b,c,d) -#define IBindStatusCallback_OnObjectAvailable(p,a,b) (p)->lpVtbl->OnObjectAvailable(p,a,b) -#endif - -#endif - -HRESULT CALLBACK IBindStatusCallback_OnStartBinding_Proxy( - IBindStatusCallback* This, - DWORD dwReserved, - IBinding* pib); -void __RPC_STUB IBindStatusCallback_OnStartBinding_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_GetPriority_Proxy( - IBindStatusCallback* This, - LONG* pnPriority); -void __RPC_STUB IBindStatusCallback_GetPriority_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_OnLowResource_Proxy( - IBindStatusCallback* This, - DWORD reserved); -void __RPC_STUB IBindStatusCallback_OnLowResource_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_OnProgress_Proxy( - IBindStatusCallback* This, - ULONG ulProgress, - ULONG ulProgressMax, - ULONG ulStatusCode, - LPCWSTR szStatusText); -void __RPC_STUB IBindStatusCallback_OnProgress_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_OnStopBinding_Proxy( - IBindStatusCallback* This, - HRESULT hresult, - LPCWSTR szError); -void __RPC_STUB IBindStatusCallback_OnStopBinding_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_RemoteGetBindInfo_Proxy( - IBindStatusCallback* This, - DWORD* grfBINDF, - RemBINDINFO* pbindinfo, - RemSTGMEDIUM* pstgmed); -void __RPC_STUB IBindStatusCallback_RemoteGetBindInfo_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_GetBindInfo_Proxy( - IBindStatusCallback* This, - DWORD* grfBINDF, - BINDINFO* pbindinfo); -HRESULT __RPC_STUB IBindStatusCallback_GetBindInfo_Stub( - IBindStatusCallback* This, - DWORD* grfBINDF, - RemBINDINFO* pbindinfo, - RemSTGMEDIUM* pstgmed); -HRESULT CALLBACK IBindStatusCallback_RemoteOnDataAvailable_Proxy( - IBindStatusCallback* This, - DWORD grfBSCF, - DWORD dwSize, - RemFORMATETC* pformatetc, - RemSTGMEDIUM* pstgmed); -void __RPC_STUB IBindStatusCallback_RemoteOnDataAvailable_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindStatusCallback_OnDataAvailable_Proxy( - IBindStatusCallback* This, - DWORD grfBSCF, - DWORD dwSize, - FORMATETC* pformatetc, - STGMEDIUM* pstgmed); -HRESULT __RPC_STUB IBindStatusCallback_OnDataAvailable_Stub( - IBindStatusCallback* This, - DWORD grfBSCF, - DWORD dwSize, - RemFORMATETC* pformatetc, - RemSTGMEDIUM* pstgmed); -HRESULT CALLBACK IBindStatusCallback_OnObjectAvailable_Proxy( - IBindStatusCallback* This, - REFIID riid, - IUnknown* punk); -void __RPC_STUB IBindStatusCallback_OnObjectAvailable_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); - -#endif /* __IBindStatusCallback_INTERFACE_DEFINED__ */ - -#define SID_IBindHost IID_IBindHost -#define SID_SBindHost IID_IBindHost -#ifndef __IBindHost_FWD_DEFINED__ -#define __IBindHost_FWD_DEFINED__ -typedef struct IBindHost IBindHost; -#endif - -typedef IBindHost *LPBINDHOST; - -/********************************************************************** ******* - * IBindHost interface - */ -#ifndef __IBindHost_INTERFACE_DEFINED__ -#define __IBindHost_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IBindHost, 0xfc4801a1, 0x2ba9, 0x11cf, 0xa2,0x29, 0x00,0xaa,0x00,0x3d,0x73,0x52); -#if defined(__cplusplus) && !defined(CINTERFACE) -struct IBindHost : public IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE CreateMoniker( - LPOLESTR szName, - IBindCtx* pBC, - IMoniker** ppmk, - DWORD dwReserved) = 0; - - virtual HRESULT STDMETHODCALLTYPE MonikerBindToStorage( - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - void** ppvObj) = 0; - - virtual HRESULT STDMETHODCALLTYPE MonikerBindToObject( - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - void** ppvObj) = 0; - -}; -#else -typedef struct IBindHostVtbl IBindHostVtbl; -struct IBindHost { - const IBindHostVtbl* lpVtbl; -}; -struct IBindHostVtbl { - BEGIN_INTERFACE - - /*** IUnknown methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInterface)( - IBindHost* This, - REFIID riid, - void** ppvObject); - - ULONG (STDMETHODCALLTYPE *AddRef)( - IBindHost* This); - - ULONG (STDMETHODCALLTYPE *Release)( - IBindHost* This); - - /*** IBindHost methods ***/ - HRESULT (STDMETHODCALLTYPE *CreateMoniker)( - IBindHost* This, - LPOLESTR szName, - IBindCtx* pBC, - IMoniker** ppmk, - DWORD dwReserved); - - HRESULT (STDMETHODCALLTYPE *MonikerBindToStorage)( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - void** ppvObj); - - HRESULT (STDMETHODCALLTYPE *MonikerBindToObject)( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - void** ppvObj); - - END_INTERFACE -}; - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IBindHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IBindHost_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IBindHost_Release(p) (p)->lpVtbl->Release(p) -/*** IBindHost methods ***/ -#define IBindHost_CreateMoniker(p,a,b,c,d) (p)->lpVtbl->CreateMoniker(p,a,b,c,d) -#define IBindHost_MonikerBindToStorage(p,a,b,c,d,e) (p)->lpVtbl->MonikerBindToStorage(p,a,b,c,d,e) -#define IBindHost_MonikerBindToObject(p,a,b,c,d,e) (p)->lpVtbl->MonikerBindToObject(p,a,b,c,d,e) -#endif - -#endif - -HRESULT CALLBACK IBindHost_CreateMoniker_Proxy( - IBindHost* This, - LPOLESTR szName, - IBindCtx* pBC, - IMoniker** ppmk, - DWORD dwReserved); -void __RPC_STUB IBindHost_CreateMoniker_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindHost_RemoteMonikerBindToStorage_Proxy( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - IUnknown** ppvObj); -void __RPC_STUB IBindHost_RemoteMonikerBindToStorage_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindHost_MonikerBindToStorage_Proxy( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - void** ppvObj); -HRESULT __RPC_STUB IBindHost_MonikerBindToStorage_Stub( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - IUnknown** ppvObj); -HRESULT CALLBACK IBindHost_RemoteMonikerBindToObject_Proxy( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - IUnknown** ppvObj); -void __RPC_STUB IBindHost_RemoteMonikerBindToObject_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IBindHost_MonikerBindToObject_Proxy( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - void** ppvObj); -HRESULT __RPC_STUB IBindHost_MonikerBindToObject_Stub( - IBindHost* This, - IMoniker* pMk, - IBindCtx* pBC, - IBindStatusCallback* pBSC, - REFIID riid, - IUnknown** ppvObj); - -#endif /* __IBindHost_INTERFACE_DEFINED__ */ - -#ifndef __IWinInetInfo_FWD_DEFINED__ -#define __IWinInetInfo_FWD_DEFINED__ -typedef struct IWinInetInfo IWinInetInfo; -#endif - -typedef IWinInetInfo *LPWININETINFO; - -/********************************************************************** ******* - * IWinInetInfo interface - */ -#ifndef __IWinInetInfo_INTERFACE_DEFINED__ -#define __IWinInetInfo_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IWinInetInfo, 0x79eac9d6, 0xbafa, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b); -#if defined(__cplusplus) && !defined(CINTERFACE) -struct IWinInetInfo : public IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE QueryOption( - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf) = 0; - -}; -#else -typedef struct IWinInetInfoVtbl IWinInetInfoVtbl; -struct IWinInetInfo { - const IWinInetInfoVtbl* lpVtbl; -}; -struct IWinInetInfoVtbl { - BEGIN_INTERFACE - - /*** IUnknown methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInterface)( - IWinInetInfo* This, - REFIID riid, - void** ppvObject); - - ULONG (STDMETHODCALLTYPE *AddRef)( - IWinInetInfo* This); - - ULONG (STDMETHODCALLTYPE *Release)( - IWinInetInfo* This); - - /*** IWinInetInfo methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryOption)( - IWinInetInfo* This, - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf); - - END_INTERFACE -}; - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IWinInetInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IWinInetInfo_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IWinInetInfo_Release(p) (p)->lpVtbl->Release(p) -/*** IWinInetInfo methods ***/ -#define IWinInetInfo_QueryOption(p,a,b,c) (p)->lpVtbl->QueryOption(p,a,b,c) -#endif - -#endif - -HRESULT CALLBACK IWinInetInfo_RemoteQueryOption_Proxy( - IWinInetInfo* This, - DWORD dwOption, - BYTE* pBuffer, - DWORD* pcbBuf); -void __RPC_STUB IWinInetInfo_RemoteQueryOption_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IWinInetInfo_QueryOption_Proxy( - IWinInetInfo* This, - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf); -HRESULT __RPC_STUB IWinInetInfo_QueryOption_Stub( - IWinInetInfo* This, - DWORD dwOption, - BYTE* pBuffer, - DWORD* pcbBuf); - -#endif /* __IWinInetInfo_INTERFACE_DEFINED__ */ - -#ifndef __IWinInetHttpInfo_FWD_DEFINED__ -#define __IWinInetHttpInfo_FWD_DEFINED__ -typedef struct IWinInetHttpInfo IWinInetHttpInfo; -#endif - -typedef IWinInetHttpInfo *LPWININETHTTPINFO; - -/********************************************************************** ******* - * IWinInetHttpInfo interface - */ -#ifndef __IWinInetHttpInfo_INTERFACE_DEFINED__ -#define __IWinInetHttpInfo_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IWinInetHttpInfo, 0x79eac9d8, 0xbafa, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b); -#if defined(__cplusplus) && !defined(CINTERFACE) -struct IWinInetHttpInfo : public IWinInetInfo -{ - virtual HRESULT STDMETHODCALLTYPE QueryInfo( - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf, - DWORD* pdwFlags, - DWORD* pdwReserved) = 0; - -}; -#else -typedef struct IWinInetHttpInfoVtbl IWinInetHttpInfoVtbl; -struct IWinInetHttpInfo { - const IWinInetHttpInfoVtbl* lpVtbl; -}; -struct IWinInetHttpInfoVtbl { - BEGIN_INTERFACE - - /*** IUnknown methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInterface)( - IWinInetHttpInfo* This, - REFIID riid, - void** ppvObject); - - ULONG (STDMETHODCALLTYPE *AddRef)( - IWinInetHttpInfo* This); - - ULONG (STDMETHODCALLTYPE *Release)( - IWinInetHttpInfo* This); - - /*** IWinInetInfo methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryOption)( - IWinInetHttpInfo* This, - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf); - - /*** IWinInetHttpInfo methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInfo)( - IWinInetHttpInfo* This, - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf, - DWORD* pdwFlags, - DWORD* pdwReserved); - - END_INTERFACE -}; - -#ifdef COBJMACROS -/*** IUnknown methods ***/ -#define IWinInetHttpInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IWinInetHttpInfo_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IWinInetHttpInfo_Release(p) (p)->lpVtbl->Release(p) -/*** IWinInetInfo methods ***/ -#define IWinInetHttpInfo_QueryOption(p,a,b,c) (p)->lpVtbl->QueryOption(p,a,b,c) -/*** IWinInetHttpInfo methods ***/ -#define IWinInetHttpInfo_QueryInfo(p,a,b,c,d,e) (p)->lpVtbl->QueryInfo(p,a,b,c,d,e) -#endif - -#endif - -HRESULT CALLBACK IWinInetHttpInfo_RemoteQueryInfo_Proxy( - IWinInetHttpInfo* This, - DWORD dwOption, - BYTE* pBuffer, - DWORD* pcbBuf, - DWORD* pdwFlags, - DWORD* pdwReserved); -void __RPC_STUB IWinInetHttpInfo_RemoteQueryInfo_Stub( - struct IRpcStubBuffer* This, - struct IRpcChannelBuffer* pRpcChannelBuffer, - PRPC_MESSAGE pRpcMessage, - DWORD* pdwStubPhase); -HRESULT CALLBACK IWinInetHttpInfo_QueryInfo_Proxy( - IWinInetHttpInfo* This, - DWORD dwOption, - LPVOID pBuffer, - DWORD* pcbBuf, - DWORD* pdwFlags, - DWORD* pdwReserved); -HRESULT __RPC_STUB IWinInetHttpInfo_QueryInfo_Stub( - IWinInetHttpInfo* This, - DWORD dwOption, - BYTE* pBuffer, - DWORD* pcbBuf, - DWORD* pdwFlags, - DWORD* pdwReserved); - -#endif /* __IWinInetHttpInfo_INTERFACE_DEFINED__ */ - -#ifndef __IPersistMoniker_FWD_DEFINED__ -#define __IPersistMoniker_FWD_DEFINED__ -typedef struct IPersistMoniker IPersistMoniker; -#endif - -typedef IPersistMoniker *LPPERSISTMONIKER; - -/********************************************************************** ******* - * IPersistMoniker interface - */ -#ifndef __IPersistMoniker_INTERFACE_DEFINED__ -#define __IPersistMoniker_INTERFACE_DEFINED__ - -DEFINE_GUID(IID_IPersistMoniker, 0x79eac9c9, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b); -#if defined(__cplusplus) && !defined(CINTERFACE) -struct IPersistMoniker : public IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE GetClassID( - CLSID* pClassID) = 0; - - virtual HRESULT STDMETHODCALLTYPE IsDirty( - ) = 0; - - virtual HRESULT STDMETHODCALLTYPE Load( - BOOL fFullyAvailable, - IMoniker* pimkName, - LPBC pibc, - DWORD grfMode) = 0; - - virtual HRESULT STDMETHODCALLTYPE Save( - IMoniker* pimkName, - LPBC pbc, - BOOL fRemember) = 0; - - virtual HRESULT STDMETHODCALLTYPE SaveCompleted( - IMoniker* pimkName, - LPBC pibc) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCurMoniker( - IMoniker** ppimkName) = 0; - -}; -#else -typedef struct IPersistMonikerVtbl IPersistMonikerVtbl; -struct IPersistMoniker { - const IPersistMonikerVtbl* lpVtbl; -}; -struct IPersistMonikerVtbl { - BEGIN_INTERFACE - - /*** IUnknown methods ***/ - HRESULT (STDMETHODCALLTYPE *QueryInterface)( - IPersistMoniker* This, - REFIID riid, - void** ppvObject); - - ULONG (STDMETHODCALLTYPE *AddRef)( - IPersistMoniker* This); - - ULONG (STDMETHODCALLTYPE *Release)( - IPersistMoniker* This); - - /*** IPersistMoniker methods ***/ - HRESULT (STDMETHODCALLTYPE *GetClassID)( - IPersistMoniker* This, - CLSID* pClassID); - - HRESULT (STDMETHODCALLTYPE *IsDirty)( - IPersistMoniker* This); - - HRESULT (STDMETHODCALLTYPE *Load)( - IPersistMoniker* This, - BOOL fFullyAvailable, - IMoniker* pimkName, - LPBC pibc, - DWORD grfMode); - - HRESULT (STDMETHODCALLTYPE *Save)( - IPersistMoniker* This, - IMoniker* pimkName, - LPBC pbc, - BOOL fRemember); - - HRESULT (STDMETHODCALLTYPE *SaveCompleted)( - IPersistMoniker* This, - IMoniker* pimkName, - LPBC pibc); - - HRESULT (STDMETHODCALLTYPE *GetCurMoniker)( - IPersistMoniker* This, [truncated at 1000 lines; 7006 more skipped]
19 years, 3 months
1
0
0
0
[gvg] 17715: Sync to Wine-20050830:
by gvg@svn.reactos.com
Sync to Wine-20050830: Alexandre Julliard <julliard(a)winehq.org> - Fixed DllGetClassObject spec entries. Modified: trunk/reactos/lib/shdocvw/shdocvw.spec _____ Modified: trunk/reactos/lib/shdocvw/shdocvw.spec --- trunk/reactos/lib/shdocvw/shdocvw.spec 2005-09-07 08:43:45 UTC (rev 17714) +++ trunk/reactos/lib/shdocvw/shdocvw.spec 2005-09-07 15:09:06 UTC (rev 17715) @@ -102,7 +102,7 @@ 229 stub -noname SafeOpenPromptForPackager @ stdcall -private DllCanUnloadNow() -@ stdcall -private DllGetClassObject(long long ptr) +@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllGetVersion(ptr) @ stdcall -private DllInstall(long wstr) @ stdcall -private DllRegisterServer()
19 years, 3 months
1
0
0
0
[gvg] 17714: Sync to Wine-20050830:
by gvg@svn.reactos.com
Sync to Wine-20050830: Michael Jung <mjung(a)iss.tu-darmstadt.de> - Initialize all members in UnixFolder constructor. Support NULL value pidls in GetDisplayNameOf method. - Implemented IPersist::GetClassID. - Use wine_get_dos_file_name instead of GetFullPathName. - Implemented 'My Documents' folder. - Added stubbed implementation of IPersistPropertyBag interface. Register unixfs as CLSID_FolderShortcut. - Clone pidlLast before free'ing pidl after call to SHBindToParent. - Use FIXME's in stubs instead of TRACE's. Infer pathmode from CLSID in UnixFolderConstructor. Fail in IShellFolder::BindToObject, if folder does not initialize. - Use StringFromGUID2 instead of StringFromCLSID in UNIXFS_is_rooted_at_desktop. Michael Jung <mjung(a)iss.tu-darmstadt.de> Ge van Geldorp <gvg(a)reactos.com> - Prepend Desktop folder path for files/directories stored in the filesystem Desktop folder when GetDisplayNameOf is called with the SHGDN_FORPARSING flags. - Add testcases. Ge van Geldorp <gvg(a)reactos.com> - Fix resource leak on error paths. - Do not load all shell32 icons during initialization, it wastes a lot of memory Alexandre Julliard <julliard(a)winehq.org> - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. - Use ERR instead of DPRINTF in dump_pidl_hex. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Get rid of the _ICOM_THIS macros and call the inline function directly instead. - Removed the broken mmap64 configure check, and moved the _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that need the define include it. - Added missing ntdll imports. Francois Gouget <fgouget(a)codeweavers.com> - Fix ShellExecute("\"foo.doc\"") for Internet Explorer 6. - Update the conformance tests accordingly. - Tweak a trace because it's very confusing to see the path with no escaped quotes in ShellExecuteA() and then with escaped quotes in ShellExecuteExW32() (due to debugstr_w()). - Fix the return value of SHELL_Argify() so it once again returns true if a '%1' or equivalent placeholder was found. This fixes ShellExecuteEx(lpFile="foo.txt", lpClass="txtfile"). - Fix handling of SEE_MASK_CLASSNAME and SEE_MASK_CLASSKEY. They are not disjoint flags. Mike McCormack <mike(a)codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. Jozef Stefanka <jstefanka(a)codeweavers.com> - Fixed browsing to other directories in Word 2003 file open dialog. Double clicking on a folder in the File->Open dialog works now. Steven Edwards <steven_ed4153(a)yahoo.com> - Correct definition of SFGAO_STORAGEANCESTOR. Jason Edmeades <us(a)edmeades.me.uk> - Add the time to the file display dialog modified column. - Handle context menu->refresh, and F5 to initiate a refresh of the file dialog. Modified: trunk/reactos/include/wine/shlguid.h Modified: trunk/reactos/lib/shell32/Makefile.in Modified: trunk/reactos/lib/shell32/autocomplete.c Modified: trunk/reactos/lib/shell32/cpanelfolder.c Modified: trunk/reactos/lib/shell32/debughlp.c Modified: trunk/reactos/lib/shell32/folders.c Modified: trunk/reactos/lib/shell32/iconcache.c Modified: trunk/reactos/lib/shell32/pidl.c Modified: trunk/reactos/lib/shell32/regsvr.c Modified: trunk/reactos/lib/shell32/shell.c Modified: trunk/reactos/lib/shell32/shell32.spec Modified: trunk/reactos/lib/shell32/shell32_main.c Modified: trunk/reactos/lib/shell32/shell32_main.h Modified: trunk/reactos/lib/shell32/shelllink.c Modified: trunk/reactos/lib/shell32/shellole.c Modified: trunk/reactos/lib/shell32/shellreg.c Modified: trunk/reactos/lib/shell32/shfldr_desktop.c Modified: trunk/reactos/lib/shell32/shfldr_fs.c Modified: trunk/reactos/lib/shell32/shfldr_mycomp.c Modified: trunk/reactos/lib/shell32/shlexec.c Modified: trunk/reactos/lib/shell32/shlview.c Modified: trunk/reactos/lib/shell32/shres.rc Modified: trunk/reactos/lib/shell32/shresdef.h Modified: trunk/reactos/lib/shell32/shv_bg_cmenu.c Modified: trunk/reactos/w32api/include/shlguid.h _____ Modified: trunk/reactos/include/wine/shlguid.h --- trunk/reactos/include/wine/shlguid.h 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/include/wine/shlguid.h 2005-09-07 08:43:45 UTC (rev 17714) @@ -46,7 +46,9 @@ DEFINE_GUID(CLSID_ControlPanel, 0x21EC2020, 0x3AEA, 0x1069, 0xA2, 0xDD, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); DEFINE_GUID(CLSID_Printers, 0x2227A280, 0x3AEA, 0x1069, 0xA2, 0xDE, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); DEFINE_GUID(CLSID_MyDocuments, 0x450d8fba, 0xad25, 0x11d0, 0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03); +DEFINE_GUID(CLSID_FolderShortcut, 0x0AFACED1, 0xE828, 0x11D1, 0x91, 0x87, 0xB5, 0x32, 0xF1, 0xE9, 0x57, 0x5D); + DEFINE_GUID(IID_IQueryAssociations, 0xc46ca590, 0x3c3f, 0x11d2, 0xbe, 0xe6, 0x00, 0x00, 0xf8, 0x05, 0xca, 0x57); DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0); _____ Modified: trunk/reactos/lib/shell32/Makefile.in --- trunk/reactos/lib/shell32/Makefile.in 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/Makefile.in 2005-09-07 08:43:45 UTC (rev 17714) @@ -5,7 +5,7 @@ VPATH = @srcdir@ MODULE = shell32.dll IMPORTLIB = libshell32.$(IMPLIBEXT) -IMPORTS = shlwapi comctl32 user32 gdi32 advapi32 kernel32 +IMPORTS = shlwapi comctl32 user32 gdi32 advapi32 kernel32 ntdll DELAYIMPORTS = ole32 EXTRALIBS = -luuid $(LIBUNICODE) @@ -61,6 +61,7 @@ folder.ico \ folder_open.ico \ mycomputer.ico \ + mydocs.ico \ netdrive.ico \ netdrive2.ico \ printer.ico \ _____ Modified: trunk/reactos/lib/shell32/autocomplete.c --- trunk/reactos/lib/shell32/autocomplete.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/autocomplete.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -79,9 +79,12 @@ static const IAutoCompleteVtbl acvt; static const IAutoComplete2Vtbl ac2vt; -#define _IAutoComplete2_Offset ((int)(&(((IAutoCompleteImpl*)0)->lpvtblAutoComplete2))) -#define _ICOM_THIS_From_IAutoComplete2(class, name) class* This = (class*)(((char*)name)-_IAutoComplete2_Offset); +static inline IAutoCompleteImpl *impl_from_IAutoComplete2( IAutoComplete2 *iface ) +{ + return (IAutoCompleteImpl *)((char*)iface - FIELD_OFFSET(IAutoCompleteImpl, lpvtblAutoComplete2)); +} + /* converts This to an interface pointer */ @@ -329,7 +332,7 @@ REFIID riid, LPVOID *ppvObj) { - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj); @@ -342,7 +345,7 @@ static ULONG WINAPI IAutoComplete2_fnAddRef( IAutoComplete2 * iface) { - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl,iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE ("(%p)->(count=%lu)\n", This, This->ref); @@ -355,7 +358,7 @@ static ULONG WINAPI IAutoComplete2_fnRelease( IAutoComplete2 * iface) { - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl,iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE ("(%p)->(count=%lu)\n", This, This->ref); @@ -369,7 +372,7 @@ IAutoComplete2 * iface, BOOL fEnable) { - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE ("(%p)->(%s)\n", This, (fEnable)?"true":"false"); @@ -386,7 +389,7 @@ LPCOLESTR pwzsRegKeyPath, LPCOLESTR pwszQuickComplete) { - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE("(%p)\n", This); @@ -402,7 +405,7 @@ { HRESULT hr = S_OK; - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE("(%p) -> (%p)\n", This, pdwFlag); @@ -420,7 +423,7 @@ { HRESULT hr = S_OK; - _ICOM_THIS_From_IAutoComplete2(IAutoCompleteImpl, iface); + IAutoCompleteImpl *This = impl_from_IAutoComplete2(iface); TRACE("(%p) -> (0x%lx)\n", This, dwFlag); _____ Modified: trunk/reactos/lib/shell32/cpanelfolder.c --- trunk/reactos/lib/shell32/cpanelfolder.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/cpanelfolder.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -76,14 +76,20 @@ static const IShellExecuteHookWVtbl vt_ShellExecuteHookW; static const IShellExecuteHookAVtbl vt_ShellExecuteHookA; -#define _IPersistFolder2_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblPersistFolder2))) -#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset); +static inline ICPanelImpl *impl_from_IPersistFolder2( IPersistFolder2 *iface ) +{ + return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblPersistFolder2)); +} -#define IShellExecuteHookW_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookW))) -#define _ICOM_THIS_From_IShellExecuteHookW(class, name) class* This = (class*)(((char*)name)-IShellExecuteHookW_Offset); +static inline ICPanelImpl *impl_from_IShellExecuteHookW( IShellExecuteHookW *iface ) +{ + return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookW)); +} -#define IShellExecuteHookA_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookA))) -#define _ICOM_THIS_From_IShellExecuteHookA(class, name) class* This = (class*)(((char*)name)-IShellExecuteHookA_Offset); +static inline ICPanelImpl *impl_from_IShellExecuteHookA( IShellExecuteHookA *iface ) +{ + return (ICPanelImpl *)((char*)iface - FIELD_OFFSET(ICPanelImpl, lpVtblShellExecuteHookA)); +} /* @@ -824,7 +830,7 @@ */ static HRESULT WINAPI ICPanel_PersistFolder2_QueryInterface(IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObject) { - _ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IPersistFolder2(iface); TRACE("(%p)\n", This); @@ -836,7 +842,7 @@ */ static ULONG WINAPI ICPanel_PersistFolder2_AddRef(IPersistFolder2 * iface) { - _ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IPersistFolder2(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); @@ -848,7 +854,7 @@ */ static ULONG WINAPI ICPanel_PersistFolder2_Release(IPersistFolder2 * iface) { - _ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IPersistFolder2(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); @@ -860,7 +866,7 @@ */ static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface, CLSID * lpClassId) { - _ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IPersistFolder2(iface); TRACE("(%p)\n", This); @@ -878,7 +884,7 @@ */ static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl) { - _ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IPersistFolder2(iface); TRACE("(%p)->(%p)\n", This, pidl); return E_NOTIMPL; } @@ -888,7 +894,7 @@ */ static HRESULT WINAPI ICPanel_PersistFolder2_GetCurFolder(IPersistFolder2 * iface, LPITEMIDLIST * pidl) { - _ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IPersistFolder2(iface); TRACE("(%p)->(%p)\n", This, pidl); @@ -931,7 +937,7 @@ static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface( IShellExecuteHookW* iface, REFIID riid, void** ppvObject) { - _ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); @@ -940,7 +946,7 @@ static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* iface) { - _ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); @@ -949,7 +955,7 @@ static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnRelease(IShellExecuteHookW* iface) { - _ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); TRACE("(%p)\n", This); @@ -1017,7 +1023,7 @@ static HRESULT WINAPI IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA* iface, REFIID riid, void** ppvObject) { - _ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); @@ -1026,7 +1032,7 @@ static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnAddRef(IShellExecuteHookA* iface) { - _ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); @@ -1035,7 +1041,7 @@ static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnRelease(IShellExecuteHookA* iface) { - _ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface); + ICPanelImpl *This = impl_from_IShellExecuteHookA(iface); TRACE("(%p)\n", This); _____ Modified: trunk/reactos/lib/shell32/debughlp.c --- trunk/reactos/lib/shell32/debughlp.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/debughlp.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -245,7 +245,7 @@ if( i!=(n-1) && (i%max_line) != (max_line-1) ) continue; szAscii[ (i%max_line)+1 ] = 0; - DPRINTF("%-*s %s\n", max_line*3, szHex, szAscii ); + ERR("%-*s %s\n", max_line*3, szHex, szAscii ); } } _____ Modified: trunk/reactos/lib/shell32/folders.c --- trunk/reactos/lib/shell32/folders.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/folders.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -60,12 +60,17 @@ static const IExtractIconWVtbl eivt; static const IPersistFileVtbl pfvt; -#define _IPersistFile_Offset ((int)(&(((IExtractIconWImpl*)0)->lpvtblPersistFile))) -#define _ICOM_THIS_From_IPersistFile(class, name) class* This = (class*)(((char*)name)-_IPersistFile_Offset); +static inline IExtractIconW *impl_from_IPersistFile( IPersistFile *iface ) +{ + return (IExtractIconW *)((char*)iface - FIELD_OFFSET(IExtractIconWImpl, lpvtblPersistFile)); +} -#define _IExtractIconA_Offset ((int)(&(((IExtractIconWImpl*)0)->lpvtblExtractIconA))) -#define _ICOM_THIS_From_IExtractIconA(class, name) class* This = (class*)(((char*)name)-_IExtractIconA_Offset); +static inline IExtractIconW *impl_from_IExtractIconA( IExtractIconA *iface ) +{ + return (IExtractIconW *)((char*)iface - FIELD_OFFSET(IExtractIconWImpl, lpvtblExtractIconA)); +} + /*********************************************************************** *** * IExtractIconW_Constructor */ @@ -261,7 +266,7 @@ if(IsEqualGUID(riid, &CLSID_MyComputer)) *piIndex = -IDI_SHELL_MY_COMPUTER; else if(IsEqualGUID(riid, &CLSID_MyDocuments)) - *piIndex = -IDI_SHELL_FOLDER; + *piIndex = -IDI_SHELL_MY_DOCUMENTS; else if(IsEqualGUID(riid, &CLSID_NetworkPlaces)) *piIndex = -IDI_SHELL_MY_NETWORK_PLACES; else @@ -419,7 +424,7 @@ */ static HRESULT WINAPI IExtractIconA_fnQueryInterface(IExtractIconA * iface, REFIID riid, LPVOID *ppvObj) { - _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); + IExtractIconW *This = impl_from_IExtractIconA(iface); return IExtractIconW_QueryInterface(This, riid, ppvObj); } @@ -429,7 +434,7 @@ */ static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface) { - _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); + IExtractIconW *This = impl_from_IExtractIconA(iface); return IExtractIconW_AddRef(This); } @@ -438,7 +443,7 @@ */ static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface) { - _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); + IExtractIconW *This = impl_from_IExtractIconA(iface); return IExtractIconW_AddRef(This); } @@ -457,7 +462,7 @@ { HRESULT ret; LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR)); - _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); + IExtractIconW *This = impl_from_IExtractIconA(iface); TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); @@ -476,7 +481,7 @@ HRESULT ret; INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0); LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - _ICOM_THIS_From_IExtractIconA(IExtractIconW, iface); + IExtractIconW *This = impl_from_IExtractIconA(iface); TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); @@ -503,7 +508,7 @@ REFIID iid, LPVOID *ppvObj) { - _ICOM_THIS_From_IPersistFile(IExtractIconW, iface); + IExtractIconW *This = impl_from_IPersistFile(iface); return IExtractIconW_QueryInterface(This, iid, ppvObj); } @@ -514,7 +519,7 @@ static ULONG WINAPI IEIPersistFile_fnAddRef( IPersistFile *iface) { - _ICOM_THIS_From_IPersistFile(IExtractIconW, iface); + IExtractIconW *This = impl_from_IPersistFile(iface); return IExtractIconW_AddRef(This); } @@ -525,7 +530,7 @@ static ULONG WINAPI IEIPersistFile_fnRelease( IPersistFile *iface) { - _ICOM_THIS_From_IPersistFile(IExtractIconW, iface); + IExtractIconW *This = impl_from_IPersistFile(iface); return IExtractIconW_Release(This); } @@ -552,7 +557,7 @@ */ static HRESULT WINAPI IEIPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode) { - _ICOM_THIS_From_IPersistFile(IExtractIconW, iface); + IExtractIconW *This = impl_from_IPersistFile(iface); FIXME("%p\n", This); return E_NOTIMPL; _____ Modified: trunk/reactos/lib/shell32/iconcache.c --- trunk/reactos/lib/shell32/iconcache.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/iconcache.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -407,24 +407,27 @@ return(FALSE); } - ShellSmallIconList = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,0x20); - ShellBigIconList = ImageList_Create(32,32,ILC_COLOR32|ILC_MASK,0,0x20); + ShellSmallIconList = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,0x20); + ShellBigIconList = ImageList_Create(32,32,ILC_COLOR32|ILC_MASK,0,0x20); - ImageList_SetBkColor(ShellSmallIconList, CLR_NONE); - ImageList_SetBkColor(ShellBigIconList, CLR_NONE); + ImageList_SetBkColor(ShellSmallIconList, CLR_NONE); + ImageList_SetBkColor(ShellBigIconList, CLR_NONE); - for (index=1; index<39; index++) + /* + * Wine will extract and cache all shell32 icons here. That's because + * they are unable to extract resources from their built-in DLLs. + * We don't need that, but we still want to make sure that the very + * first icon in the image lists is icon 1 from shell32.dll, since + * that's the default icon. + */ + index = 1; + hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_small, cy_small, LR_SHARED); + hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_large, cy_large, LR_SHARED); + + if(hSm) { - hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_small, cy_small, LR_SHARED); - hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_large, cy_large, LR_SHARED); - - if(!hSm) - { - hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(1), IMAGE_ICON, cx_small, cy_small, LR_SHARED); - hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(1), IMAGE_ICON, cx_large, cy_large, LR_SHARED); - } - SIC_IconAppend (swShell32Name, index - 1, hSm, hLg, 0); - SIC_IconAppend (swShell32Name, -index, hSm, hLg, 0); + SIC_IconAppend (swShell32Name, index - 1, hSm, hLg, 0); + SIC_IconAppend (swShell32Name, -index, hSm, hLg, 0); } TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList); _____ Modified: trunk/reactos/lib/shell32/pidl.c --- trunk/reactos/lib/shell32/pidl.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/pidl.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -1210,87 +1210,6 @@ } /*********************************************************************** ** - * SHELL_GetPathFromIDListA - */ -HRESULT SHELL_GetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath, UINT uOutSize) -{ - HRESULT hr = S_OK; - - pszPath[0]=0; - - /* One case is a PIDL rooted at desktop level */ - if (_ILIsDesktop(pidl) || _ILIsValue(pidl) || _ILIsFolder(pidl)) - { - hr = SHGetSpecialFolderPathA(0, pszPath, CSIDL_DESKTOP, FALSE); - - if (SUCCEEDED(hr)) - PathAddBackslashA(pszPath); - } - /* The only other valid case is an item ID list beginning at "My Computer" */ - else if (_ILIsMyComputer(pidl)) - pidl = ILGetNext(pidl); - - if (SUCCEEDED(hr)) - { - LPSTR txt; - - while(pidl && pidl->mkid.cb) - { - if (_ILIsSpecialFolder(pidl)) - { - hr = E_INVALIDARG; - break; - } - - txt = _ILGetTextPointer(pidl); - if (!txt) - { - hr = E_INVALIDARG; - break; - } - - if (lstrlenA(txt) > pidl->mkid.cb) - ERR("pidl %p is borked\n",pidl); - - /* make sure there's enough space for the next segment */ - if ((lstrlenA(txt) + lstrlenA(pszPath)) > uOutSize) - { - hr = E_INVALIDARG; - break; - } - lstrcatA( pszPath, txt ); - - pidl = ILGetNext(pidl); - if (!pidl) - { - hr = E_INVALIDARG; - break; - } - - /* Are we at the end and successfully converted the complete PIDL? */ - if (!pidl->mkid.cb) - break; - - if ((lstrlenA(pszPath) + 1) > uOutSize) - { - hr = E_INVALIDARG; - break; - } - if (!PathAddBackslashA(pszPath)) - { - hr = E_INVALIDARG; - break; - } - } - } - else - hr = E_INVALIDARG; - - TRACE_(shell)("-- %s, 0x%08lx\n", pszPath, hr); - return hr; -} - -/********************************************************************** *** * SHGetPathFromIDListA [SHELL32.@][NT 4.0: SHELL32.220] * * PARAMETERS @@ -1307,108 +1226,26 @@ */ BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath) { - HRESULT hr; + WCHAR wszPath[MAX_PATH]; + BOOL bSuccess; - TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath); - pdump(pidl); + bSuccess = SHGetPathFromIDListW(pidl, wszPath); + if (bSuccess) + WideCharToMultiByte(CP_ACP, 0, wszPath, -1, pszPath, MAX_PATH, NULL, NULL); - if (!pidl) - return FALSE; - - hr = SHELL_GetPathFromIDListA(pidl, pszPath, MAX_PATH); - - return SUCCEEDED(hr); + return bSuccess; } /*********************************************************************** ** - * SHELL_GetPathFromIDListW - */ -HRESULT SHELL_GetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath, UINT uOutSize) -{ - HRESULT hr = S_OK; - UINT len; - - pszPath[0]=0; - - /* One case is a PIDL rooted at desktop level */ - if (_ILIsDesktop(pidl) ||_ILIsValue(pidl) || _ILIsFolder(pidl)) - { - hr = SHGetSpecialFolderPathW(0, pszPath, CSIDL_DESKTOP, FALSE); - - if (SUCCEEDED(hr)) - PathAddBackslashW(pszPath); - } - /* The only other valid case is an item ID list beginning at "My Computer" */ - else if (_ILIsMyComputer(pidl)) - pidl = ILGetNext(pidl); - - if (SUCCEEDED(hr)) - { - LPSTR txt; - - while(pidl && pidl->mkid.cb) - { - if (_ILIsSpecialFolder(pidl)) - { - hr = E_INVALIDARG; - break; - } - - txt = _ILGetTextPointer(pidl); - if (!txt) - { - hr = E_INVALIDARG; - break; - } - - if (lstrlenA(txt) > pidl->mkid.cb) - ERR("pidl %p is borked\n",pidl); - len = MultiByteToWideChar(CP_ACP, 0, txt, -1, NULL, 0); - if ( (lstrlenW(pszPath) + len) > uOutSize ) - { - hr = E_INVALIDARG; - break; - } - - MultiByteToWideChar(CP_ACP, 0, txt, -1, - &pszPath[lstrlenW(pszPath)], len); - - pidl = ILGetNext(pidl); - if (!pidl) - { - hr = E_INVALIDARG; - break; - } - - /* Are we at the end and successfully converted the complete PIDL? */ - if (!pidl->mkid.cb) - break; - - if ((lstrlenW(pszPath) + 1) > uOutSize ) - { - hr = E_INVALIDARG; - break; - } - if (!PathAddBackslashW(pszPath)) - { - hr = E_INVALIDARG; - break; - } - } - } - else - hr = E_INVALIDARG; - - TRACE_(shell)("-- %s, 0x%08lx\n", debugstr_w(pszPath), hr); - return hr; -} - -/********************************************************************** *** * SHGetPathFromIDListW [SHELL32.@] */ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath) { HRESULT hr; + LPCITEMIDLIST pidlLast; + LPSHELLFOLDER psfFolder; + DWORD dwAttributes; + STRRET strret; TRACE_(shell)("(pidl=%p,%p)\n", pidl, debugstr_w(pszPath)); pdump(pidl); @@ -1416,8 +1253,22 @@ if (!pidl) return FALSE; - hr = SHELL_GetPathFromIDListW(pidl, pszPath, MAX_PATH); + hr = SHBindToParent(pidl, &IID_IShellFolder, (VOID**)&psfFolder, &pidlLast); + if (FAILED(hr)) return FALSE; + dwAttributes = SFGAO_FILESYSTEM; + hr = IShellFolder_GetAttributesOf(psfFolder, 1, &pidlLast, &dwAttributes); + if (FAILED(hr) || !(dwAttributes & SFGAO_FILESYSTEM)) { + IShellFolder_Release(psfFolder); + return FALSE; + } + + hr = IShellFolder_GetDisplayNameOf(psfFolder, pidlLast, SHGDN_FORPARSING, &strret); + IShellFolder_Release(psfFolder); + if (FAILED(hr)) return FALSE; + + hr = StrRetToBufW(&strret, pidlLast, pszPath, MAX_PATH); + TRACE_(shell)("-- %s, 0x%08lx\n",debugstr_w(pszPath), hr); return SUCCEEDED(hr); } @@ -2135,7 +1986,14 @@ { FileTimeToLocalFileTime(&ft, &lft); FileTimeToSystemTime (&lft, &time); + ret = GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&time, NULL, pOut, uOutSize); + if (ret) + { + /* Append space + time without seconds */ + pOut[ret-1] = ' '; + GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &time, NULL, &pOut[ret], uOutSize - ret); + } } else { _____ Modified: trunk/reactos/lib/shell32/regsvr.c --- trunk/reactos/lib/shell32/regsvr.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/regsvr.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -313,7 +313,7 @@ &shellfolder_key, NULL); if (res != ERROR_SUCCESS) goto error_close_clsid_key; if (list->flags & SHELLFOLDER_WANTSFORPARSING) - res = RegSetValueExA(shellfolder_key, wfparsing_valuename, 0, REG_SZ, "", 1); + res = RegSetValueExA(shellfolder_key, wfparsing_valuename, 0, REG_SZ, (LPBYTE)"", 1); if (list->flags & SHELLFOLDER_ATTRIBUTES) res = RegSetValueExA(shellfolder_key, attributes_valuename, 0, REG_DWORD, (LPBYTE)&list->dwAttributes, sizeof(DWORD)); @@ -605,6 +605,24 @@ "shell32.dll", "Apartment", }, + { &CLSID_FolderShortcut, + "Foldershortcut", + NULL, + "shell32.dll", + "Apartment", + SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_CALLFORATTRIBUTES, + SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_LINK, + SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR + }, + { &CLSID_MyDocuments, + "My Documents", + NULL, + "shell32.dll", + "Apartment", + SHELLFOLDER_WANTSFORPARSING|SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_CALLFORAT TRIBUTES, + SFGAO_FILESYSANCESTOR|SFGAO_FOLDER|SFGAO_HASSUBFOLDER, + SFGAO_FILESYSTEM + }, { NULL } /* list terminator */ }; @@ -621,15 +639,21 @@ */ static const WCHAR wszDesktop[] = { 'D','e','s','k','t','o','p',0 }; static const WCHAR wszSlash[] = { '/', 0 }; +static const WCHAR wszMyDocuments[] = { 'M','y',' ','D','o','c','u','m','e','n','t','s', 0 }; static struct regsvr_namespace const namespace_extensions_list[] = { + { + &CLSID_MyDocuments, + wszDesktop, + wszMyDocuments + }, { NULL } }; /*********************************************************************** * DllRegisterServer (SHELL32.@) */ -HRESULT WINAPI SHELL32_DllRegisterServer() +HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; @@ -648,7 +672,7 @@ /*********************************************************************** * DllUnregisterServer (SHELL32.@) */ -HRESULT WINAPI SHELL32_DllUnregisterServer() +HRESULT WINAPI DllUnregisterServer(void) { HRESULT hr; _____ Modified: trunk/reactos/lib/shell32/shell.c --- trunk/reactos/lib/shell32/shell.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/shell.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -574,7 +574,7 @@ { fix_win16_hkey( &hkey ); if (count) *count &= 0xffff; - return RegQueryValueA( hkey, name, data, count ); + return RegQueryValueA( hkey, name, data, (LONG*) count ); } /*********************************************************************** ******* _____ Modified: trunk/reactos/lib/shell32/shell32.spec --- trunk/reactos/lib/shell32/shell32.spec 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/shell32.spec 2005-09-07 08:43:45 UTC (rev 17714) @@ -260,12 +260,12 @@ @ stdcall Control_RunDLLA(ptr ptr str long) @ stub Control_RunDLLAsUserW @ stdcall Control_RunDLLW(ptr ptr wstr long) -@ stdcall -private DllCanUnloadNow() SHELL32_DllCanUnloadNow -@ stdcall -private DllGetClassObject(long long ptr) SHELL32_DllGetClassObject -@ stdcall DllGetVersion(ptr)SHELL32_DllGetVersion -@ stdcall DllInstall(long wstr)SHELL32_DllInstall -@ stdcall -private DllRegisterServer() SHELL32_DllRegisterServer -@ stdcall -private DllUnregisterServer() SHELL32_DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllGetVersion(ptr) +@ stdcall -private DllInstall(long wstr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() @ stdcall DoEnvironmentSubstA(str str) @ stdcall DoEnvironmentSubstW(wstr wstr) @ stdcall DragAcceptFiles(long long) _____ Modified: trunk/reactos/lib/shell32/shell32_main.c --- trunk/reactos/lib/shell32/shell32_main.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/shell32_main.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -386,6 +386,8 @@ { hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&pidlLast ); + if (SUCCEEDED(hr)) + pidlLast = ILClone(pidlLast); ILFree(pidl); } else @@ -1058,7 +1060,7 @@ * Returns version of a shell32.dll from IE4.01 SP1. */ -HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi) +HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi) { /* FIXME: shouldn't these values come from the version resource? */ if (pdvi->cbSize == sizeof(DLLVERSIONINFO) || @@ -1144,7 +1146,7 @@ * LPCWSTR pszCmdLine - command line (unused by shell32?) */ -HRESULT WINAPI SHELL32_DllInstall(BOOL bInstall, LPCWSTR cmdline) +HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline) { FIXME("%s %s: stub\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline)); return S_OK; /* indicate success */ @@ -1153,7 +1155,7 @@ /*********************************************************************** * DllCanUnloadNow (SHELL32.@) */ -HRESULT WINAPI SHELL32_DllCanUnloadNow(void) +HRESULT WINAPI DllCanUnloadNow(void) { FIXME("stub\n"); return S_FALSE; _____ Modified: trunk/reactos/lib/shell32/shell32_main.h --- trunk/reactos/lib/shell32/shell32_main.h 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/shell32_main.h 2005-09-07 08:43:45 UTC (rev 17714) @@ -94,6 +94,8 @@ HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI UnixFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI UnixDosFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv); +HRESULT WINAPI FolderShortcut_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv); +HRESULT WINAPI MyDocuments_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv); extern HRESULT CPanel_GetIconLocationW(LPITEMIDLIST, LPWSTR, UINT, int*); HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); @@ -103,11 +105,6 @@ LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST); LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST); -/* FIXME: rename the functions when the shell32.dll has it's own exports namespace */ -HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv); -HRESULT WINAPI SHELL32_DllCanUnloadNow(void); - - /* menu merging */ #define MM_ADDSEPARATOR 0x00000001L #define MM_SUBMENUSHAVEIDS 0x00000002L _____ Modified: trunk/reactos/lib/shell32/shelllink.c --- trunk/reactos/lib/shell32/shelllink.c 2005-09-07 07:53:31 UTC (rev 17713) +++ trunk/reactos/lib/shell32/shelllink.c 2005-09-07 08:43:45 UTC (rev 17714) @@ -161,43 +161,31 @@ { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblw)); } -#define _ICOM_THIS_From_IShellLinkW(class, iface) \ - class* This = impl_from_IShellLinkW( iface ) static inline IShellLinkImpl *impl_from_IPersistFile( IPersistFile *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPersistFile)); } -#define _ICOM_THIS_From_IPersistFile(class, iface) \ - class* This = impl_from_IPersistFile( iface ) static inline IShellLinkImpl *impl_from_IPersistStream( IPersistStream *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblPersistStream)); } -#define _ICOM_THIS_From_IPersistStream(class, iface) \ - class* This = impl_from_IPersistStream( iface ) static inline IShellLinkImpl *impl_from_IShellLinkDataList( IShellLinkDataList *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblShellLinkDataList)); } -#define _ICOM_THIS_From_IShellLinkDataList(class, iface) \ - class* This = impl_from_IShellLinkDataList( iface ) static inline IShellLinkImpl *impl_from_IShellExtInit( IShellExtInit *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblShellExtInit)); } -#define _ICOM_THIS_From_IShellExtInit(class, iface) \ - class* This = impl_from_IShellExtInit( iface ) static inline IShellLinkImpl *impl_from_IContextMenu( IContextMenu *iface ) { return (IShellLinkImpl *)((char*)iface - FIELD_OFFSET(IShellLinkImpl, lpvtblContextMenu)); } -#define _ICOM_THIS_From_IContextMenu(class, iface) \ - class* This = impl_from_IContextMenu( iface ) static HRESULT ShellLink_UpdatePath(LPWSTR sPathRel, LPCWSTR path, LPCWSTR sWorkDir, LPWSTR* psPath); @@ -316,7 +304,7 @@ REFIID riid, LPVOID *ppvObj) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); return ShellLink_QueryInterface( This, riid, ppvObj ); } @@ -325,7 +313,7 @@ */ static ULONG WINAPI IPersistFile_fnAddRef(IPersistFile* iface) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); return ShellLink_AddRef( This ); } @@ -334,19 +322,19 @@ */ static ULONG WINAPI IPersistFile_fnRelease(IPersistFile* iface) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); return IShellLinkA_Release((IShellLinkA*)This); } static HRESULT WINAPI IPersistFile_fnGetClassID(IPersistFile* iface, CLSID *pClassID) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); return ShellLink_GetClassID( This, pClassID ); } static HRESULT WINAPI IPersistFile_fnIsDirty(IPersistFile* iface) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); TRACE("(%p)\n",This); @@ -358,7 +346,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFileName, DWORD dwMode) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); IPersistStream *StreamThis = (IPersistStream *)&This->lpvtblPersistStream; HRESULT r; IStream *stm; @@ -414,7 +402,7 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); IPersistStream *StreamThis = (IPersistStream *)&This->lpvtblPersistStream; HRESULT r; IStream *stm; @@ -448,14 +436,14 @@ static HRESULT WINAPI IPersistFile_fnSaveCompleted(IPersistFile* iface, LPCOLESTR pszFileName) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); FIXME("(%p)->(%s)\n",This,debugstr_w(pszFileName)); return NOERROR; } static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *ppszFileName) { - _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistFile(iface); FIXME("(%p)\n",This); return NOERROR; } @@ -481,7 +469,7 @@ REFIID riid, VOID** ppvObj) { - _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistStream(iface); return ShellLink_QueryInterface( This, riid, ppvObj ); } @@ -491,7 +479,7 @@ static ULONG WINAPI IPersistStream_fnRelease( IPersistStream* iface) { - _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); + IShellLinkImpl *This = impl_from_IPersistStream(iface); return IShellLinkA_Release((IShellLinkA*)This); } @@ -501,7 +489,7 @@ static ULONG WINAPI IPersistStream_fnAddRef( IPersistStream* iface) { - _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); [truncated at 1000 lines; 1432 more skipped]
19 years, 3 months
1
0
0
0
[gdalsnes] 17713: make co_WinPosShowWindow take pWnd, not hWnd
by gdalsnes@svn.reactos.com
make co_WinPosShowWindow take pWnd, not hWnd add co_ to some funcs Modified: trunk/reactos/subsys/win32k/include/userfuncs.h Modified: trunk/reactos/subsys/win32k/include/winpos.h Modified: trunk/reactos/subsys/win32k/ntuser/scrollbar.c Modified: trunk/reactos/subsys/win32k/ntuser/window.c Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c _____ Modified: trunk/reactos/subsys/win32k/include/userfuncs.h --- trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-07 00:02:39 UTC (rev 17712) +++ trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-07 07:53:31 UTC (rev 17713) @@ -93,8 +93,6 @@ HWND FASTCALL UserGetShellWindow(); -HWND FASTCALL UserSetParent(HWND hWndChild, HWND hWndNewParent); - HWND FASTCALL UserGetWindow(HWND hWnd, UINT Relationship); HDC FASTCALL _____ Modified: trunk/reactos/subsys/win32k/include/winpos.h --- trunk/reactos/subsys/win32k/include/winpos.h 2005-09-07 00:02:39 UTC (rev 17712) +++ trunk/reactos/subsys/win32k/include/winpos.h 2005-09-07 07:53:31 UTC (rev 17713) @@ -29,7 +29,7 @@ co_WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags); BOOLEAN FASTCALL -co_WinPosShowWindow(HWND Wnd, INT Cmd); +co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd); USHORT FASTCALL co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint, PWINDOW_OBJECT* Window); _____ Modified: trunk/reactos/subsys/win32k/ntuser/scrollbar.c --- trunk/reactos/subsys/win32k/ntuser/scrollbar.c 2005-09-07 00:02:39 UTC (rev 17712) +++ trunk/reactos/subsys/win32k/ntuser/scrollbar.c 2005-09-07 07:53:31 UTC (rev 17713) @@ -853,7 +853,7 @@ { IntUpdateSBInfo(Window, SB_CTL); - co_WinPosShowWindow(Window->hSelf, bShow ? SW_SHOW : SW_HIDE); + co_WinPosShowWindow(Window, bShow ? SW_SHOW : SW_HIDE); return( TRUE); } _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-07 00:02:39 UTC (rev 17712) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-07 07:53:31 UTC (rev 17713) @@ -913,7 +913,7 @@ } PWINDOW_OBJECT FASTCALL -IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) +co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) { PWINDOW_OBJECT WndOldParent, Sibling, InsertAfter; HWND hWnd, hWndNewParent, hWndOldParent; @@ -930,7 +930,7 @@ * Windows hides the window first, then shows it again * including the WM_SHOWWINDOW messages and all */ - WasVisible = co_WinPosShowWindow(hWnd, SW_HIDE); + WasVisible = co_WinPosShowWindow(Wnd, SW_HIDE); /* Validate that window and parent still exist */ if (!IntIsWindow(hWnd) || !IntIsWindow(hWndNewParent)) @@ -1984,14 +1984,16 @@ { co_UserShowScrollBar(Window, SB_HORZ, TRUE); } - UserDereferenceWindowObjectCo(Window); if (dwStyle & WS_VISIBLE) { DPRINT("IntCreateWindow(): About to show window\n"); - co_WinPosShowWindow(Window->hSelf, dwShowMode); + co_WinPosShowWindow(Window, dwShowMode); } + //faxme: temp hack + UserDereferenceWindowObjectCo(Window); + DPRINT("IntCreateWindow(): = %X\n", Handle); DPRINT("WindowObject->SystemMenu = 0x%x\n", Window->SystemMenu); return((HWND)Handle); @@ -2098,6 +2100,8 @@ { BOOLEAN isChild; + ASSERT_REFS(Window); + if (Window == NULL) { return FALSE; @@ -2113,7 +2117,7 @@ /* Look whether the focus is within the tree of windows we will * be destroying. */ - if (!co_WinPosShowWindow(Window->hSelf, SW_HIDE)) + if (!co_WinPosShowWindow(Window, SW_HIDE)) { if (UserGetActiveWindow() == Window->hSelf) { @@ -2862,7 +2866,7 @@ HWND FASTCALL -UserSetParent(HWND hWndChild, HWND hWndNewParent) +co_UserSetParent(HWND hWndChild, HWND hWndNewParent) { PWINDOW_OBJECT Wnd = NULL, WndParent = NULL, WndOldParent; HWND hWndOldParent = NULL; @@ -2903,7 +2907,7 @@ return( NULL); } - WndOldParent = IntSetParent(Wnd, WndParent); + WndOldParent = co_IntSetParent(Wnd, WndParent); if (WndOldParent) { @@ -2944,7 +2948,7 @@ DPRINT("Enter NtUserSetParent\n"); UserEnterExclusive(); - RETURN( UserSetParent(hWndChild, hWndNewParent)); + RETURN( co_UserSetParent(hWndChild, hWndNewParent)); CLEANUP: DPRINT("Leave NtUserSetParent, ret=%i\n",_ret_); @@ -3408,7 +3412,7 @@ LONG FASTCALL -UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) +co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) { PWINDOW_OBJECT Window, Parent; PWINSTATION_OBJECT WindowStation; @@ -3499,7 +3503,7 @@ if (Parent && (Parent->hSelf == IntGetDesktopWindow())) OldValue = (LONG) IntSetOwner(Window->hSelf, (HWND) NewValue); else - OldValue = (LONG) UserSetParent(Window->hSelf, (HWND) NewValue); + OldValue = (LONG) co_UserSetParent(Window->hSelf, (HWND) NewValue); if(Parent) IntReleaseWindowObject(Parent); break; @@ -3548,7 +3552,7 @@ DPRINT("Enter NtUserSetWindowLong\n"); UserEnterExclusive(); - RETURN( UserSetWindowLong(hWnd, Index, NewValue, Ansi)); + RETURN( co_UserSetWindowLong(hWnd, Index, NewValue, Ansi)); CLEANUP: DPRINT("Leave NtUserSetWindowLong, ret=%i\n",_ret_); @@ -3580,7 +3584,7 @@ case GWL_ID: case GWL_HINSTANCE: case GWL_HWNDPARENT: - RETURN( UserSetWindowLong(hWnd, Index, (UINT)NewValue, TRUE)); + RETURN( co_UserSetWindowLong(hWnd, Index, (UINT)NewValue, TRUE)); default: if (Index < 0) { @@ -4064,7 +4068,7 @@ } /* FIXME - change window status */ - co_WinPosShowWindow(Window->hSelf, Safepl.showCmd); + co_WinPosShowWindow(Window, Safepl.showCmd); if (Window->InternalPos == NULL) Window->InternalPos = ExAllocatePoolWithTag(PagedPool, sizeof(INTERNALPOS), TAG_WININTLIST); @@ -4245,16 +4249,26 @@ * @implemented */ BOOL STDCALL -NtUserShowWindow(HWND hWnd, - LONG nCmdShow) +NtUserShowWindow(HWND hWnd, LONG nCmdShow) { + PWINDOW_OBJECT Window; + BOOL ret; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserShowWindow\n"); UserEnterExclusive(); + + if (!(Window = UserGetWindowObject(hWnd))) + { + RETURN(FALSE); + } + + UserReferenceWindowObjectCo(Window); + ret = co_WinPosShowWindow(Window, nCmdShow); + UserReferenceWindowObjectCo(Window); + + RETURN(ret); - RETURN( co_WinPosShowWindow(hWnd, nCmdShow)); - CLEANUP: DPRINT("Leave NtUserShowWindow, ret=%i\n",_ret_); UserLeave(); _____ Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c --- trunk/reactos/subsys/win32k/ntuser/winpos.c 2005-09-07 00:02:39 UTC (rev 17712) +++ trunk/reactos/subsys/win32k/ntuser/winpos.c 2005-09-07 07:53:31 UTC (rev 17713) @@ -1236,25 +1236,15 @@ } BOOLEAN FASTCALL -co_WinPosShowWindow(HWND Wnd, INT Cmd) +co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) { BOOLEAN WasVisible; - PWINDOW_OBJECT Window; - NTSTATUS Status; UINT Swp = 0; RECT NewPos; BOOLEAN ShowFlag; // HRGN VisibleRgn; - Status = - ObmReferenceObjectByHandle(gHandleTable, - Wnd, - otWindow, - (PVOID*)&Window); - if (!NT_SUCCESS(Status)) - { - return(FALSE); - } + ASSERT_REFS(Window); WasVisible = (Window->Style & WS_VISIBLE) != 0; @@ -1264,7 +1254,6 @@ { if (!WasVisible) { - ObmDereferenceObject(Window); return(FALSE); } Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE; @@ -1336,14 +1325,14 @@ ShowFlag = (Cmd != SW_HIDE); if (ShowFlag != WasVisible) { - co_IntSendMessage(Wnd, WM_SHOWWINDOW, ShowFlag, 0); + co_IntSendMessage(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0); /* * FIXME: Need to check the window wasn't destroyed during the * window procedure. */ if (!(Window->Parent)) { - co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Wnd); + co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->hSelf); } } @@ -1371,15 +1360,15 @@ } /* Revert focus to parent */ - if (Wnd == IntGetThreadFocusWindow() || - IntIsChildWindow(Wnd, IntGetThreadFocusWindow())) + if (Window->hSelf == IntGetThreadFocusWindow() || + IntIsChildWindow(Window->hSelf, IntGetThreadFocusWindow())) { UserSetFocus(Window->Parent->hSelf); } if (!(Window->Parent)) { - co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Wnd); + co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->hSelf); } } @@ -1400,12 +1389,12 @@ wParam = SIZE_MINIMIZED; } - co_IntSendMessage(Wnd, WM_SIZE, wParam, + co_IntSendMessage(Window->hSelf, WM_SIZE, wParam, MAKELONG(Window->ClientRect.right - Window->ClientRect.left, Window->ClientRect.bottom - Window->ClientRect.top)); - co_IntSendMessage(Wnd, WM_MOVE, 0, + co_IntSendMessage(Window->hSelf, WM_MOVE, 0, MAKELONG(Window->ClientRect.left, Window->ClientRect.top)); IntEngWindowChanged(Window, WOC_RGN_CLIENT); @@ -1418,8 +1407,6 @@ WinPosChangeActiveWindow(Wnd, FALSE); } */ - - ObmDereferenceObject(Window); return(WasVisible); } @@ -1431,6 +1418,8 @@ PWINDOW_OBJECT Current; HWND *List, *phWnd; + ASSERT_REFS(ScopeWin); + if ((List = IntWinListChildren(ScopeWin))) { for (phWnd = List; *phWnd; ++phWnd)
19 years, 3 months
1
0
0
0
[gdalsnes] 17712: scrollbar:
by gdalsnes@svn.reactos.com
scrollbar: simplify refcounting fix a bug in NtUserGetSystemMenu, accessing nullpointer use pointers internally, not handles Modified: trunk/reactos/subsys/win32k/include/userfuncs.h Modified: trunk/reactos/subsys/win32k/ntuser/scrollbar.c Modified: trunk/reactos/subsys/win32k/ntuser/window.c _____ Modified: trunk/reactos/subsys/win32k/include/userfuncs.h --- trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 23:29:54 UTC (rev 17711) +++ trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-07 00:02:39 UTC (rev 17712) @@ -125,7 +125,7 @@ /*************** SCROLLBAR.C ***************/ DWORD FASTCALL -co_UserShowScrollBar(HWND hWnd, int wBar, DWORD bShow); +co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow); #endif /* _WIN32K_USERFUNCS_H */ _____ Modified: trunk/reactos/subsys/win32k/ntuser/scrollbar.c --- trunk/reactos/subsys/win32k/ntuser/scrollbar.c 2005-09-06 23:29:54 UTC (rev 17711) +++ trunk/reactos/subsys/win32k/ntuser/scrollbar.c 2005-09-07 00:02:39 UTC (rev 17712) @@ -95,7 +95,6 @@ break; default: - IntReleaseWindowObject(Window); return FALSE; } @@ -199,6 +198,8 @@ UINT Mask; LPSCROLLINFO psi; + ASSERT_REFS(Window); + if(!SBID_IS_VALID(nBar)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); @@ -259,6 +260,8 @@ /* UINT new_flags;*/ BOOL bChangeParams = FALSE; /* don't show/hide scrollbar if params don't change */ + ASSERT_REFS(Window); + if(!SBID_IS_VALID(nBar)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); @@ -365,7 +368,7 @@ } else if ((nBar != SB_CTL) && bChangeParams) { - co_UserShowScrollBar(Window->hSelf, nBar, FALSE); + co_UserShowScrollBar(Window, nBar, FALSE); return Info->nPos; } } @@ -374,7 +377,7 @@ /* new_flags = 0;*/ if ((nBar != SB_CTL) && bChangeParams) { - co_UserShowScrollBar(Window->hSelf, nBar, TRUE); + co_UserShowScrollBar(Window, nBar, TRUE); } } @@ -408,6 +411,8 @@ PSCROLLBARINFO sbi; LPSCROLLINFO psi; + ASSERT_REFS(Window); + Bar = SBOBJ_TO_SBID(idObject); if(!SBID_IS_VALID(Bar)) @@ -442,6 +447,8 @@ ULONG Size, s; INT i; + ASSERT_REFS(Window); + if(Window->Scroll) { /* no need to create it anymore */ @@ -548,18 +555,17 @@ if(!NT_SUCCESS(Status) || (sbi.cbSize != sizeof(SCROLLBARINFO))) { SetLastNtError(Status); - RETURN( FALSE); + RETURN(FALSE); } - Window = IntGetWindowObject(hWnd); - - if(!Window) + if(!(Window = UserGetWindowObject(hWnd))) { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); - RETURN( FALSE); + RETURN(FALSE); } + UserReferenceWindowObjectCo(Window); Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi); + UserDereferenceWindowObjectCo(Window); Status = MmCopyToCaller(psbi, &sbi, sizeof(SCROLLBARINFO)); if(!NT_SUCCESS(Status)) @@ -567,7 +573,7 @@ SetLastNtError(Status); Ret = FALSE; } - IntReleaseWindowObject(Window); + RETURN( Ret); CLEANUP: @@ -580,7 +586,7 @@ BOOL STDCALL -NtUserGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi) +NtUserGetScrollInfo(HWND hWnd, int fnBar, LPSCROLLINFO lpsi) { NTSTATUS Status; PWINDOW_OBJECT Window; @@ -597,28 +603,25 @@ !((psi.cbSize == sizeof(SCROLLINFO)) || (psi.cbSize == sizeof(SCROLLINFO) - sizeof(psi.nTrackPos)))) { SetLastNtError(Status); - RETURN( FALSE); + RETURN(FALSE); } sz = psi.cbSize; Status = MmCopyFromCaller(&psi, lpsi, sz); if (!NT_SUCCESS(Status)) { SetLastNtError(Status); - RETURN( FALSE); + RETURN(FALSE); } - Window = IntGetWindowObject(hwnd); - - if(!Window) + if(!(Window = UserGetWindowObject(hWnd))) { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); - RETURN( FALSE); + RETURN(FALSE); } + UserReferenceWindowObjectCo(Window); Ret = co_IntGetScrollInfo(Window, fnBar, &psi); + UserDereferenceWindowObjectCo(Window); - IntReleaseWindowObject(Window); - Status = MmCopyToCaller(lpsi, &psi, sz); if(!NT_SUCCESS(Status)) { @@ -642,7 +645,7 @@ UINT wSBflags, UINT wArrows) { - PWINDOW_OBJECT Window; + PWINDOW_OBJECT Window = NULL; PSCROLLBARINFO InfoV = NULL, InfoH = NULL; BOOL Chg = FALSE; DECLARE_RETURN(BOOL); @@ -650,13 +653,11 @@ DPRINT("Enter NtUserEnableScrollBar\n"); UserEnterExclusive(); - Window = IntGetWindowObject(hWnd); - - if(!Window) + if(!(Window = UserGetWindowObject(hWnd))) { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); - RETURN( FALSE); + RETURN(FALSE); } + UserReferenceWindowObjectCo(Window); if(wSBflags == SB_CTL) { @@ -665,21 +666,19 @@ InfoV = IntGetScrollbarInfoFromWindow(Window, SB_CTL); Chg = IntEnableScrollBar(FALSE, InfoV ,wArrows); /* Chg? Scrollbar is Refresh in user32/controls/scrollbar.c. */ - IntReleaseWindowObject(Window); - RETURN( TRUE); + + RETURN(TRUE); } if(wSBflags != SB_BOTH && !SBID_IS_VALID(wSBflags)) { - IntReleaseWindowObject(Window); SetLastWin32Error(ERROR_INVALID_PARAMETER); DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", wSBflags); - RETURN( FALSE); + RETURN(FALSE); } if(!co_IntCreateScrollBars(Window)) { - IntReleaseWindowObject(Window); RETURN( FALSE); } @@ -695,8 +694,7 @@ InfoV = IntGetScrollbarInfoFromWindow(Window, SB_VERT); break; default: - IntReleaseWindowObject(Window); - RETURN( FALSE); + RETURN(FALSE); } if(InfoV) @@ -708,11 +706,11 @@ //if(Chg && (Window->Style & WS_VISIBLE)) /* FIXME - repaint scrollbars */ - IntReleaseWindowObject(Window); RETURN( TRUE); - CLEANUP: + if (Window) UserDereferenceWindowObjectCo(Window); + DPRINT("Leave NtUserEnableScrollBar, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; @@ -721,11 +719,11 @@ BOOL STDCALL NtUserSetScrollBarInfo( - HWND hwnd, + HWND hWnd, LONG idObject, SETSCROLLBARINFO *info) { - PWINDOW_OBJECT Window; + PWINDOW_OBJECT Window = NULL; SETSCROLLBARINFO Safeinfo; PSCROLLBARINFO sbi; LPSCROLLINFO psi; @@ -736,18 +734,15 @@ DPRINT("Enter NtUserSetScrollBarInfo\n"); UserEnterExclusive(); - Window = IntGetWindowObject(hwnd); - - if(!Window) + if(!(Window = UserGetWindowObject(hWnd))) { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); } + UserReferenceWindowObjectCo(Window); Obj = SBOBJ_TO_SBID(idObject); if(!SBID_IS_VALID(Obj)) { - IntReleaseWindowObject(Window); SetLastWin32Error(ERROR_INVALID_PARAMETER); DPRINT1("Trying to set scrollinfo for unknown scrollbar type %d", Obj); RETURN( FALSE); @@ -755,14 +750,12 @@ if(!co_IntCreateScrollBars(Window)) { - IntReleaseWindowObject(Window); RETURN(FALSE); } Status = MmCopyFromCaller(&Safeinfo, info, sizeof(SETSCROLLBARINFO)); if(!NT_SUCCESS(Status)) { - IntReleaseWindowObject(Window); SetLastNtError(Status); RETURN(FALSE); } @@ -774,10 +767,11 @@ sbi->reserved = Safeinfo.reserved; RtlCopyMemory(&sbi->rgstate, &Safeinfo.rgstate, sizeof(Safeinfo.rgstate)); - IntReleaseWindowObject(Window); RETURN(TRUE); CLEANUP: + if (Window) UserDereferenceWindowObjectCo(Window); + DPRINT("Leave NtUserSetScrollBarInfo, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; @@ -786,42 +780,37 @@ DWORD STDCALL NtUserSetScrollInfo( - HWND hwnd, + HWND hWnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw) { - PWINDOW_OBJECT Window; + PWINDOW_OBJECT Window = NULL; NTSTATUS Status; SCROLLINFO ScrollInfo; - DWORD Ret; DECLARE_RETURN(DWORD); DPRINT("Enter NtUserSetScrollInfo\n"); UserEnterExclusive(); - Window = IntGetWindowObject(hwnd); - - if(!Window) + if(!(Window = UserGetWindowObject(hWnd))) { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( 0); } + UserReferenceWindowObjectCo(Window); Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos)); if(!NT_SUCCESS(Status)) { - IntReleaseWindowObject(Window); SetLastNtError(Status); RETURN( 0); } - Ret = co_IntSetScrollInfo(Window, fnBar, &ScrollInfo, bRedraw); - IntReleaseWindowObject(Window); + RETURN(co_IntSetScrollInfo(Window, fnBar, &ScrollInfo, bRedraw)); - RETURN( Ret); - CLEANUP: + if (Window) UserDereferenceWindowObjectCo(Window); + DPRINT("Leave NtUserSetScrollInfo, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; @@ -830,16 +819,11 @@ /* Ported from WINE20020904 (SCROLL_ShowScrollBar) */ DWORD FASTCALL -co_UserShowScrollBar(HWND hWnd, int wBar, DWORD bShow) +co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow) { DWORD Style, OldStyle; - PWINDOW_OBJECT Window = IntGetWindowObject(hWnd); - if (!Window) - { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); - return( FALSE); - } + ASSERT_REFS(Window); switch(wBar) { @@ -856,14 +840,12 @@ Style = 0; break; default: - IntReleaseWindowObject(Window); SetLastWin32Error(ERROR_INVALID_PARAMETER); return( FALSE); } if(!co_IntCreateScrollBars(Window)) { - IntReleaseWindowObject(Window); return( FALSE); } @@ -871,8 +853,7 @@ { IntUpdateSBInfo(Window, SB_CTL); - co_WinPosShowWindow(hWnd, bShow ? SW_SHOW : SW_HIDE); - IntReleaseWindowObject(Window); + co_WinPosShowWindow(Window->hSelf, bShow ? SW_SHOW : SW_HIDE); return( TRUE); } @@ -892,12 +873,11 @@ if(Window->Style & WS_VISIBLE) { /* Frame has been changed, let the window redraw itself */ - co_WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | + co_WinPosSetWindowPos(Window->hSelf, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING); } } - IntReleaseWindowObject(Window); return( TRUE); } @@ -905,13 +885,24 @@ DWORD STDCALL NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow) { + PWINDOW_OBJECT Window; DECLARE_RETURN(DWORD); + DWORD ret; DPRINT("Enter NtUserShowScrollBar\n"); UserEnterExclusive(); - RETURN(co_UserShowScrollBar(hWnd, wBar, bShow)); + if (!(Window = UserGetWindowObject(hWnd))) + { + RETURN(0); + } + UserReferenceWindowObjectCo(Window); + ret = co_UserShowScrollBar(Window, wBar, bShow); + UserDereferenceWindowObjectCo(Window); + + RETURN(ret); + CLEANUP: DPRINT("Leave NtUserShowScrollBar, ret%i\n",_ret_); UserLeave(); _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 23:29:54 UTC (rev 17711) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-07 00:02:39 UTC (rev 17712) @@ -1973,15 +1973,18 @@ IntReleaseWindowObject(ParentWindow); } + //faxme:temp hack + UserReferenceWindowObjectCo(Window); /* Initialize and show the window's scrollbars */ if (Window->Style & WS_VSCROLL) { - co_UserShowScrollBar(Window->hSelf, SB_VERT, TRUE); + co_UserShowScrollBar(Window, SB_VERT, TRUE); } if (Window->Style & WS_HSCROLL) { - co_UserShowScrollBar(Window->hSelf, SB_HORZ, TRUE); + co_UserShowScrollBar(Window, SB_HORZ, TRUE); } + UserDereferenceWindowObjectCo(Window); if (dwStyle & WS_VISIBLE) { @@ -3109,7 +3112,6 @@ HMENU STDCALL NtUserGetSystemMenu(HWND hWnd, BOOL bRevert) { - HMENU Result = 0; PWINDOW_OBJECT Window; PMENU_OBJECT Menu; DECLARE_RETURN(HMENU); @@ -3117,20 +3119,17 @@ DPRINT("Enter NtUserGetSystemMenu\n"); UserEnterShared(); - if (!(Window = IntGetWindowObject(hWnd))) + if (!(Window = UserGetWindowObject(hWnd))) { - SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); - RETURN( 0); + RETURN(NULL); } if (!(Menu = IntGetSystemMenu(Window, bRevert, FALSE))) { - Result = Menu->MenuInfo.Self; - IntReleaseMenuObject(Menu); + RETURN(NULL); } - IntReleaseWindowObject(Window); - RETURN( Result); + RETURN(Menu->MenuInfo.Self); CLEANUP: DPRINT("Leave NtUserGetSystemMenu, ret=%i\n",_ret_);
19 years, 3 months
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
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