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
March 2013
----- 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
14 participants
249 discussions
Start a n
N
ew thread
[jgardou] 58571: [OPENGL32] * Sync implementation of wglUseFontBitmaps and wglUseFontOutlines with WINE 1.5.26
by jgardou@svn.reactos.org
Author: jgardou Date: Fri Mar 22 15:10:46 2013 New Revision: 58571 URL:
http://svn.reactos.org/svn/reactos?rev=58571&view=rev
Log: [OPENGL32] * Sync implementation of wglUseFontBitmaps and wglUseFontOutlines with WINE 1.5.26 Modified: trunk/reactos/dll/opengl/opengl32/font.c trunk/reactos/dll/opengl/opengl32/opengl32.spec Modified: trunk/reactos/dll/opengl/opengl32/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/font.c…
============================================================================== --- trunk/reactos/dll/opengl/opengl32/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/opengl32/font.c [iso-8859-1] Fri Mar 22 15:10:46 2013 @@ -1,1155 +1,565 @@ -/**************************************************************************** -* Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -* SOFTWARE. -****************************************************************************/ - -#include "opengl32.h" +/* Window-specific OpenGL functions implementation. + * + * Copyright (c) 1999 Lionel Ulmer + * Copyright (c) 2005 Raphael Junqueira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> #include <math.h> - -#define LINE_BUF_QUANT 4000 -#define VERT_BUF_QUANT 4000 - -static HFONT hNewFont, hOldFont; -static FLOAT ScaleFactor; -static FLOAT* LineBuf; -static DWORD LineBufSize; -static DWORD LineBufIndex; -static FLOAT* VertBuf; -static DWORD VertBufSize; -static DWORD VertBufIndex; -static GLenum TessErrorOccurred; - -/***************************************************************************** -* AppendToLineBuf -* -* Appends one floating-point value to the global LineBuf array. Return value -* is non-zero for success, zero for failure. -*****************************************************************************/ - -INT AppendToLineBuf(FLOAT value) -{ - if (LineBufIndex >= LineBufSize) - { - FLOAT* f; - LineBufSize += LINE_BUF_QUANT; - - f = (FLOAT*) HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, LineBuf, (LineBufSize) * sizeof(FLOAT)); - if (!f) - return 0; - LineBuf = f; - } - LineBuf[LineBufIndex++] = value; - return 1; -} - -/***************************************************************************** -* AppendToVertBuf -* -* Appends one floating-point value to the global VertBuf array. Return value -* is non-zero for success, zero for failure. -* -* Note that we can't realloc this one, because the tessellator is using -* pointers into it. -*****************************************************************************/ - -INT AppendToVertBuf(FLOAT value) -{ - if (VertBufIndex >= VertBufSize) - return 0; - VertBuf[VertBufIndex++] = value; - return 1; -} - -/***************************************************************************** -* GetWord -* -* Fetch the next 16-bit word from a little-endian byte stream, and increment -* the stream pointer to the next unscanned byte. -*****************************************************************************/ - -LONG GetWord(UCHAR** p) -{ - LONG value; - - value = ((*p)[1] << 8) + (*p)[0]; - *p += 2; - return value; -} - -/***************************************************************************** -* GetDWord -* -* Fetch the next 32-bit word from a little-endian byte stream, and increment -* the stream pointer to the next unscanned byte. -*****************************************************************************/ - -LONG GetDWord(UCHAR** p) -{ - LONG value; - - value = ((*p)[3] << 24) + ((*p)[2] << 16) + ((*p)[1] << 8) + (*p)[0]; - *p += 4; - return value; -} - -/***************************************************************************** -* GetFixed -* -* Fetch the next 32-bit fixed-point value from a little-endian byte stream, -* convert it to floating-point, and increment the stream pointer to the next -* unscanned byte. -*****************************************************************************/ -double GetFixed(UCHAR** p) -{ - LONG hiBits, loBits; - double value; - - loBits = GetWord(p); - hiBits = GetWord(p); - value = (double) ((hiBits << 16) | loBits) / 65536.0; - - return value * ScaleFactor; -} - - -/***************************************************************************** -** -** InvertGlyphBitmap. -** -** Invert the bitmap so that it suits OpenGL's representation. -** Each row starts on a double word boundary. -** -*****************************************************************************/ - -VOID InvertGlyphBitmap(INT w, INT h, DWORD *fptr, DWORD *tptr) -{ - INT dWordsInRow = (w+31)/32; - INT i, j; - - if (w <= 0 || h <= 0) { - return; - } - - tptr += ((h-1)*dWordsInRow); - for (i = 0; i < h; i++) { - for (j = 0; j < dWordsInRow; j++) { - *(tptr + j) = *(fptr + j); - } - tptr -= dWordsInRow; - fptr += dWordsInRow; - } -} - -/***************************************************************************** -* CreateHighResolutionFont -* -* Gets metrics for the current font and creates an equivalent font -* scaled to the design units of the font. -* -*****************************************************************************/ - -HFONT CreateHighResolutionFont(HDC hDC) -{ - UINT otmSize; - OUTLINETEXTMETRIC *otm; - LONG fontHeight, fontWidth, fontUnits; - LOGFONTW logFont, logFontFaceName; - - otmSize = GetOutlineTextMetricsW(hDC, 0, NULL); - if (!otmSize) - return NULL; - - otm = (OUTLINETEXTMETRIC *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, otmSize); - if (!otm) - return NULL; - - otm->otmSize = otmSize; - if (!GetOutlineTextMetricsW(hDC, otmSize, otm)) - return NULL; - - GetObjectW(GetCurrentObject(hDC, OBJ_FONT), sizeof(logFontFaceName), &logFontFaceName); - - fontHeight = otm->otmTextMetrics.tmHeight - - otm->otmTextMetrics.tmInternalLeading; - fontWidth = otm->otmTextMetrics.tmAveCharWidth; - fontUnits = (LONG) otm->otmEMSquare; - - ScaleFactor = 1.0F / (FLOAT) fontUnits; - - logFont.lfHeight = - ((LONG) fontUnits); - logFont.lfWidth = (LONG)((FLOAT) (fontWidth * fontUnits) / (FLOAT) fontHeight); - logFont.lfEscapement = 0; - logFont.lfOrientation = 0; - logFont.lfWeight = otm->otmTextMetrics.tmWeight; - logFont.lfItalic = otm->otmTextMetrics.tmItalic; - logFont.lfUnderline = otm->otmTextMetrics.tmUnderlined; - logFont.lfStrikeOut = otm->otmTextMetrics.tmStruckOut; - logFont.lfCharSet = otm->otmTextMetrics.tmCharSet; - logFont.lfOutPrecision = OUT_OUTLINE_PRECIS; - logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - logFont.lfQuality = DEFAULT_QUALITY; - logFont.lfPitchAndFamily = - otm->otmTextMetrics.tmPitchAndFamily & 0xf0; - wcscpy(logFont.lfFaceName, logFontFaceName.lfFaceName); - - hNewFont = CreateFontIndirectW(&logFont); - - HeapFree(GetProcessHeap(), 0, otm); - - return hNewFont; -} - -/***************************************************************************** -* MakeLinesFromArc -* -* Subdivides one arc of a quadratic spline until the chordal deviation -* tolerance requirement is met, then places the resulting set of line -* segments in the global LineBuf. -*****************************************************************************/ -INT MakeLinesFromArc(FLOAT x0, FLOAT y0, FLOAT x1, FLOAT y1, FLOAT x2, FLOAT y2, - DWORD vertexCountIndex, FLOAT chordalDeviationSquared) -{ - FLOAT x01; - FLOAT y01; - FLOAT x12; - FLOAT y12; - FLOAT midPointX; - FLOAT midPointY; - FLOAT deltaX; - FLOAT deltaY; - - /* - * Calculate midpoint of the curve by de Casteljau: - */ - x01 = 0.5F * (x0 + x1); - y01 = 0.5F * (y0 + y1); - x12 = 0.5F * (x1 + x2); - y12 = 0.5F * (y1 + y2); - midPointX = 0.5F * (x01 + x12); - midPointY = 0.5F * (y01 + y12); - - - /* - * Estimate chordal deviation by the distance from the midpoint - * of the curve to its non-pointpolated control point. If this - * distance is greater than the specified chordal deviation - * constraint, then subdivide. Otherwise, generate polylines - * from the three control points. - */ - deltaX = midPointX - x1; - deltaY = midPointY - y1; - - if (deltaX * deltaX + deltaY * deltaY > chordalDeviationSquared) - { - MakeLinesFromArc( x0, y0, - x01, y01, - midPointX, midPointY, - vertexCountIndex, - chordalDeviationSquared); - - MakeLinesFromArc( midPointX, midPointY, - x12, y12, - x2, y2, - vertexCountIndex, - chordalDeviationSquared); - } - else - { - /* - * The "pen" is already at (x0, y0), so we don't need to - * add that point to the LineBuf. +#include <GL/gl.h> + +#include <windef.h> +#include <winbase.h> +#include <wingdi.h> + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wgl); + +/*********************************************************************** + * wglUseFontBitmaps_common + */ +static BOOL wglUseFontBitmaps_common( HDC hdc, DWORD first, DWORD count, DWORD listBase, BOOL unicode ) +{ + GLYPHMETRICS gm; + unsigned int glyph, size = 0; + void *bitmap = NULL, *gl_bitmap = NULL; + int org_alignment; + BOOL ret = TRUE; + + glGetIntegerv(GL_UNPACK_ALIGNMENT, &org_alignment); + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); + + for (glyph = first; glyph < first + count; glyph++) { + static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; + unsigned int needed_size, height, width, width_int; + + if (unicode) + needed_size = GetGlyphOutlineW(hdc, glyph, GGO_BITMAP, &gm, 0, NULL, &identity); + else + needed_size = GetGlyphOutlineA(hdc, glyph, GGO_BITMAP, &gm, 0, NULL, &identity); + + TRACE("Glyph: %3d / List: %d size %d\n", glyph, listBase, needed_size); + if (needed_size == GDI_ERROR) { + ret = FALSE; + break; + } + + if (needed_size > size) { + size = needed_size; + HeapFree(GetProcessHeap(), 0, bitmap); + HeapFree(GetProcessHeap(), 0, gl_bitmap); + bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + gl_bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + } + if (unicode) + ret = (GetGlyphOutlineW(hdc, glyph, GGO_BITMAP, &gm, size, bitmap, &identity) != GDI_ERROR); + else + ret = (GetGlyphOutlineA(hdc, glyph, GGO_BITMAP, &gm, size, bitmap, &identity) != GDI_ERROR); + if (!ret) break; + + if (TRACE_ON(wgl)) { + unsigned int bitmask; + unsigned char *bitmap_ = bitmap; + + TRACE(" - bbox: %d x %d\n", gm.gmBlackBoxX, gm.gmBlackBoxY); + TRACE(" - origin: (%d, %d)\n", gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y); + TRACE(" - increment: %d - %d\n", gm.gmCellIncX, gm.gmCellIncY); + if (needed_size != 0) { + TRACE(" - bitmap:\n"); + for (height = 0; height < gm.gmBlackBoxY; height++) { + TRACE(" "); + for (width = 0, bitmask = 0x80; width < gm.gmBlackBoxX; width++, bitmask >>= 1) { + if (bitmask == 0) { + bitmap_ += 1; + bitmask = 0x80; + } + if (*bitmap_ & bitmask) + TRACE("*"); + else + TRACE(" "); + } + bitmap_ += (4 - ((UINT_PTR)bitmap_ & 0x03)); + TRACE("\n"); + } + } + } + + /* In OpenGL, the bitmap is drawn from the bottom to the top... So we need to invert the + * glyph for it to be drawn properly. */ - if (!AppendToLineBuf(x1) - || !AppendToLineBuf(y1) - || !AppendToLineBuf(x2) - || !AppendToLineBuf(y2)) - return 0; - LineBuf[vertexCountIndex] += 2.0F; - } - - return 1; -} - -/***************************************************************************** -* MakeLinesFromTTQSpline -* -* Converts points from the poly quadratic spline in a TT_PRIM_QSPLINE -* structure to polyline points in the global LineBuf. -*****************************************************************************/ - -INT MakeLinesFromTTQSpline( UCHAR** pp, DWORD vertexCountIndex, WORD pointCount, FLOAT chordalDeviation) -{ - FLOAT x0, y0, x1, y1, x2, y2; - WORD point; - - /* - * Process each of the non-pointpolated points in the outline. - * To do this, we need to generate two pointpolated points (the - * start and end of the arc) for each non-pointpolated point. - * The first pointpolated point is always the one most recently - * stored in LineBuf, so we just extract it from there. The - * second pointpolated point is either the average of the next - * two points in the QSpline, or the last point in the QSpline - * if only one remains. - */ - for (point = 0; point < pointCount - 1; ++point) - { - x0 = LineBuf[LineBufIndex - 2]; - y0 = LineBuf[LineBufIndex - 1]; - - x1 = (FLOAT) GetFixed(pp); - y1 = (FLOAT) GetFixed(pp); - - if (point == pointCount - 2) - { - /* - * This is the last arc in the QSpline. The final - * point is the end of the arc. - */ - x2 = (FLOAT) GetFixed(pp); - y2 = (FLOAT) GetFixed(pp); - } - else - { - /* - * Peek at the next point in the input to compute - * the end of the arc: - */ - x2 = 0.5F * (x1 + (FLOAT) GetFixed(pp)); - y2 = 0.5F * (y1 + (FLOAT) GetFixed(pp)); - /* - * Push the point back onto the input so it will - * be reused as the next off-curve point: - */ - *pp -= 8; - } - - if (!MakeLinesFromArc( x0, y0, - x1, y1, - x2, y2, - vertexCountIndex, - chordalDeviation * chordalDeviation)) - return 0; - } - - return 1; -} - -/***************************************************************************** -* MakeLinesFromTTLine -* -* Converts points from the polyline in a TT_PRIM_LINE structure to -* equivalent points in the global LineBuf. -*****************************************************************************/ -INT MakeLinesFromTTLine(UCHAR** pp, DWORD vertexCountIndex, WORD pointCount) -{ - /* - * Just copy the line segments into the line buffer (converting - * type as we go): - */ - LineBuf[vertexCountIndex] += pointCount; - while (pointCount--) - { - if (!AppendToLineBuf((FLOAT) GetFixed(pp)) /* X coord */ - || !AppendToLineBuf((FLOAT) GetFixed(pp))) /* Y coord */ - return 0; - } - - return 1; -} - -/***************************************************************************** -* MakeLinesFromTTPolyCurve -* -* Converts the lines and splines in a single TTPOLYCURVE structure to points -* in the global LineBuf. -*****************************************************************************/ - -INT MakeLinesFromTTPolycurve(UCHAR** pp, DWORD vertexCountIndex, FLOAT chordalDeviation) -{ - WORD type; - WORD pointCount; - - /* - * Pick up the relevant fields of the TTPOLYCURVE structure: - */ - type = (WORD) GetWord(pp); - pointCount = (WORD) GetWord(pp); - - /* - * Convert the "curve" to line segments: - */ - if (type == TT_PRIM_LINE) - return MakeLinesFromTTLine( pp, - vertexCountIndex, - pointCount); - else if (type == TT_PRIM_QSPLINE) - return MakeLinesFromTTQSpline( pp, - vertexCountIndex, - pointCount, - chordalDeviation); - else - return 0; -} - -/***************************************************************************** -* MakeLinesFromTTPolygon -* -* Converts a TTPOLYGONHEADER and its associated curve structures into a -* single polyline loop in the global LineBuf. -*****************************************************************************/ - -INT MakeLinesFromTTPolygon(UCHAR** pp, FLOAT chordalDeviation) -{ - DWORD polySize; - UCHAR* polyStart; - DWORD vertexCountIndex; - - /* - * Record where the polygon data begins, and where the loop's - * vertex count resides: - */ - polyStart = *pp; - vertexCountIndex = LineBufIndex; - if (!AppendToLineBuf(0.0F)) - return 0; - - /* - * Extract relevant data from the TTPOLYGONHEADER: - */ - polySize = GetDWord(pp); - if (GetDWord(pp) != TT_POLYGON_TYPE) /* polygon type */ - return 0; - if (!AppendToLineBuf((FLOAT) GetFixed(pp))) /* first X coord */ - return 0; - if (!AppendToLineBuf((FLOAT) GetFixed(pp))) /* first Y coord */ - return 0; - LineBuf[vertexCountIndex] += 1.0F; - - /* - * Process each of the TTPOLYCURVE structures in the polygon: - */ - while (*pp < polyStart + polySize) - if (!MakeLinesFromTTPolycurve( pp, - vertexCountIndex, - chordalDeviation)) - return 0; - - return 1; -} - -/***************************************************************************** -* TessVertexOut -* -* Used by tessellator to handle output vertexes. -*****************************************************************************/ - -VOID CALLBACK TessVertexOutData(FLOAT p[3], GLfloat *pz) -{ - GLfloat v[3]; - v[0] = (GLfloat) p[0]; - v[1] = (GLfloat) p[1]; - v[2] = *pz; - glVertex3fv(v); -} - -/***************************************************************************** -* TessCombine -* -* Used by tessellator to handle self-pointsecting contours and degenerate -* geometry. -*****************************************************************************/ -VOID CALLBACK TessCombine(double coords[3], VOID* vertex_data[4], FLOAT weight[4], VOID** outData) -{ - if (!AppendToVertBuf((FLOAT) coords[0]) - || !AppendToVertBuf((FLOAT) coords[1]) - || !AppendToVertBuf((FLOAT) coords[2])) - TessErrorOccurred = GL_OUT_OF_MEMORY; - - *outData = VertBuf + (VertBufIndex - 3); -} - -/***************************************************************************** -* TessError -* -* Saves the last tessellator error code in the global TessErrorOccurred. -*****************************************************************************/ - -VOID CALLBACK TessError(GLenum error) -{ - TessErrorOccurred = error; -} - -/***************************************************************************** -* MakeLinesFromGlyph -* -* Converts the outline of a glyph from the TTPOLYGON format to a simple -* array of floating-point values containing one or more loops. -* -* The first element of the output array is a count of the number of loops. -* The loop data follows this count. Each loop consists of a count of the -* number of vertices it contains, followed by the vertices. Each vertex -* is an X and Y coordinate. For example, a single triangle might be -* described by this array: -* -* 1., 3., 0., 0., 1., 0., 0., 1. -* ^ ^ ^ ^ ^ ^ ^ ^ -* #loops #verts x1 y1 x2 y2 x3 y3 -* -* A two-loop glyph would look like this: -* -* 2., 3., 0.,0., 1.,0., 0.,1., 3., .2,.2, .4,.2, .2,.4 -* -* Line segments from the TTPOLYGON are transferred to the output array in -* the obvious way. Quadratic splines in the TTPOLYGON are converted to -* collections of line segments -*****************************************************************************/ - -INT MakeLinesFromGlyph(UCHAR* glyphBuf, DWORD glyphSize, FLOAT chordalDeviation) -{ - UCHAR* p; - INT status = 0; - - /* - * Pick up all the polygons (aka loops) that make up the glyph: - */ - if (!AppendToLineBuf(0.0F)) /* loop count at LineBuf[0] */ - goto exit; - - p = glyphBuf; - while (p < glyphBuf + glyphSize) - { - if (!MakeLinesFromTTPolygon(&p, chordalDeviation)) - goto exit; - LineBuf[0] += 1.0F; /* increment loop count */ - } - - status = 1; - -exit: - return status; -} - -/***************************************************************************** -* DrawGlyph -* -* Converts the outline of a glyph to OpenGL drawing primitives, tessellating -* as needed, and then draws the glyph. Tessellation of the quadratic splines -* in the outline is controlled by "chordalDeviation", and the drawing -* primitives (lines or polygons) are selected by "format". -* -* Return value is nonzero for success, zero for failure. -* -* Does not check for OpenGL errors, so if the caller needs to know about them, -* it should call glGetError(). -*****************************************************************************/ - -INT DrawGlyph(UCHAR* glyphBuf, DWORD glyphSize, FLOAT chordalDeviation, FLOAT extrusion, INT format) -{ - INT status = 0; - FLOAT* p; - DWORD loop; - DWORD point; - GLUtesselator* tess = NULL; - - /* - * Initialize the global buffer into which we place the outlines: - */ - LineBuf = (FLOAT*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (LINE_BUF_QUANT) * sizeof(FLOAT)); - - if(!LineBuf) - goto exit; - - LineBufSize = LINE_BUF_QUANT; - LineBufIndex = 0; - - /* - * Convert the glyph outlines to a set of polyline loops. - * (See MakeLinesFromGlyph() for the format of the loop data - * structure.) - */ - if (!MakeLinesFromGlyph(glyphBuf, glyphSize, chordalDeviation)) - goto exit; - p = LineBuf; - - - /* - * Now draw the loops in the appropriate format: - */ - if (format == WGL_FONT_LINES) - { - /* - * This is the easy case. Just draw the outlines. - */ - for (loop = (DWORD) *p++; loop; --loop) - { - glBegin(GL_LINE_LOOP); - for (point = (DWORD) *p++; point; --point) - { - glVertex2fv(p); - p += 2; + if (needed_size != 0) { + width_int = (gm.gmBlackBoxX + 31) / 32; + for (height = 0; height < gm.gmBlackBoxY; height++) { + for (width = 0; width < width_int; width++) { + ((int *) gl_bitmap)[(gm.gmBlackBoxY - height - 1) * width_int + width] = + ((int *) bitmap)[height * width_int + width]; + } } - glEnd(); - } - status = 1; - } - - else if (format == WGL_FONT_POLYGONS) - { - double v[3]; - FLOAT *save_p = p; - GLfloat z_value; - - /* - * This is the hard case. We have to set up a tessellator - * to convert the outlines into a set of polygonal - * primitives, which the tessellator passes to some - * auxiliary routines for drawing. - */ - - VertBuf = (FLOAT*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (VERT_BUF_QUANT) * sizeof(FLOAT)); - - if (!VertBuf) - goto exit; - - VertBufSize = VERT_BUF_QUANT; - VertBufIndex = 0; - - if (!(tess = gluNewTess())) - goto exit; - - gluTessCallback(tess, GLU_BEGIN, (VOID(CALLBACK *)()) glBegin); - gluTessCallback(tess, GLU_TESS_VERTEX_DATA, (VOID(CALLBACK *)()) TessVertexOutData); - gluTessCallback(tess, GLU_END, (VOID(CALLBACK *)()) glEnd); - gluTessCallback(tess, GLU_ERROR, (VOID(CALLBACK *)()) TessError); - gluTessCallback(tess, GLU_TESS_COMBINE, (VOID(CALLBACK *)()) TessCombine); - gluTessNormal(tess, 0.0F, 0.0F, 1.0F); - - TessErrorOccurred = 0; - glNormal3f(0.0f, 0.0f, 1.0f); - v[2] = 0.0; - z_value = 0.0f; - - gluTessBeginPolygon(tess, &z_value); - - for (loop = (DWORD) *p++; loop; --loop) - { - gluTessBeginContour(tess); - - for (point = (DWORD) *p++; point; --point) - { - v[0] = p[0]; - v[1] = p[1]; - gluTessVertex(tess, v, p); - p += 2; - } - - gluTessEndContour(tess); - } - gluTessEndPolygon(tess); - - status = !TessErrorOccurred; - - /* Extrusion code */ - if (extrusion) - { - DWORD loops; - GLfloat thickness = (GLfloat) - extrusion; - FLOAT *vert, *vert2; - DWORD count; - - p = save_p; - loops = (DWORD) *p++; - - for (loop = 0; loop < loops; loop++) - { - GLfloat dx, dy, len; - DWORD last; - - count = (DWORD) *p++; - glBegin(GL_QUAD_STRIP); - - /* Check if the first and last vertex are identical - * so we don't draw the same quad twice. - */ - vert = p + (count-1)*2; - last = (p[0] == vert[0] && p[1] == vert[1]) ? count-1 : count; - - for (point = 0; point <= last; point++) - { - vert = p + 2 * (point % last); - vert2 = p + 2 * ((point+1) % last); - - dx = vert[0] - vert2[0]; - dy = vert[1] - vert2[1]; - len = (GLfloat)sqrt(dx * dx + dy * dy); - - glNormal3f(dy / len, -dx / len, 0.0f); - glVertex3f((GLfloat) vert[0], - (GLfloat) vert[1], thickness); - glVertex3f((GLfloat) vert[0], - (GLfloat) vert[1], 0.0f); - } - - glEnd(); - p += count*2; - } - - /* Draw the back face */ - p = save_p; - v[2] = thickness; - glNormal3f(0.0f, 0.0f, -1.0f); - gluTessNormal(tess, 0.0F, 0.0F, -1.0F); - - gluTessBeginPolygon(tess, &thickness); - - for (loop = (DWORD) *p++; loop; --loop) - { - count = (DWORD) *p++; - - gluTessBeginContour(tess); - - for (point = 0; point < count; point++) - { - vert = p + ((count-point-1)<<1); - v[0] = vert[0]; - v[1] = vert[1]; - gluTessVertex(tess, v, vert); - } - p += count*2; - - gluTessEndContour(tess); - } - gluTessEndPolygon(tess); - } - -#if !defined(NDEBUG) - if (TessErrorOccurred) - DBGPRINT("Tessellation error %s\n", gluErrorString(TessErrorOccurred)); -#endif - } - - -exit: - - if(LineBuf) - HeapFree(GetProcessHeap(), 0, LineBuf); - - if(VertBuf) - HeapFree(GetProcessHeap(), 0, VertBuf); - - if (tess) - gluDeleteTess(tess); - - return status; -} - - -/***************************************************************************** -* MakeDisplayListFromGlyph -* -* Converts the outline of a glyph to an OpenGL display list. -* -* Return value is nonzero for success, zero for failure. -* -* Does not check for OpenGL errors, so if the caller needs to know about them, -* it should call glGetError(). -*****************************************************************************/ - -INT MakeDisplayListFromGlyph(DWORD listName, UCHAR* glyphBuf, DWORD glyphSize, LPGLYPHMETRICSFLOAT glyphMetricsFloat, - FLOAT chordalDeviation, FLOAT extrusion, INT format) -{ - INT status; - - glNewList(listName, GL_COMPILE); - status = DrawGlyph(glyphBuf, glyphSize, chordalDeviation, extrusion, format); - glTranslatef(glyphMetricsFloat->gmfCellIncX, glyphMetricsFloat->gmfCellIncY, 0.0F); - glEndList(); - - return status; -} - -// *********************************************************************** - -/***************************************************************************** -* IntUseFontBitmaps -* -* Converts a subrange of the glyphs in a GDI font to OpenGL display -* lists. -* -* Extended to support any GDI font, not just TrueType fonts. (DaveM) -* -*****************************************************************************/ - -BOOL APIENTRY IntUseFontBitmapsW(HDC hDC, DWORD first, DWORD count, DWORD listBase) -{ - INT i, ox, oy, ix, iy; - INT w = 0, h = 0; - INT iBufSize, iCurBufSize = 0; - DWORD *bitmapBuffer = NULL; - DWORD *invertedBitmapBuffer = NULL; - BOOL bSuccessOrFail = TRUE; - BOOL bTrueType = FALSE; - TEXTMETRIC tm; - GLYPHMETRICS gm; - RASTERIZER_STATUS rs; - MAT2 mat; - SIZE size; - RECT rect; - HDC hDCMem; - HBITMAP hBitmap; - BITMAPINFO bmi; - HFONT hFont; - - // Set up a unity matrix. - ZeroMemory(&mat, sizeof(mat)); - mat.eM11.value = 1; - mat.eM22.value = 1; - - // Test to see if selected font is TrueType or not - ZeroMemory(&tm, sizeof(tm)); - if (!GetTextMetrics(hDC, &tm)) - { - DBGPRINT("Font metrics error\n"); - return FALSE; - } - bTrueType = (tm.tmPitchAndFamily & TMPF_TRUETYPE) ? TRUE : FALSE; - - // Test to see if TRUE-TYPE capabilities are installed - // (only necessary if TrueType font selected) - ZeroMemory(&rs, sizeof(rs)); - - if (bTrueType) - { - if (!GetRasterizerCaps (&rs, sizeof (RASTERIZER_STATUS)) || !(rs.wFlags & TT_ENABLED)) - { - DBGPRINT("No TrueType caps\n"); - bTrueType = FALSE; - } - } - - // Trick to get the current font handle - hFont = SelectObject(hDC, GetStockObject(SYSTEM_FONT)); - SelectObject(hDC, hFont); - - // Have memory device context available for holding bitmaps of font glyphs - hDCMem = CreateCompatibleDC(hDC); - SelectObject(hDCMem, hFont); - SetTextColor(hDCMem, RGB(0xFF, 0xFF, 0xFF)); - SetBkColor(hDCMem, 0); - - for (i = first; (DWORD) i < (first + count); i++) - { - // Find out how much space is needed for the bitmap so we can - // Set the buffer size correctly. - if (bTrueType) - { - // Use TrueType support to get bitmap size of glyph - iBufSize = GetGlyphOutline(hDC, i, GGO_BITMAP, &gm, 0, NULL, &mat); - if (iBufSize == GDI_ERROR) - { - bSuccessOrFail = FALSE; - break; - } - } - else - { - // Use generic GDI support to compute bitmap size of glyph - w = tm.tmMaxCharWidth; - h = tm.tmHeight; - if (GetTextExtentPoint32(hDC, (LPCTSTR)&i, 1, &size)) - { - w = size.cx; - h = size.cy; - } - iBufSize = w * h; - // Use DWORD multiple for compatibility - iBufSize += 3; - iBufSize /= 4; - iBufSize *= 4; - } - - // If we need to allocate Larger Buffers, then do so - but allocate - // An extra 50 % so that we don't do too many mallocs ! - if (iBufSize > iCurBufSize) - { - if (bitmapBuffer) - { - HeapFree(GetProcessHeap(), 0, bitmapBuffer); - } - if (invertedBitmapBuffer) - { - HeapFree(GetProcessHeap(), 0, invertedBitmapBuffer); - } - - iCurBufSize = iBufSize * 2; - bitmapBuffer = (DWORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iCurBufSize); - invertedBitmapBuffer = (DWORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iCurBufSize); - - if (bitmapBuffer == NULL || invertedBitmapBuffer == NULL) - { - bSuccessOrFail = FALSE; - break; - } - } - - // If we fail to get the Glyph data, delete the display lists - // Created so far and return FALSE. - if (bTrueType) - { - // Use TrueType support to get bitmap of glyph - if (GetGlyphOutline(hDC, i, GGO_BITMAP, &gm, iBufSize, bitmapBuffer, &mat) == GDI_ERROR) - { - bSuccessOrFail = FALSE; - break; - } - - // Setup glBitmap parameters for current font glyph - w = gm.gmBlackBoxX; - h = gm.gmBlackBoxY; - ox = gm.gmptGlyphOrigin.x; - oy = gm.gmptGlyphOrigin.y; - ix = gm.gmCellIncX; - iy = gm.gmCellIncY; - } - else - { - // Use generic GDI support to create bitmap of glyph - ZeroMemory(bitmapBuffer, iBufSize); - - if (i >= tm.tmFirstChar && i <= tm.tmLastChar) - { - // Only create bitmaps for actual font glyphs - hBitmap = CreateBitmap(w, h, 1, 1, NULL); - SelectObject(hDCMem, hBitmap); - // Make bitmap of current font glyph - SetRect(&rect, 0, 0, w, h); - DrawText(hDCMem, (LPCTSTR)&i, 1, &rect, - DT_LEFT | DT_BOTTOM | DT_SINGLELINE | DT_NOCLIP); - // Make copy of bitmap in our local buffer - ZeroMemory(&bmi, sizeof(bmi)); - bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi.bmiHeader.biWidth = w; - bmi.bmiHeader.biHeight = -h; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = 1; - bmi.bmiHeader.biCompression = BI_RGB; - GetDIBits(hDCMem, hBitmap, 0, h, bitmapBuffer, &bmi, 0); - DeleteObject(hBitmap); - } - else - { - // Otherwise use empty display list for non-existing glyph - iBufSize = 0; - } - - // Setup glBitmap parameters for current font glyph - ox = 0; - oy = tm.tmDescent; - ix = w; - iy = 0; - } - - // Create an OpenGL display list. - glNewList((listBase + i), GL_COMPILE); - - // Some fonts have no data for the space character, yet advertise - // a non-zero size. - if (0 == iBufSize) - { - glBitmap(0, 0, 0.0f, 0.0f, (GLfloat) ix, (GLfloat) iy, NULL); - } - else - { - // Invert the Glyph data. - InvertGlyphBitmap(w, h, bitmapBuffer, invertedBitmapBuffer); - - // Render an OpenGL bitmap and invert the origin. - glBitmap(w, h, - (GLfloat) ox, (GLfloat) (h-oy), - (GLfloat) ix, (GLfloat) iy, - (GLubyte *) invertedBitmapBuffer); - } - - // Close this display list. + } + + glNewList(listBase++, GL_COMPILE); + if (needed_size != 0) { + glBitmap(gm.gmBlackBoxX, gm.gmBlackBoxY, + 0 - gm.gmptGlyphOrigin.x, (int) gm.gmBlackBoxY - gm.gmptGlyphOrigin.y, + gm.gmCellIncX, gm.gmCellIncY, + gl_bitmap); + } else { + /* This is the case of 'empty' glyphs like the space character */ + glBitmap(0, 0, 0, 0, gm.gmCellIncX, gm.gmCellIncY, NULL); + } glEndList(); } - if (bSuccessOrFail == FALSE) + glPixelStorei(GL_UNPACK_ALIGNMENT, org_alignment); + HeapFree(GetProcessHeap(), 0, bitmap); + HeapFree(GetProcessHeap(), 0, gl_bitmap); + return ret; +} + +/*********************************************************************** + * wglUseFontBitmapsA (OPENGL32.@) + */ +BOOL WINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase) +{ + return wglUseFontBitmaps_common( hdc, first, count, listBase, FALSE ); +} + +/*********************************************************************** + * wglUseFontBitmapsW (OPENGL32.@) + */ +BOOL WINAPI wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase) +{ + return wglUseFontBitmaps_common( hdc, first, count, listBase, TRUE ); +} + +/* FIXME: should probably have a glu.h header */ + +typedef struct GLUtesselator GLUtesselator; +typedef void (WINAPI *_GLUfuncptr)(void); + +#define GLU_TESS_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_TESS_END 100102 + +static GLUtesselator * (WINAPI *pgluNewTess)(void); +static void (WINAPI *pgluDeleteTess)(GLUtesselator *tess); +static void (WINAPI *pgluTessNormal)(GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z); +static void (WINAPI *pgluTessBeginPolygon)(GLUtesselator *tess, void *polygon_data); +static void (WINAPI *pgluTessEndPolygon)(GLUtesselator *tess); +static void (WINAPI *pgluTessCallback)(GLUtesselator *tess, GLenum which, _GLUfuncptr fn); +static void (WINAPI *pgluTessBeginContour)(GLUtesselator *tess); +static void (WINAPI *pgluTessEndContour)(GLUtesselator *tess); +static void (WINAPI *pgluTessVertex)(GLUtesselator *tess, GLdouble *location, GLvoid* data); + +static HMODULE load_libglu(void) +{ + static const WCHAR glu32W[] = {'g','l','u','3','2','.','d','l','l',0}; + static int already_loaded; + static HMODULE module; + + if (already_loaded) return module; + already_loaded = 1; + + TRACE("Trying to load GLU library\n"); + module = LoadLibraryW( glu32W ); + if (!module) { - DBGPRINT("DGL_UseFontBitmaps: Get glyph failed\n"); - glDeleteLists((i+listBase), (i-first)); + WARN("Failed to load glu32\n"); + return NULL; } - - // Release resources used - DeleteObject(hFont); - DeleteDC(hDCMem); - - if (bitmapBuffer) - HeapFree(GetProcessHeap(), 0, bitmapBuffer); - - if (invertedBitmapBuffer) - HeapFree(GetProcessHeap(), 0, invertedBitmapBuffer); - - return(bSuccessOrFail); -} - -BOOL APIENTRY IntUseFontBitmapsA(HDC hDC, DWORD first, DWORD count, DWORD listBase) -{ - /* Just call IntUseFontBitmapsW for now */ - return IntUseFontBitmapsW(hDC, first, count, listBase); -} - - - -/***************************************************************************** -* IntUseFontOutlines -* -* Converts a subrange of the glyphs in a TrueType font to OpenGL display -* lists. -*****************************************************************************/ - -BOOL APIENTRY IntUseFontOutlinesW(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT chordalDeviation, - FLOAT extrusion, INT format, GLYPHMETRICSFLOAT *glyphMetricsFloatArray) -{ - DWORD glyphIndex; - UCHAR* glyphBuf; - DWORD glyphBufSize; - - /* - * Flush any previous OpenGL errors. This allows us to check for - * new errors so they can be reported via the function return value. - */ - while (glGetError() != GL_NO_ERROR); - - /* - * Make sure that the current font can be sampled accurately. - */ - hNewFont = CreateHighResolutionFont(hDC); - - if (!hNewFont) - return FALSE; - - hOldFont = SelectObject(hDC, hNewFont); - if (!hOldFont) - return FALSE; - - /* - * Preallocate a buffer for the outline data, and track its size: - */ - glyphBuf = (UCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, glyphBufSize = 10240); - - if (!glyphBuf) - return FALSE; /*WGL_STATUS_NOT_ENOUGH_MEMORY*/ - - /* - * Process each glyph in the given range: - */ - for (glyphIndex = first; glyphIndex - first < count; ++glyphIndex) +#define LOAD_FUNCPTR(f) p##f = (void *)GetProcAddress( module, #f ) + LOAD_FUNCPTR(gluNewTess); + LOAD_FUNCPTR(gluDeleteTess); + LOAD_FUNCPTR(gluTessBeginContour); + LOAD_FUNCPTR(gluTessNormal); + LOAD_FUNCPTR(gluTessBeginPolygon); + LOAD_FUNCPTR(gluTessCallback); + LOAD_FUNCPTR(gluTessEndContour); + LOAD_FUNCPTR(gluTessEndPolygon); + LOAD_FUNCPTR(gluTessVertex); +#undef LOAD_FUNCPTR + return module; +} + +static void fixed_to_double(POINTFX fixed, UINT em_size, GLdouble vertex[3]) +{ + vertex[0] = (fixed.x.value + (GLdouble)fixed.x.fract / (1 << 16)) / em_size; + vertex[1] = (fixed.y.value + (GLdouble)fixed.y.fract / (1 << 16)) / em_size; + vertex[2] = 0.0; +} + +static void WINAPI tess_callback_vertex(GLvoid *vertex) +{ + GLdouble *dbl = vertex; + TRACE("%f, %f, %f\n", dbl[0], dbl[1], dbl[2]); + glVertex3dv(vertex); +} + +static void WINAPI tess_callback_begin(GLenum which) +{ + TRACE("%d\n", which); + glBegin(which); +} + +static void WINAPI tess_callback_end(void) +{ + TRACE("\n"); + glEnd(); +} + +typedef struct _bezier_vector { + GLdouble x; + GLdouble y; +} bezier_vector; + +static double bezier_deviation_squared(const bezier_vector *p) +{ + bezier_vector deviation; + bezier_vector vertex; + bezier_vector base; + double base_length; + double dot; + + vertex.x = (p[0].x + p[1].x*2 + p[2].x)/4 - p[0].x; + vertex.y = (p[0].y + p[1].y*2 + p[2].y)/4 - p[0].y; + + base.x = p[2].x - p[0].x; + base.y = p[2].y - p[0].y; + + base_length = sqrt(base.x*base.x + base.y*base.y); + base.x /= base_length; + base.y /= base_length; + + dot = base.x*vertex.x + base.y*vertex.y; + dot = min(max(dot, 0.0), base_length); + base.x *= dot; + base.y *= dot; + + deviation.x = vertex.x-base.x; + deviation.y = vertex.y-base.y; + + return deviation.x*deviation.x + deviation.y*deviation.y; +} + +static int bezier_approximate(const bezier_vector *p, bezier_vector *points, FLOAT deviation) +{ + bezier_vector first_curve[3]; + bezier_vector second_curve[3]; + bezier_vector vertex; + int total_vertices; + + if(bezier_deviation_squared(p) <= deviation*deviation) { - GLYPHMETRICS glyphMetrics; - DWORD glyphSize; - static MAT2 matrix = + if(points) + *points = p[2]; + return 1; + } + + vertex.x = (p[0].x + p[1].x*2 + p[2].x)/4; + vertex.y = (p[0].y + p[1].y*2 + p[2].y)/4; + + first_curve[0] = p[0]; + first_curve[1].x = (p[0].x + p[1].x)/2; + first_curve[1].y = (p[0].y + p[1].y)/2; + first_curve[2] = vertex; + + second_curve[0] = vertex; + second_curve[1].x = (p[2].x + p[1].x)/2; + second_curve[1].y = (p[2].y + p[1].y)/2; + second_curve[2] = p[2]; + + total_vertices = bezier_approximate(first_curve, points, deviation); + if(points) + points += total_vertices; + total_vertices += bezier_approximate(second_curve, points, deviation); + return total_vertices; +} + +/*********************************************************************** + * wglUseFontOutlines_common + */ +static BOOL wglUseFontOutlines_common(HDC hdc, + DWORD first, + DWORD count, + DWORD listBase, + FLOAT deviation, + FLOAT extrusion, + int format, + LPGLYPHMETRICSFLOAT lpgmf, + BOOL unicode) +{ + UINT glyph; + const MAT2 identity = {{0,1},{0,0},{0,0},{0,1}}; + GLUtesselator *tess = NULL; + LOGFONTW lf; + HFONT old_font, unscaled_font; + UINT em_size = 1024; + RECT rc; + + TRACE("(%p, %d, %d, %d, %f, %f, %d, %p, %s)\n", hdc, first, count, + listBase, deviation, extrusion, format, lpgmf, unicode ? "W" : "A"); + + if(deviation <= 0.0) + deviation = 1.0/em_size; + + if(format == WGL_FONT_POLYGONS) + { + if (!load_libglu()) { - {0, 1}, {0, 0}, - {0, 0}, {0, 1} - }; - LPGLYPHMETRICSFLOAT glyphMetricsFloat = &glyphMetricsFloatArray[glyphIndex - first]; - - /* - * Determine how much space is needed to store the glyph's - * outlines. If our glyph buffer isn't large enough, - * resize it. - */ - - glyphSize = GetGlyphOutline(hDC, glyphIndex, GGO_NATIVE, &glyphMetrics, 0, NULL, &matrix); - - if (glyphSize == GDI_ERROR) - return FALSE; /*WGL_STATUS_FAILURE*/ - - if (glyphSize > glyphBufSize) + ERR("glu32 is required for this function but isn't available\n"); + return FALSE; + } + + tess = pgluNewTess(); + if(!tess) return FALSE; + pgluTessCallback(tess, GLU_TESS_VERTEX, (_GLUfuncptr)tess_callback_vertex); + pgluTessCallback(tess, GLU_TESS_BEGIN, (_GLUfuncptr)tess_callback_begin); + pgluTessCallback(tess, GLU_TESS_END, tess_callback_end); + } + + GetObjectW(GetCurrentObject(hdc, OBJ_FONT), sizeof(lf), &lf); + rc.left = rc.right = rc.bottom = 0; + rc.top = em_size; + DPtoLP(hdc, (POINT*)&rc, 2); + lf.lfHeight = -abs(rc.top - rc.bottom); + lf.lfOrientation = lf.lfEscapement = 0; + unscaled_font = CreateFontIndirectW(&lf); + old_font = SelectObject(hdc, unscaled_font); + + for (glyph = first; glyph < first + count; glyph++) + { + DWORD needed; + GLYPHMETRICS gm; + BYTE *buf; + TTPOLYGONHEADER *pph; + TTPOLYCURVE *ppc; + GLdouble *vertices = NULL; + int vertex_total = -1; + + if(unicode) + needed = GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, 0, NULL, &identity); + else + needed = GetGlyphOutlineA(hdc, glyph, GGO_NATIVE, &gm, 0, NULL, &identity); + + if(needed == GDI_ERROR) + goto error; + + buf = HeapAlloc(GetProcessHeap(), 0, needed); + + if(unicode) + GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity); + else + GetGlyphOutlineA(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity); + + TRACE("glyph %d\n", glyph); + + if(lpgmf) { - HeapFree(GetProcessHeap(), 0, glyphBuf); - glyphBuf = (UCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, glyphBufSize = glyphSize); - if (!glyphBuf) - return FALSE; /*WGL_STATUS_NOT_ENOUGH_MEMORY*/ - } - - - /* - * Get the glyph's outlines. - */ - if (GetGlyphOutline(hDC, glyphIndex, GGO_NATIVE, &glyphMetrics, glyphBufSize, glyphBuf, &matrix) == GDI_ERROR) + lpgmf->gmfBlackBoxX = (float)gm.gmBlackBoxX / em_size; + lpgmf->gmfBlackBoxY = (float)gm.gmBlackBoxY / em_size; + lpgmf->gmfptGlyphOrigin.x = (float)gm.gmptGlyphOrigin.x / em_size; + lpgmf->gmfptGlyphOrigin.y = (float)gm.gmptGlyphOrigin.y / em_size; + lpgmf->gmfCellIncX = (float)gm.gmCellIncX / em_size; + lpgmf->gmfCellIncY = (float)gm.gmCellIncY / em_size; + + TRACE("%fx%f at %f,%f inc %f,%f\n", lpgmf->gmfBlackBoxX, lpgmf->gmfBlackBoxY, + lpgmf->gmfptGlyphOrigin.x, lpgmf->gmfptGlyphOrigin.y, lpgmf->gmfCellIncX, lpgmf->gmfCellIncY); + lpgmf++; + } + + glNewList(listBase++, GL_COMPILE); + glFrontFace(GL_CCW); + if(format == WGL_FONT_POLYGONS) { - HeapFree(GetProcessHeap(), 0, glyphBuf); - return FALSE; /*WGL_STATUS_FAILURE*/ - } - - glyphMetricsFloat->gmfBlackBoxX = - (FLOAT) glyphMetrics.gmBlackBoxX * ScaleFactor; - glyphMetricsFloat->gmfBlackBoxY = - (FLOAT) glyphMetrics.gmBlackBoxY * ScaleFactor; - glyphMetricsFloat->gmfptGlyphOrigin.x = - (FLOAT) glyphMetrics.gmptGlyphOrigin.x * ScaleFactor; - glyphMetricsFloat->gmfptGlyphOrigin.y = - (FLOAT) glyphMetrics.gmptGlyphOrigin.y * ScaleFactor; - glyphMetricsFloat->gmfCellIncX = - (FLOAT) glyphMetrics.gmCellIncX * ScaleFactor; - glyphMetricsFloat->gmfCellIncY = - (FLOAT) glyphMetrics.gmCellIncY * ScaleFactor; - - /* - * Turn the glyph into a display list: - */ - if (!MakeDisplayListFromGlyph((glyphIndex - first) + listBase, glyphBuf, glyphSize, glyphMetricsFloat, - chordalDeviation + ScaleFactor, extrusion, format)) + glNormal3d(0.0, 0.0, 1.0); + pgluTessNormal(tess, 0, 0, 1); + pgluTessBeginPolygon(tess, NULL); + } + + while(!vertices) { - HeapFree(GetProcessHeap(), 0, glyphBuf); - return FALSE; /*WGL_STATUS_FAILURE*/ - } + if(vertex_total != -1) + vertices = HeapAlloc(GetProcessHeap(), 0, vertex_total * 3 * sizeof(GLdouble)); + vertex_total = 0; + + pph = (TTPOLYGONHEADER*)buf; + while((BYTE*)pph < buf + needed) + { + GLdouble previous[3]; + fixed_to_double(pph->pfxStart, em_size, previous); + + if(vertices) + TRACE("\tstart %d, %d\n", pph->pfxStart.x.value, pph->pfxStart.y.value); + + if(format == WGL_FONT_POLYGONS) + pgluTessBeginContour(tess); + else + glBegin(GL_LINE_LOOP); + + if(vertices) + { + fixed_to_double(pph->pfxStart, em_size, vertices); + if(format == WGL_FONT_POLYGONS) + pgluTessVertex(tess, vertices, vertices); + else + glVertex3d(vertices[0], vertices[1], vertices[2]); + vertices += 3; + } + vertex_total++; + + ppc = (TTPOLYCURVE*)((char*)pph + sizeof(*pph)); + while((char*)ppc < (char*)pph + pph->cb) + { + int i, j; + int num; + + switch(ppc->wType) { + case TT_PRIM_LINE: + for(i = 0; i < ppc->cpfx; i++) + { + if(vertices) + { + TRACE("\t\tline to %d, %d\n", + ppc->apfx[i].x.value, ppc->apfx[i].y.value); + fixed_to_double(ppc->apfx[i], em_size, vertices); + if(format == WGL_FONT_POLYGONS) + pgluTessVertex(tess, vertices, vertices); + else + glVertex3d(vertices[0], vertices[1], vertices[2]); + vertices += 3; + } + fixed_to_double(ppc->apfx[i], em_size, previous); + vertex_total++; + } + break; + + case TT_PRIM_QSPLINE: + for(i = 0; i < ppc->cpfx-1; i++) + { + bezier_vector curve[3]; + bezier_vector *points; + GLdouble curve_vertex[3]; + + if(vertices) + TRACE("\t\tcurve %d,%d %d,%d\n", + ppc->apfx[i].x.value, ppc->apfx[i].y.value, + ppc->apfx[i + 1].x.value, ppc->apfx[i + 1].y.value); + + curve[0].x = previous[0]; + curve[0].y = previous[1]; + fixed_to_double(ppc->apfx[i], em_size, curve_vertex); + curve[1].x = curve_vertex[0]; + curve[1].y = curve_vertex[1]; + fixed_to_double(ppc->apfx[i + 1], em_size, curve_vertex); + curve[2].x = curve_vertex[0]; + curve[2].y = curve_vertex[1]; + if(i < ppc->cpfx-2) + { + curve[2].x = (curve[1].x + curve[2].x)/2; + curve[2].y = (curve[1].y + curve[2].y)/2; + } + num = bezier_approximate(curve, NULL, deviation); + points = HeapAlloc(GetProcessHeap(), 0, num*sizeof(bezier_vector)); + num = bezier_approximate(curve, points, deviation); + vertex_total += num; + if(vertices) + { + for(j=0; j<num; j++) + { + TRACE("\t\t\tvertex at %f,%f\n", points[j].x, points[j].y); + vertices[0] = points[j].x; + vertices[1] = points[j].y; + vertices[2] = 0.0; + if(format == WGL_FONT_POLYGONS) + pgluTessVertex(tess, vertices, vertices); + else + glVertex3d(vertices[0], vertices[1], vertices[2]); + vertices += 3; + } + } + HeapFree(GetProcessHeap(), 0, points); + previous[0] = curve[2].x; + previous[1] = curve[2].y; + } + break; + default: + ERR("\t\tcurve type = %d\n", ppc->wType); + if(format == WGL_FONT_POLYGONS) + pgluTessEndContour(tess); + else + glEnd(); + goto error_in_list; + } + + ppc = (TTPOLYCURVE*)((char*)ppc + sizeof(*ppc) + + (ppc->cpfx - 1) * sizeof(POINTFX)); + } + if(format == WGL_FONT_POLYGONS) + pgluTessEndContour(tess); + else + glEnd(); + pph = (TTPOLYGONHEADER*)((char*)pph + pph->cb); + } + } + +error_in_list: + if(format == WGL_FONT_POLYGONS) + pgluTessEndPolygon(tess); + glTranslated((GLdouble)gm.gmCellIncX / em_size, (GLdouble)gm.gmCellIncY / em_size, 0.0); + glEndList(); + HeapFree(GetProcessHeap(), 0, buf); + HeapFree(GetProcessHeap(), 0, vertices); } - /* - * Clean up temporary storage and return. If an error occurred, - * clear all OpenGL error flags and return FAILURE status; - * otherwise just return SUCCESS. - */ - HeapFree(GetProcessHeap(), 0, glyphBuf); - - DeleteObject(SelectObject(hDC, hOldFont)); - - if (glGetError() == GL_NO_ERROR) - { - return TRUE; /*WGL_STATUS_SUCCESS*/ - } - else - { - while (glGetError() != GL_NO_ERROR); - - return FALSE; /*WGL_STATUS_FAILURE*/ - } -} - -BOOL APIENTRY IntUseFontOutlinesA(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT chordalDeviation, - FLOAT extrusion, INT format, GLYPHMETRICSFLOAT *glyphMetricsFloatArray) -{ - /* Just call IntUseFontOutlinesW for now */ - return IntUseFontOutlinesW(hDC, first, count, listBase, chordalDeviation, extrusion, format, glyphMetricsFloatArray); -} + error: + DeleteObject(SelectObject(hdc, old_font)); + if(format == WGL_FONT_POLYGONS) + pgluDeleteTess(tess); + return TRUE; + +} + +/*********************************************************************** + * wglUseFontOutlinesA (OPENGL32.@) + */ +BOOL WINAPI wglUseFontOutlinesA(HDC hdc, + DWORD first, + DWORD count, + DWORD listBase, + FLOAT deviation, + FLOAT extrusion, + int format, + LPGLYPHMETRICSFLOAT lpgmf) +{ + return wglUseFontOutlines_common(hdc, first, count, listBase, deviation, extrusion, format, lpgmf, FALSE); +} + +/*********************************************************************** + * wglUseFontOutlinesW (OPENGL32.@) + */ +BOOL WINAPI wglUseFontOutlinesW(HDC hdc, + DWORD first, + DWORD count, + DWORD listBase, + FLOAT deviation, + FLOAT extrusion, + int format, + LPGLYPHMETRICSFLOAT lpgmf) +{ + return wglUseFontOutlines_common(hdc, first, count, listBase, deviation, extrusion, format, lpgmf, TRUE); +} Modified: trunk/reactos/dll/opengl/opengl32/opengl32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/opengl…
============================================================================== --- trunk/reactos/dll/opengl/opengl32/opengl32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/opengl32/opengl32.spec [iso-8859-1] Fri Mar 22 15:10:46 2013 @@ -363,7 +363,7 @@ @ stdcall wglSwapBuffers(long) rosglSwapBuffers @ stdcall wglSwapLayerBuffers(long long) rosglSwapLayerBuffers @ stub wglSwapMultipleBuffers -@ stdcall wglUseFontBitmapsA(long long long long) rosglUseFontBitmapsA -@ stdcall wglUseFontBitmapsW(long long long long) rosglUseFontBitmapsW -@ stdcall wglUseFontOutlinesA(long long long long long long long ptr) rosglUseFontOutlinesA -@ stdcall wglUseFontOutlinesW(long long long long long long long ptr) rosglUseFontOutlinesW +@ stdcall wglUseFontBitmapsA(long long long long) +@ stdcall wglUseFontBitmapsW(long long long long) +@ stdcall wglUseFontOutlinesA(long long long long long long long ptr) +@ stdcall wglUseFontOutlinesW(long long long long long long long ptr)
11 years, 9 months
1
0
0
0
[akhaldi] 58570: [URLMON_WINETEST] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 14:29:24 2013 New Revision: 58570 URL:
http://svn.reactos.org/svn/reactos?rev=58570&view=rev
Log: [URLMON_WINETEST] * Sync with Wine 1.5.26. Modified: trunk/rostests/winetests/urlmon/CMakeLists.txt trunk/rostests/winetests/urlmon/generated.c trunk/rostests/winetests/urlmon/misc.c trunk/rostests/winetests/urlmon/protocol.c trunk/rostests/winetests/urlmon/sec_mgr.c trunk/rostests/winetests/urlmon/stream.c trunk/rostests/winetests/urlmon/testlist.c trunk/rostests/winetests/urlmon/uri.c trunk/rostests/winetests/urlmon/url.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/urlmon/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/CMakeLis…
Modified: trunk/rostests/winetests/urlmon/generated.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/generate…
Modified: trunk/rostests/winetests/urlmon/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/misc.c?r…
Modified: trunk/rostests/winetests/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/protocol…
Modified: trunk/rostests/winetests/urlmon/sec_mgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/sec_mgr.…
Modified: trunk/rostests/winetests/urlmon/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/stream.c…
Modified: trunk/rostests/winetests/urlmon/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/testlist…
Modified: trunk/rostests/winetests/urlmon/uri.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/uri.c?re…
Modified: trunk/rostests/winetests/urlmon/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/url.c?re…
11 years, 9 months
1
0
0
0
[akhaldi] 58569: [URLMON] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 14:29:11 2013 New Revision: 58569 URL:
http://svn.reactos.org/svn/reactos?rev=58569&view=rev
Log: [URLMON] * Sync with Wine 1.5.26. Added: trunk/reactos/dll/win32/urlmon/axinstall.c (with props) trunk/reactos/dll/win32/urlmon/resource.h (with props) trunk/reactos/dll/win32/urlmon/urlmon.rc (with props) trunk/reactos/dll/win32/urlmon/urlmon_urlmon.rgs (with props) Modified: trunk/reactos/dll/win32/urlmon/CMakeLists.txt trunk/reactos/dll/win32/urlmon/bindctx.c trunk/reactos/dll/win32/urlmon/binding.c trunk/reactos/dll/win32/urlmon/bindprot.c trunk/reactos/dll/win32/urlmon/download.c trunk/reactos/dll/win32/urlmon/file.c trunk/reactos/dll/win32/urlmon/ftp.c trunk/reactos/dll/win32/urlmon/http.c trunk/reactos/dll/win32/urlmon/internet.c trunk/reactos/dll/win32/urlmon/mk.c trunk/reactos/dll/win32/urlmon/protocol.c trunk/reactos/dll/win32/urlmon/sec_mgr.c trunk/reactos/dll/win32/urlmon/session.c trunk/reactos/dll/win32/urlmon/umon.c trunk/reactos/dll/win32/urlmon/umstream.c trunk/reactos/dll/win32/urlmon/uri.c trunk/reactos/dll/win32/urlmon/urlmon.spec trunk/reactos/dll/win32/urlmon/urlmon_main.c trunk/reactos/dll/win32/urlmon/urlmon_main.h trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl trunk/reactos/dll/win32/urlmon/usrmarshal.c trunk/reactos/include/psdk/urlmon.idl trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/urlmon/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/CMakeList…
Added: trunk/reactos/dll/win32/urlmon/axinstall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/axinstall…
Modified: trunk/reactos/dll/win32/urlmon/bindctx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/bindctx.c…
Modified: trunk/reactos/dll/win32/urlmon/binding.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/binding.c…
Modified: trunk/reactos/dll/win32/urlmon/bindprot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/bindprot.…
Modified: trunk/reactos/dll/win32/urlmon/download.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/download.…
Modified: trunk/reactos/dll/win32/urlmon/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/file.c?re…
Modified: trunk/reactos/dll/win32/urlmon/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/ftp.c?rev…
Modified: trunk/reactos/dll/win32/urlmon/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/http.c?re…
Modified: trunk/reactos/dll/win32/urlmon/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/internet.…
Modified: trunk/reactos/dll/win32/urlmon/mk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/mk.c?rev=…
Modified: trunk/reactos/dll/win32/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/protocol.…
Added: trunk/reactos/dll/win32/urlmon/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/resource.…
Modified: trunk/reactos/dll/win32/urlmon/sec_mgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/sec_mgr.c…
Modified: trunk/reactos/dll/win32/urlmon/session.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/session.c…
Modified: trunk/reactos/dll/win32/urlmon/umon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/umon.c?re…
Modified: trunk/reactos/dll/win32/urlmon/umstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/umstream.…
Modified: trunk/reactos/dll/win32/urlmon/uri.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/uri.c?rev…
Added: trunk/reactos/dll/win32/urlmon/urlmon.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.rc…
Modified: trunk/reactos/dll/win32/urlmon/urlmon.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon.sp…
Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
Modified: trunk/reactos/dll/win32/urlmon/urlmon_urlmon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ur…
Added: trunk/reactos/dll/win32/urlmon/urlmon_urlmon.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ur…
Modified: trunk/reactos/dll/win32/urlmon/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/usrmarsha…
Modified: trunk/reactos/include/psdk/urlmon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/urlmon.idl?re…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
11 years, 9 months
1
0
0
0
[akhaldi] 58568: [PROPSYS_WINETEST] * Import from Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 12:08:15 2013 New Revision: 58568 URL:
http://svn.reactos.org/svn/reactos?rev=58568&view=rev
Log: [PROPSYS_WINETEST] * Import from Wine 1.5.26. Added: trunk/rostests/winetests/propsys/ trunk/rostests/winetests/propsys/CMakeLists.txt (with props) trunk/rostests/winetests/propsys/propstore.c (with props) trunk/rostests/winetests/propsys/propsys.c (with props) trunk/rostests/winetests/propsys/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Fri Mar 22 12:08:15 2013 @@ -58,6 +58,7 @@ add_subdirectory(oleaut32) add_subdirectory(opengl32) add_subdirectory(pdh) +add_subdirectory(propsys) add_subdirectory(psapi) add_subdirectory(qmgr) add_subdirectory(quartz) Added: trunk/rostests/winetests/propsys/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/CMakeLi…
============================================================================== --- trunk/rostests/winetests/propsys/CMakeLists.txt (added) +++ trunk/rostests/winetests/propsys/CMakeLists.txt [iso-8859-1] Fri Mar 22 12:08:15 2013 @@ -1,0 +1,7 @@ + +add_definitions(-D__ROS_LONG64__) +add_executable(propsys_winetest propstore.c propsys.c testlist.c) +target_link_libraries(propsys_winetest wine) +set_module_type(propsys_winetest win32cui) +add_importlibs(propsys_winetest propsys ole32 oleaut32 msvcrt kernel32 ntdll) +add_cd_file(TARGET propsys_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/propsys/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/propsys/propstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/propsto…
============================================================================== --- trunk/rostests/winetests/propsys/propstore.c (added) +++ trunk/rostests/winetests/propsys/propstore.c [iso-8859-1] Fri Mar 22 12:08:15 2013 @@ -1,0 +1,263 @@ +/* + * Unit tests for IPropertyStore and related interfaces + * + * Copyright 2012 Vincent Povirk + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS + +#include <stdarg.h> +//#include <stdio.h> + +#define NONAMELESSUNION + +#include <windef.h> +#include <winbase.h> +#include <objbase.h> +#include <propsys.h> +#include <wine/test.h> + +#include <initguid.h> + +DEFINE_GUID(PKEY_WineTest, 0x7b317433, 0xdfa3, 0x4c44, 0xad, 0x3e, 0x2f, 0x80, 0x4b, 0x90, 0xdb, 0xf4); + +static void test_inmemorystore(void) +{ + IPropertyStoreCache *propcache; + HRESULT hr; + PROPERTYKEY pkey; + PROPVARIANT propvar; + DWORD count; + PSC_STATE state; + + hr = CoCreateInstance(&CLSID_InMemoryPropertyStore, NULL, CLSCTX_INPROC_SERVER, + &IID_IPropertyStoreCache, (void**)&propcache); + ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr); + + if (FAILED(hr)) + { + skip("CLSID_InMemoryPropertyStore not supported\n"); + return; + } + + hr = IPropertyStoreCache_GetCount(propcache, NULL); + ok(hr == E_POINTER, "GetCount failed, hr=%x\n", hr); + + hr = IPropertyStoreCache_GetCount(propcache, &count); + ok(hr == S_OK, "GetCount failed, hr=%x\n", hr); + ok(count == 0, "GetCount returned %i, expected 0\n", count); + + hr = IPropertyStoreCache_Commit(propcache); + ok(hr == S_OK, "Commit failed, hr=%x\n", hr); + + hr = IPropertyStoreCache_Commit(propcache); + ok(hr == S_OK, "Commit failed, hr=%x\n", hr); + + hr = IPropertyStoreCache_GetAt(propcache, 0, &pkey); + ok(hr == E_INVALIDARG, "GetAt failed, hr=%x\n", hr); + + pkey.fmtid = PKEY_WineTest; + pkey.pid = 4; + + memset(&propvar, 0, sizeof(propvar)); + propvar.vt = VT_I4; + propvar.u.lVal = 12345; + + if (0) + { + /* Crashes on Windows 7 */ + hr = IPropertyStoreCache_SetValue(propcache, NULL, &propvar); + ok(hr == E_POINTER, "SetValue failed, hr=%x\n", hr); + + hr = IPropertyStoreCache_SetValue(propcache, &pkey, NULL); + ok(hr == E_POINTER, "SetValue failed, hr=%x\n", hr); + } + + hr = IPropertyStoreCache_SetValue(propcache, &pkey, &propvar); + ok(hr == S_OK, "SetValue failed, hr=%x\n", hr); + + hr = IPropertyStoreCache_GetCount(propcache, &count); + ok(hr == S_OK, "GetCount failed, hr=%x\n", hr); + ok(count == 1, "GetCount returned %i, expected 0\n", count); + + memset(&pkey, 0, sizeof(pkey)); + + hr = IPropertyStoreCache_GetAt(propcache, 0, &pkey); + ok(hr == S_OK, "GetAt failed, hr=%x\n", hr); + ok(IsEqualGUID(&pkey.fmtid, &PKEY_WineTest), "got wrong pkey\n"); + ok(pkey.pid == 4, "got pid of %i, expected 4\n", pkey.pid); + + pkey.fmtid = PKEY_WineTest; + pkey.pid = 4; + + memset(&propvar, 0, sizeof(propvar)); + + if (0) + { + /* Crashes on Windows 7 */ + hr = IPropertyStoreCache_GetValue(propcache, NULL, &propvar); + ok(hr == E_POINTER, "GetValue failed, hr=%x\n", hr); + } + + hr = IPropertyStoreCache_GetValue(propcache, &pkey, NULL); + ok(hr == E_POINTER, "GetValue failed, hr=%x\n", hr); + + hr = IPropertyStoreCache_GetValue(propcache, &pkey, &propvar); + ok(hr == S_OK, "GetValue failed, hr=%x\n", hr); + ok(propvar.vt == VT_I4, "expected VT_I4, got %d\n", propvar.vt); + ok(propvar.u.lVal == 12345, "expected 12345, got %d\n", propvar.u.lVal); + + pkey.fmtid = PKEY_WineTest; + pkey.pid = 10; + + /* Get information for field that isn't set yet */ + propvar.vt = VT_I2; + hr = IPropertyStoreCache_GetValue(propcache, &pkey, &propvar); + ok(hr == S_OK, "GetValue failed, hr=%x\n", hr); + ok(propvar.vt == VT_EMPTY, "expected VT_EMPTY, got %d\n", propvar.vt); + + state = 0xdeadbeef; + hr = IPropertyStoreCache_GetState(propcache, &pkey, &state); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetState failed, hr=%x\n", hr); + ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state); + + propvar.vt = VT_I2; + state = 0xdeadbeef; + hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &state); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetValueAndState failed, hr=%x\n", hr); + ok(propvar.vt == VT_EMPTY, "expected VT_EMPTY, got %d\n", propvar.vt); + ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state); + + /* Set state on an unset field */ + hr = IPropertyStoreCache_SetState(propcache, &pkey, PSC_NORMAL); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "SetState failed, hr=%x\n", hr); + + /* Manipulate state on already set field */ + pkey.fmtid = PKEY_WineTest; + pkey.pid = 4; + + state = 0xdeadbeef; + hr = IPropertyStoreCache_GetState(propcache, &pkey, &state); + ok(hr == S_OK, "GetState failed, hr=%x\n", hr); + ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state); + + hr = IPropertyStoreCache_SetState(propcache, &pkey, 10); + ok(hr == S_OK, "SetState failed, hr=%x\n", hr); + + state = 0xdeadbeef; + hr = IPropertyStoreCache_GetState(propcache, &pkey, &state); + ok(hr == S_OK, "GetState failed, hr=%x\n", hr); + ok(state == 10, "expected 10, got %d\n", state); + + propvar.vt = VT_I4; + propvar.u.lVal = 12346; + hr = IPropertyStoreCache_SetValueAndState(propcache, &pkey, &propvar, 5); + ok(hr == S_OK, "SetValueAndState failed, hr=%x\n", hr); + + memset(&propvar, 0, sizeof(propvar)); + state = 0xdeadbeef; + hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &state); + ok(hr == S_OK, "GetValueAndState failed, hr=%x\n", hr); + ok(propvar.vt == VT_I4, "expected VT_I4, got %d\n", propvar.vt); + ok(propvar.u.lVal == 12346, "expected 12346, got %d\n", propvar.vt); + ok(state == 5, "expected 5, got %d\n", state); + + /* Set new field with state */ + pkey.fmtid = PKEY_WineTest; + pkey.pid = 8; + + propvar.vt = VT_I4; + propvar.u.lVal = 12347; + hr = IPropertyStoreCache_SetValueAndState(propcache, &pkey, &propvar, PSC_DIRTY); + ok(hr == S_OK, "SetValueAndState failed, hr=%x\n", hr); + + memset(&propvar, 0, sizeof(propvar)); + state = 0xdeadbeef; + hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &state); + ok(hr == S_OK, "GetValueAndState failed, hr=%x\n", hr); + ok(propvar.vt == VT_I4, "expected VT_I4, got %d\n", propvar.vt); + ok(propvar.u.lVal == 12347, "expected 12347, got %d\n", propvar.vt); + ok(state == PSC_DIRTY, "expected PSC_DIRTY, got %d\n", state); + + IPropertyStoreCache_Release(propcache); +} + +static void test_persistserialized(void) +{ + IPropertyStore *propstore; + IPersistSerializedPropStorage *serialized; + HRESULT hr; + SERIALIZEDPROPSTORAGE *result; + DWORD result_size; + + hr = CoCreateInstance(&CLSID_InMemoryPropertyStore, NULL, CLSCTX_INPROC_SERVER, + &IID_IPropertyStore, (void**)&propstore); + ok(hr == S_OK, "CoCreateInstance failed, hr=%x\n", hr); + + hr = IPropertyStore_QueryInterface(propstore, &IID_IPersistSerializedPropStorage, + (void**)&serialized); + todo_wine ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr); + + if (FAILED(hr)) + { + skip("IPersistSerializedPropStorage not supported\n"); + return; + } + + hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, NULL, &result_size); + ok(hr == E_POINTER, "GetPropertyStorage failed, hr=%x\n", hr); + + hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, &result, NULL); + ok(hr == E_POINTER, "GetPropertyStorage failed, hr=%x\n", hr); + + hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, &result, &result_size); + ok(hr == S_OK, "GetPropertyStorage failed, hr=%x\n", hr); + + if (SUCCEEDED(hr)) + { + ok(result_size == 0, "expected 0 bytes, got %i\n", result_size); + + CoTaskMemFree(result); + } + + hr = IPersistSerializedPropStorage_SetPropertyStorage(serialized, NULL, 4); + ok(hr == E_POINTER, "SetPropertyStorage failed, hr=%x\n", hr); + + hr = IPersistSerializedPropStorage_SetPropertyStorage(serialized, NULL, 0); + ok(hr == S_OK, "SetPropertyStorage failed, hr=%x\n", hr); + + hr = IPropertyStore_GetCount(propstore, &result_size); + ok(hr == S_OK, "GetCount failed, hr=%x\n", hr); + ok(result_size == 0, "expecting 0, got %d\n", result_size); + + IPropertyStore_Release(propstore); + IPersistSerializedPropStorage_Release(serialized); +} + +START_TEST(propstore) +{ + CoInitialize(NULL); + + test_inmemorystore(); + test_persistserialized(); + + CoUninitialize(); +} Propchange: trunk/rostests/winetests/propsys/propstore.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/propsys/propsys.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/propsys…
============================================================================== --- trunk/rostests/winetests/propsys/propsys.c (added) +++ trunk/rostests/winetests/propsys/propsys.c [iso-8859-1] Fri Mar 22 12:08:15 2013 @@ -1,0 +1,905 @@ +/* + * Unit tests for Windows property system + * + * Copyright 2006 Paul Vriens + * Copyright 2010 Andrew Nguyen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS + +//#include <stdarg.h> +#include <stdio.h> + +#define NONAMELESSUNION + +#include <windef.h> +#include <winbase.h> +#include <winreg.h> +#include <winnls.h> +//#include "objbase.h" +#include <ole2.h> +#include <initguid.h> +#include <propsys.h> +#include <propvarutil.h> +#include <wine/test.h> + +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); +DEFINE_GUID(dummy_guid, 0xdeadbeef, 0xdead, 0xbeef, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe); +DEFINE_GUID(expect_guid, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12); + +#define GUID_MEMBERS(g) {(g).Data1, (g).Data2, (g).Data3, {(g).Data4[0], (g).Data4[1], (g).Data4[2], (g).Data4[3], (g).Data4[4], (g).Data4[5], (g).Data4[6], (g).Data4[7]}} + +static char *show_guid(const GUID *guid, char *buf) +{ + static char static_buf[40]; + + if(!buf) + buf = static_buf; + + sprintf(buf, + "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + guid->Data1, guid->Data2, guid->Data3, + guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], + guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); + + return buf; +} + +static int strcmp_wa(LPCWSTR strw, const char *stra) +{ + CHAR buf[512]; + WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL); + return lstrcmpA(stra, buf); +} + +static void test_PSStringFromPropertyKey(void) +{ + static const WCHAR fillerW[] = {'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X', + 'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X', + 'X','X','X','X','X','X','X','X','X','X'}; + static const WCHAR zero_fillerW[] = {'\0','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X', + 'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X', + 'X','X','X','X','X','X','X','X','X','X','X','X','X','X'}; + static const WCHAR zero_truncatedW[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0', + '0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0', + '0','0','0','}',' ','\0','9','X','X','X','X','X','X','X','X','X'}; + static const WCHAR zero_truncated2W[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0', + '0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0', + '0','0','0','}',' ','\0','9','2','7','6','9','4','9','2','X','X'}; + static const WCHAR zero_truncated3W[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0', + '0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0', + '0','0','0','}',' ','\0','9','2','7','6','9','4','9','2','4','X'}; + static const WCHAR zero_truncated4W[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0', + '0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0', + '0','0','0','}',' ','\0','7','X','X','X','X','X','X','X','X','X'}; + static const WCHAR truncatedW[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','\0','9','X','X','X','X','X','X','X','X','X'}; + static const WCHAR truncated2W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','\0','9','2','7','6','9','4','9','2','X','X'}; + static const WCHAR truncated3W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','\0','9','2','7','6','9','4','9','2','4','X'}; + static const WCHAR truncated4W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','\0','7','X','X','X','X','X','X','X','X','X'}; + static const WCHAR expectedW[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','4','2','9','4','9','6','7','2','9','5',0}; + static const WCHAR expected2W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','1','3','5','7','9','\0','X','X','X','X','X'}; + static const WCHAR expected3W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0', + '0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0', + '0','}',' ','0','\0','X','X','X','X','X','X','X','X','X'}; + PROPERTYKEY prop = {GUID_MEMBERS(GUID_NULL), ~0U}; + PROPERTYKEY prop2 = {GUID_MEMBERS(GUID_NULL), 13579}; + PROPERTYKEY prop3 = {GUID_MEMBERS(GUID_NULL), 0}; + WCHAR out[PKEYSTR_MAX]; + HRESULT ret; + + const struct + { + REFPROPERTYKEY pkey; + LPWSTR psz; + UINT cch; + HRESULT hr_expect; + const WCHAR *buf_expect; + int hr_broken; + HRESULT hr2; + int buf_broken; + const WCHAR *buf2; + } testcases[] = + { + {NULL, NULL, 0, E_POINTER}, + {&prop, NULL, 0, E_POINTER}, + {&prop, NULL, PKEYSTR_MAX, E_POINTER}, + {NULL, out, 0, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW}, + {NULL, out, PKEYSTR_MAX, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_fillerW, 0, 0, 1, fillerW}, + {&prop, out, 0, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW}, + {&prop, out, GUIDSTRING_MAX, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW}, + {&prop, out, GUIDSTRING_MAX + 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW}, + {&prop, out, GUIDSTRING_MAX + 2, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncatedW, 1, S_OK, 1, truncatedW}, + {&prop, out, PKEYSTR_MAX - 2, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncated2W, 1, S_OK, 1, truncated2W}, + {&prop, out, PKEYSTR_MAX - 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncated3W, 1, S_OK, 1, truncated3W}, + {&prop, out, PKEYSTR_MAX, S_OK, expectedW}, + {&prop2, out, GUIDSTRING_MAX + 2, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), zero_truncated4W, 1, S_OK, 1, truncated4W}, + {&prop2, out, GUIDSTRING_MAX + 6, S_OK, expected2W}, + {&prop2, out, PKEYSTR_MAX, S_OK, expected2W}, + {&prop3, out, GUIDSTRING_MAX + 1, HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), fillerW}, + {&prop3, out, GUIDSTRING_MAX + 2, S_OK, expected3W}, + {&prop3, out, PKEYSTR_MAX, S_OK, expected3W}, + }; + + int i; + + for (i = 0; i < sizeof(testcases)/sizeof(testcases[0]); i++) + { + if (testcases[i].psz) + memcpy(testcases[i].psz, fillerW, PKEYSTR_MAX * sizeof(WCHAR)); + + ret = PSStringFromPropertyKey(testcases[i].pkey, + testcases[i].psz, + testcases[i].cch); + ok(ret == testcases[i].hr_expect || + broken(testcases[i].hr_broken && ret == testcases[i].hr2), /* Vista/Win2k8 */ + "[%d] Expected PSStringFromPropertyKey to return 0x%08x, got 0x%08x\n", + i, testcases[i].hr_expect, ret); + + if (testcases[i].psz) + ok(!memcmp(testcases[i].psz, testcases[i].buf_expect, PKEYSTR_MAX * sizeof(WCHAR)) || + broken(testcases[i].buf_broken && + !memcmp(testcases[i].psz, testcases[i].buf2, PKEYSTR_MAX * sizeof(WCHAR))), /* Vista/Win2k8 */ + "[%d] Unexpected output contents\n", i); + } +} + +static void test_PSPropertyKeyFromString(void) +{ + static const WCHAR emptyW[] = {0}; + static const WCHAR fmtid_clsidW[] = {'S','t','d','F','o','n','t',' ','1',0}; + static const WCHAR fmtid_truncatedW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-',0}; + static const WCHAR fmtid_nobracketsW[] = {'1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2',0}; + static const WCHAR fmtid_badbracketW[] = {'X','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badcharW[] = {'{','X','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar2W[] = {'{','1','2','3','4','5','6','7','X','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_baddashW[] = {'{','1','2','3','4','5','6','7','8','X','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar3W[] = {'{','1','2','3','4','5','6','7','8','-','X','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar4W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','X','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_baddash2W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','X', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar5W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + 'X','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar6W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','X','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_baddash3W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','X','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar7W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','X','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar8W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','X','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_baddash4W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','X', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar9W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + 'X','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar9_adjW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','X','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar10W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','X','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar11W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','X','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar12W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','X','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badchar13W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','X','0','1','2','}',0}; + static const WCHAR fmtid_badchar14W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','X','2','}',0}; + static const WCHAR fmtid_badbracket2W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','X',0}; + static const WCHAR fmtid_spaceW[] = {' ','{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_spaceendW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',0}; + static const WCHAR fmtid_spacesendW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',' ',' ',0}; + static const WCHAR fmtid_nopidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',0}; + static const WCHAR fmtid_badpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','D','E','A','D',0}; + static const WCHAR fmtid_adjpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}','1','3','5','7','9',0}; + static const WCHAR fmtid_spacespidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',' ',' ','1','3','5','7','9',0}; + static const WCHAR fmtid_negpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-','1','3','5','7','9',0}; + static const WCHAR fmtid_negnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-','-','1','3','5','7','9',0}; + static const WCHAR fmtid_negnegnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-','-','-','1','3','5','7','9',0}; + static const WCHAR fmtid_negspacepidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-',' ','1','3','5','7','9',0}; + static const WCHAR fmtid_negspacenegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-',' ','-','1','3','5','7','9',0}; + static const WCHAR fmtid_negspacespidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-',' ','-',' ','-','1','3','5','7','9',0}; + static const WCHAR fmtid_pospidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','+','1','3','5','7','9',0}; + static const WCHAR fmtid_posnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','+','-','+','-','1','3','5','7','9',0}; + static const WCHAR fmtid_symbolpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','+','/','$','-','1','3','5','7','9',0}; + static const WCHAR fmtid_letterpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','A','B','C','D','1','3','5','7','9',0}; + static const WCHAR fmtid_spacepadpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','3','5','7','9',' ',' ',' ',0}; + static const WCHAR fmtid_spacemixpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1',' ','3',' ','5','7','9',' ',' ',' ',0}; + static const WCHAR fmtid_tabpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}','\t','1','3','5','7','9',0}; + static const WCHAR fmtid_hexpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','0','x','D','E','A','D',0}; + static const WCHAR fmtid_mixedpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','A','9','B','5','C','3','D','1',0}; + static const WCHAR fmtid_overflowpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','2','3','4','5','6','7','8','9','0','1',0}; + static const WCHAR fmtid_commapidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',',','1','3','5','7','9',0}; + static const WCHAR fmtid_commaspidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',',',',',',','1','3','5','7','9',0}; + static const WCHAR fmtid_commaspacepidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',',',' ','1','3','5','7','9',0}; + static const WCHAR fmtid_spacecommapidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',','1','3','5','7','9',0}; + static const WCHAR fmtid_spccommaspcpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',',' ','1','3','5','7','9',0}; + static const WCHAR fmtid_spacescommaspidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',',' ',',','1','3','5','7','9',0}; + static const WCHAR fmtid_commanegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',',','-','1','3','5','7','9',0}; + static const WCHAR fmtid_spccommanegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',','-','1','3','5','7','9',0}; + static const WCHAR fmtid_commaspcnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',',',' ','-','1','3','5','7','9',0}; + static const WCHAR fmtid_spccommaspcnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',',' ','-','1','3','5','7','9',0}; + static const WCHAR fmtid_commanegspcpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',',','-',' ','1','3','5','7','9',0}; + static const WCHAR fmtid_negcommapidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}','-',',','1','3','5','7','9',0}; + static const WCHAR fmtid_normalpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-', + '1','2','3','4','-','1','2','3','4','-', + '1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','3','5','7','9',0}; + PROPERTYKEY out_init = {GUID_MEMBERS(dummy_guid), 0xdeadbeef}; + PROPERTYKEY out; + HRESULT ret; + char guid_buf[40], guid_buf2[40]; + + const struct + { + LPCWSTR pwzString; + PROPERTYKEY *pkey; + HRESULT hr_expect; + PROPERTYKEY pkey_expect; + } testcases[] = + { + {NULL, NULL, E_POINTER}, + {NULL, &out, E_POINTER, {GUID_MEMBERS(dummy_guid), 0xdeadbeef}}, + {emptyW, NULL, E_POINTER}, + {emptyW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}}, + {fmtid_clsidW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}}, + {fmtid_truncatedW, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_nobracketsW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}}, + {fmtid_badbracketW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}}, + {fmtid_badcharW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}}, + {fmtid_badchar2W, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}}, + {fmtid_baddashW, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar3W, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar4W, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_baddash2W, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar5W, &out, E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar6W, &out, E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_baddash3W, &out, E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar7W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar8W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}}, + {fmtid_baddash4W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar9W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar9_adjW, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}}, + {fmtid_badchar10W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0,0,0,0,0}}, 0}}, + {fmtid_badchar11W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0,0,0,0}}, 0}}, + {fmtid_badchar12W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0,0,0}}, 0}}, + {fmtid_badchar13W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0,0}}, 0}}, + {fmtid_badchar14W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0}}, 0}}, + {fmtid_badbracket2W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0x00}}, 0 }}, + {fmtid_spaceW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0 }}, + {fmtid_spaceendW, &out, E_INVALIDARG, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_spacesendW, &out, E_INVALIDARG, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_nopidW, &out, E_INVALIDARG, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_badpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_adjpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_spacespidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_negpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_negnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}}, + {fmtid_negnegnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_negspacepidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_negspacenegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}}, + {fmtid_negspacespidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_pospidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_posnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_symbolpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_letterpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_spacepadpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_spacemixpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 1}}, + {fmtid_tabpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_hexpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_mixedpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_overflowpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 3755744309U}}, + {fmtid_commapidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_commaspidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_commaspacepidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_spacecommapidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_spccommaspcpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + {fmtid_spacescommaspidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_commanegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}}, + {fmtid_spccommanegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}}, + {fmtid_commaspcnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}}, + {fmtid_spccommaspcnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}}, + {fmtid_commanegspcpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0U}}, + {fmtid_negcommapidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}}, + {fmtid_normalpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}}, + }; + + int i; + + for (i = 0; i < sizeof(testcases)/sizeof(testcases[0]); i++) + { + if (testcases[i].pkey) + *testcases[i].pkey = out_init; + + ret = PSPropertyKeyFromString(testcases[i].pwzString, testcases[i].pkey); + ok(ret == testcases[i].hr_expect, + "[%d] Expected PSPropertyKeyFromString to return 0x%08x, got 0x%08x\n", + i, testcases[i].hr_expect, ret); + + if (testcases[i].pkey) + { + ok(IsEqualGUID(&testcases[i].pkey->fmtid, &testcases[i].pkey_expect.fmtid), + "[%d] Expected GUID %s, got %s\n", + i, show_guid(&testcases[i].pkey_expect.fmtid, guid_buf), show_guid(&testcases[i].pkey->fmtid, guid_buf2)); + ok(testcases[i].pkey->pid == testcases[i].pkey_expect.pid, + "[%d] Expected property ID %u, got %u\n", + i, testcases[i].pkey_expect.pid, testcases[i].pkey->pid); + } + } +} + +static void test_PSRefreshPropertySchema(void) +{ + HRESULT ret; + + ret = PSRefreshPropertySchema(); + todo_wine + ok(ret == CO_E_NOTINITIALIZED, + "Expected PSRefreshPropertySchema to return CO_E_NOTINITIALIZED, got 0x%08x\n", ret); + + CoInitialize(NULL); + + ret = PSRefreshPropertySchema(); + ok(ret == S_OK, + "Expected PSRefreshPropertySchema to return S_OK, got 0x%08x\n", ret); + + CoUninitialize(); +} + +static void test_InitPropVariantFromGUIDAsString(void) +{ + PROPVARIANT propvar; + VARIANT var; + HRESULT hres; + int i; + + const struct { + REFGUID guid; + const char *str; + } testcases[] = { + {&IID_NULL, "{00000000-0000-0000-0000-000000000000}" }, + {&dummy_guid, "{DEADBEEF-DEAD-BEEF-DEAD-BEEFCAFEBABE}" }, + }; + + hres = InitPropVariantFromGUIDAsString(NULL, &propvar); + ok(hres == E_FAIL, "InitPropVariantFromGUIDAsString returned %x\n", hres); + + if(0) { + /* Returns strange data on Win7, crashes on older systems */ + InitVariantFromGUIDAsString(NULL, &var); + + /* Crashes on windows */ + InitPropVariantFromGUIDAsString(&IID_NULL, NULL); + InitVariantFromGUIDAsString(&IID_NULL, NULL); + } + + for(i=0; i<sizeof(testcases)/sizeof(testcases[0]); i++) { + memset(&propvar, 0, sizeof(PROPVARIANT)); + hres = InitPropVariantFromGUIDAsString(testcases[i].guid, &propvar); + ok(hres == S_OK, "%d) InitPropVariantFromGUIDAsString returned %x\n", i, hres); + ok(propvar.vt == VT_LPWSTR, "%d) propvar.vt = %d\n", i, propvar.vt); + ok(!strcmp_wa(propvar.u.pwszVal, testcases[i].str), "%d) propvar.u.pwszVal = %s\n", + i, wine_dbgstr_w(propvar.u.pwszVal)); + CoTaskMemFree(propvar.u.pwszVal); + + memset(&var, 0, sizeof(VARIANT)); + hres = InitVariantFromGUIDAsString(testcases[i].guid, &var); + ok(hres == S_OK, "%d) InitVariantFromGUIDAsString returned %x\n", i, hres); + ok(V_VT(&var) == VT_BSTR, "%d) V_VT(&var) = %d\n", i, V_VT(&var)); + ok(SysStringLen(V_BSTR(&var)) == 38, "SysStringLen returned %d\n", + SysStringLen(V_BSTR(&var))); + ok(!strcmp_wa(V_BSTR(&var), testcases[i].str), "%d) V_BSTR(&var) = %s\n", + i, wine_dbgstr_w(V_BSTR(&var))); + VariantClear(&var); + } +} + +static void test_InitPropVariantFromBuffer(void) +{ + static const char data_in[] = "test"; + PROPVARIANT propvar; + VARIANT var; + HRESULT hres; + void *data_out; + LONG size; + + hres = InitPropVariantFromBuffer(NULL, 0, &propvar); + ok(hres == S_OK, "InitPropVariantFromBuffer returned %x\n", hres); + ok(propvar.vt == (VT_VECTOR|VT_UI1), "propvar.vt = %d\n", propvar.vt); + ok(propvar.u.caub.cElems == 0, "cElems = %d\n", propvar.u.caub.cElems == 0); + PropVariantClear(&propvar); + + hres = InitPropVariantFromBuffer(data_in, 4, &propvar); + ok(hres == S_OK, "InitPropVariantFromBuffer returned %x\n", hres); + ok(propvar.vt == (VT_VECTOR|VT_UI1), "propvar.vt = %d\n", propvar.vt); + ok(propvar.u.caub.cElems == 4, "cElems = %d\n", propvar.u.caub.cElems == 0); + ok(!memcmp(propvar.u.caub.pElems, data_in, 4), "Data inside array is incorrect\n"); + PropVariantClear(&propvar); + + hres = InitVariantFromBuffer(NULL, 0, &var); + ok(hres == S_OK, "InitVariantFromBuffer returned %x\n", hres); + ok(V_VT(&var) == (VT_ARRAY|VT_UI1), "V_VT(&var) = %d\n", V_VT(&var)); + size = SafeArrayGetDim(V_ARRAY(&var)); + ok(size == 1, "SafeArrayGetDim returned %d\n", size); + hres = SafeArrayGetLBound(V_ARRAY(&var), 1, &size); + ok(hres == S_OK, "SafeArrayGetLBound returned %x\n", hres); + ok(size == 0, "LBound = %d\n", size); + hres = SafeArrayGetUBound(V_ARRAY(&var), 1, &size); + ok(hres == S_OK, "SafeArrayGetUBound returned %x\n", hres); + ok(size == -1, "UBound = %d\n", size); + VariantClear(&var); + + hres = InitVariantFromBuffer(data_in, 4, &var); + ok(hres == S_OK, "InitVariantFromBuffer returned %x\n", hres); + ok(V_VT(&var) == (VT_ARRAY|VT_UI1), "V_VT(&var) = %d\n", V_VT(&var)); + size = SafeArrayGetDim(V_ARRAY(&var)); + ok(size == 1, "SafeArrayGetDim returned %d\n", size); + hres = SafeArrayGetLBound(V_ARRAY(&var), 1, &size); + ok(hres == S_OK, "SafeArrayGetLBound returned %x\n", hres); + ok(size == 0, "LBound = %d\n", size); + hres = SafeArrayGetUBound(V_ARRAY(&var), 1, &size); + ok(hres == S_OK, "SafeArrayGetUBound returned %x\n", hres); + ok(size == 3, "UBound = %d\n", size); + hres = SafeArrayAccessData(V_ARRAY(&var), &data_out); + ok(hres == S_OK, "SafeArrayAccessData failed %x\n", hres); + ok(!memcmp(data_in, data_out, 4), "Data inside safe array is incorrect\n"); + hres = SafeArrayUnaccessData(V_ARRAY(&var)); + ok(hres == S_OK, "SafeArrayUnaccessData failed %x\n", hres); + VariantClear(&var); +} + +static void test_PropVariantToGUID(void) +{ + PROPVARIANT propvar; + VARIANT var; + GUID guid; + HRESULT hres; + + hres = InitPropVariantFromGUIDAsString(&IID_NULL, &propvar); + ok(hres == S_OK, "InitPropVariantFromGUIDAsString failed %x\n", hres); + + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); + ok(!memcmp(&IID_NULL, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", show_guid(&guid, NULL)); + PropVariantClear(&propvar); + + hres = InitPropVariantFromGUIDAsString(&dummy_guid, &propvar); + ok(hres == S_OK, "InitPropVariantFromGUIDAsString failed %x\n", hres); + + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); + ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", show_guid(&guid, NULL)); + + ok(propvar.vt == VT_LPWSTR, "incorrect PROPVARIANT type: %d\n", propvar.vt); + propvar.u.pwszVal[1] = 'd'; + propvar.u.pwszVal[2] = 'E'; + propvar.u.pwszVal[3] = 'a'; + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); + ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", show_guid(&guid, NULL)); + + propvar.u.pwszVal[1] = 'z'; + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == E_INVALIDARG, "PropVariantToGUID returned %x\n", hres); + PropVariantClear(&propvar); + + + hres = InitVariantFromGUIDAsString(&IID_NULL, &var); + ok(hres == S_OK, "InitVariantFromGUIDAsString failed %x\n", hres); + + hres = VariantToGUID(&var, &guid); + ok(hres == S_OK, "VariantToGUID failed %x\n", hres); + ok(!memcmp(&IID_NULL, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", show_guid(&guid, NULL)); + VariantClear(&var); + + hres = InitVariantFromGUIDAsString(&dummy_guid, &var); + ok(hres == S_OK, "InitVariantFromGUIDAsString failed %x\n", hres); + + hres = VariantToGUID(&var, &guid); + ok(hres == S_OK, "VariantToGUID failed %x\n", hres); + ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", show_guid(&guid, NULL)); + + ok(V_VT(&var) == VT_BSTR, "incorrect VARIANT type: %d\n", V_VT(&var)); + V_BSTR(&var)[1] = 'z'; + hres = VariantToGUID(&var, &guid); + ok(hres == E_FAIL, "VariantToGUID returned %x\n", hres); + + V_BSTR(&var)[1] = 'd'; + propvar.vt = V_VT(&var); + propvar.u.bstrVal = V_BSTR(&var); + V_VT(&var) = VT_EMPTY; + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); + ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", show_guid(&guid, NULL)); + PropVariantClear(&propvar); +} + +static void test_PropVariantCompare(void) +{ + PROPVARIANT empty, null, emptyarray, i2_0, i2_2, i4_large, i4_largeneg, i4_2, str_2, str_02, str_b; + INT res; + static const WCHAR str_2W[] = {'2', 0}; + static const WCHAR str_02W[] = {'0', '2', 0}; + static const WCHAR str_bW[] = {'b', 0}; + SAFEARRAY emptysafearray; + + PropVariantInit(&empty); + PropVariantInit(&null); + PropVariantInit(&emptyarray); + PropVariantInit(&i2_0); + PropVariantInit(&i2_2); + PropVariantInit(&i4_large); + PropVariantInit(&i4_largeneg); + PropVariantInit(&i4_2); + PropVariantInit(&str_2); + PropVariantInit(&str_b); + + empty.vt = VT_EMPTY; + null.vt = VT_NULL; + emptyarray.vt = VT_ARRAY | VT_I4; + emptyarray.u.parray = &emptysafearray; + emptysafearray.cDims = 1; + emptysafearray.fFeatures = FADF_FIXEDSIZE; + emptysafearray.cbElements = 4; + emptysafearray.cLocks = 0; + emptysafearray.pvData = NULL; + emptysafearray.rgsabound[0].cElements = 0; + emptysafearray.rgsabound[0].lLbound = 0; + i2_0.vt = VT_I2; + i2_0.u.iVal = 0; + i2_2.vt = VT_I2; + i2_2.u.iVal = 2; + i4_large.vt = VT_I4; + i4_large.u.lVal = 65536; + i4_largeneg.vt = VT_I4; + i4_largeneg.u.lVal = -65536; + i4_2.vt = VT_I4; + i4_2.u.lVal = 2; + str_2.vt = VT_BSTR; + str_2.u.bstrVal = SysAllocString(str_2W); + str_02.vt = VT_BSTR; + str_02.u.bstrVal = SysAllocString(str_02W); + str_b.vt = VT_BSTR; + str_b.u.bstrVal = SysAllocString(str_bW); + + res = PropVariantCompareEx(&empty, &empty, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&empty, &null, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&null, &emptyarray, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&null, &i2_0, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_0, &null, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&null, &i2_0, 0, PVCF_TREATEMPTYASGREATERTHAN); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_0, &null, 0, PVCF_TREATEMPTYASGREATERTHAN); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_2, &i2_0, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_0, &i2_2, 0, 0); + ok(res == -1, "res=%i\n", res); + + /* Always return -1 if second value cannot be converted to first type */ + res = PropVariantCompareEx(&i2_0, &i4_large, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_0, &i4_largeneg, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&i4_large, &i2_0, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&i4_largeneg, &i2_0, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_2, &i4_2, 0, 0); + ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_2, &str_2, 0, 0); + todo_wine ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&i2_2, &str_02, 0, 0); + todo_wine ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&str_2, &i2_2, 0, 0); + todo_wine ok(res == 0, "res=%i\n", res); + + res = PropVariantCompareEx(&str_02, &i2_2, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&str_02, &str_2, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&str_02, &str_b, 0, 0); + ok(res == -1, "res=%i\n", res); + + res = PropVariantCompareEx(&str_2, &str_02, 0, 0); + ok(res == 1, "res=%i\n", res); + + res = PropVariantCompareEx(&i4_large, &str_b, 0, 0); + todo_wine ok(res == -5 /* ??? */, "res=%i\n", res); + + SysFreeString(str_2.u.bstrVal); + SysFreeString(str_02.u.bstrVal); + SysFreeString(str_b.u.bstrVal); +} + +static inline const char* debugstr_longlong(ULONGLONG ll) +{ + static char string[17]; + if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) + sprintf(string, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll); + else + sprintf(string, "%lx", (unsigned long)ll); + return string; +} + +static void test_intconversions(void) +{ + PROPVARIANT propvar; + SHORT sval; + USHORT usval; + LONG lval; + ULONG ulval; + LONGLONG llval; + ULONGLONG ullval; + HRESULT hr; + + propvar.vt = 0xdead; + hr = PropVariantClear(&propvar); + ok (FAILED(hr), "PropVariantClear fails on invalid vt.\n"); + + propvar.vt = VT_I8; + PropVariantClear(&propvar); + + propvar.vt = VT_I8; + propvar.u.hVal.QuadPart = (LONGLONG)1 << 63; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == (LONGLONG)1 << 63, "got wrong value %s\n", debugstr_longlong(llval)); + + hr = PropVariantToUInt64(&propvar, &ullval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + hr = PropVariantToInt32(&propvar, &lval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + hr = PropVariantToUInt32(&propvar, &ulval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + hr = PropVariantToInt16(&propvar, &sval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + hr = PropVariantToUInt16(&propvar, &usval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + propvar.vt = VT_UI8; + propvar.u.uhVal.QuadPart = 5; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == 5, "got wrong value %s\n", debugstr_longlong(llval)); + + hr = PropVariantToUInt64(&propvar, &ullval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(ullval == 5, "got wrong value %s\n", debugstr_longlong(ullval)); + + hr = PropVariantToInt32(&propvar, &lval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(lval == 5, "got wrong value %d\n", lval); + + hr = PropVariantToUInt32(&propvar, &ulval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(ulval == 5, "got wrong value %d\n", ulval); + + hr = PropVariantToInt16(&propvar, &sval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(sval == 5, "got wrong value %d\n", sval); + + hr = PropVariantToUInt16(&propvar, &usval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(usval == 5, "got wrong value %d\n", usval); + + propvar.vt = VT_I8; + propvar.u.hVal.QuadPart = -5; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == -5, "got wrong value %s\n", debugstr_longlong(llval)); + + hr = PropVariantToUInt64(&propvar, &ullval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + hr = PropVariantToInt32(&propvar, &lval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(lval == -5, "got wrong value %d\n", lval); + + hr = PropVariantToUInt32(&propvar, &ulval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + hr = PropVariantToInt16(&propvar, &sval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(sval == -5, "got wrong value %d\n", sval); + + hr = PropVariantToUInt16(&propvar, &usval); + ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); + + propvar.vt = VT_UI4; + propvar.u.ulVal = 6; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == 6, "got wrong value %s\n", debugstr_longlong(llval)); + + propvar.vt = VT_I4; + propvar.u.lVal = -6; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == -6, "got wrong value %s\n", debugstr_longlong(llval)); + + propvar.vt = VT_UI2; + propvar.u.uiVal = 7; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == 7, "got wrong value %s\n", debugstr_longlong(llval)); + + propvar.vt = VT_I2; + propvar.u.iVal = -7; + + hr = PropVariantToInt64(&propvar, &llval); + ok(hr == S_OK, "hr=%x\n", hr); + ok(llval == -7, "got wrong value %s\n", debugstr_longlong(llval)); +} + +START_TEST(propsys) +{ + test_PSStringFromPropertyKey(); + test_PSPropertyKeyFromString(); + test_PSRefreshPropertySchema(); + test_InitPropVariantFromGUIDAsString(); + test_InitPropVariantFromBuffer(); + test_PropVariantToGUID(); + test_PropVariantCompare(); + test_intconversions(); +} Propchange: trunk/rostests/winetests/propsys/propsys.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/propsys/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/testlis…
============================================================================== --- trunk/rostests/winetests/propsys/testlist.c (added) +++ trunk/rostests/winetests/propsys/testlist.c [iso-8859-1] Fri Mar 22 12:08:15 2013 @@ -1,0 +1,14 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define STANDALONE +#include <wine/test.h> + +extern void func_propstore(void); +extern void func_propsys(void); + +const struct test winetest_testlist[] = +{ + { "propstore", func_propstore }, + { "propsys", func_propsys }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/propsys/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 9 months
1
0
0
0
[akhaldi] 58567: [PROPSYS] * Import from Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 12:08:04 2013 New Revision: 58567 URL:
http://svn.reactos.org/svn/reactos?rev=58567&view=rev
Log: [PROPSYS] * Import from Wine 1.5.26. Added: trunk/reactos/dll/win32/propsys/ (with props) trunk/reactos/dll/win32/propsys/CMakeLists.txt (with props) trunk/reactos/dll/win32/propsys/propstore.c (with props) trunk/reactos/dll/win32/propsys/propsys.rc (with props) trunk/reactos/dll/win32/propsys/propsys.spec (with props) trunk/reactos/dll/win32/propsys/propsys_classes.idl (with props) trunk/reactos/dll/win32/propsys/propsys_classes.rgs (with props) trunk/reactos/dll/win32/propsys/propsys_main.c (with props) trunk/reactos/dll/win32/propsys/propsys_private.h (with props) trunk/reactos/dll/win32/propsys/propvar.c (with props) Modified: trunk/reactos/dll/win32/CMakeLists.txt trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/CMakeLists.txt?r…
============================================================================== --- trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -145,6 +145,7 @@ add_subdirectory(pidgen) add_subdirectory(powrprof) add_subdirectory(printui) +add_subdirectory(propsys) add_subdirectory(psapi) add_subdirectory(pstorec) add_subdirectory(qmgr) Propchange: trunk/reactos/dll/win32/propsys/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Fri Mar 22 12:08:04 2013 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/win32/propsys/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/win32/propsys/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/propsys/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/win32/propsys/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/propsys/CMakeLists.txt (added) +++ trunk/reactos/dll/win32/propsys/CMakeLists.txt [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,20 @@ + +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +add_definitions(-D__WINESRC__) + +spec2def(propsys.dll propsys.spec ADD_IMPORTLIB) + +list(APPEND SOURCE + propstore.c + propsys_main.c + propvar.c + propsys.rc + ${CMAKE_CURRENT_BINARY_DIR}/propsys_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/propsys.def) + +add_library(propsys SHARED ${SOURCE}) +set_module_type(propsys win32dll) +target_link_libraries(propsys uuid wine) +add_importlibs(propsys ole32 oleaut32 msvcrt kernel32 ntdll) +add_dependencies(propsys psdk) +add_cd_file(TARGET propsys DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/dll/win32/propsys/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propstor…
============================================================================== --- trunk/reactos/dll/win32/propsys/propstore.c (added) +++ trunk/reactos/dll/win32/propsys/propstore.c [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,481 @@ +/* + * standard IPropertyStore implementation + * + * Copyright 2012 Vincent Povirk for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#include <config.h> + +#include <stdarg.h> + +#include <windef.h> +#include <winbase.h> +#include <objbase.h> +//#include "rpcproxy.h" +#include <propsys.h> +#include <wine/debug.h> +//#include "wine/unicode.h" +#include <wine/list.h> + +#include <initguid.h> +//#include "propsys_private.h" + +DEFINE_GUID(FMTID_NamedProperties, 0xd5cdd505, 0x2e9c, 0x101b, 0x93, 0x97, 0x08, 0x00, 0x2b, 0x2c, 0xf9, 0xae); + +WINE_DEFAULT_DEBUG_CHANNEL(propsys); + +typedef struct { + struct list entry; + DWORD pid; + PROPVARIANT propvar; + PSC_STATE state; +} propstore_value; + +typedef struct { + struct list entry; + GUID fmtid; + struct list values; /* list of struct propstore_value */ + DWORD count; +} propstore_format; + +typedef struct { + IPropertyStoreCache IPropertyStoreCache_iface; + LONG ref; + CRITICAL_SECTION lock; + struct list formats; /* list of struct propstore_format */ +} PropertyStore; + +static inline PropertyStore *impl_from_IPropertyStoreCache(IPropertyStoreCache *iface) +{ + return CONTAINING_RECORD(iface, PropertyStore, IPropertyStoreCache_iface); +} + +static HRESULT WINAPI PropertyStore_QueryInterface(IPropertyStoreCache *iface, REFIID iid, + void **ppv) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IPropertyStore, iid) || + IsEqualIID(&IID_IPropertyStoreCache, iid)) + { + *ppv = &This->IPropertyStoreCache_iface; + } + else + { + FIXME("No interface for %s\n", debugstr_guid(iid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI PropertyStore_AddRef(IPropertyStoreCache *iface) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + return ref; +} + +static void destroy_format(propstore_format *format) +{ + propstore_value *cursor, *cursor2; + LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, &format->values, propstore_value, entry) + { + PropVariantClear(&cursor->propvar); + HeapFree(GetProcessHeap(), 0, cursor); + } + HeapFree(GetProcessHeap(), 0, format); +} + +static ULONG WINAPI PropertyStore_Release(IPropertyStoreCache *iface) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + if (ref == 0) + { + propstore_format *cursor, *cursor2; + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); + LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, &This->formats, propstore_format, entry) + destroy_format(cursor); + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI PropertyStore_GetCount(IPropertyStoreCache *iface, + DWORD *cProps) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_format *format; + + TRACE("%p,%p\n", iface, cProps); + + if (!cProps) + return E_POINTER; + + *cProps = 0; + + EnterCriticalSection(&This->lock); + + LIST_FOR_EACH_ENTRY(format, &This->formats, propstore_format, entry) + *cProps += format->count; + + LeaveCriticalSection(&This->lock); + + return S_OK; +} + +static HRESULT WINAPI PropertyStore_GetAt(IPropertyStoreCache *iface, + DWORD iProp, PROPERTYKEY *pkey) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_format *format=NULL, *format_candidate; + propstore_value *value; + HRESULT hr; + + TRACE("%p,%d,%p\n", iface, iProp, pkey); + + if (!pkey) + return E_POINTER; + + EnterCriticalSection(&This->lock); + + LIST_FOR_EACH_ENTRY(format_candidate, &This->formats, propstore_format, entry) + { + if (format_candidate->count > iProp) + { + format = format_candidate; + pkey->fmtid = format->fmtid; + break; + } + + iProp -= format_candidate->count; + } + + if (format) + { + LIST_FOR_EACH_ENTRY(value, &format->values, propstore_value, entry) + { + if (iProp == 0) + { + pkey->pid = value->pid; + break; + } + + iProp--; + } + + hr = S_OK; + } + else + hr = E_INVALIDARG; + + LeaveCriticalSection(&This->lock); + + return hr; +} + +static HRESULT PropertyStore_LookupValue(PropertyStore *This, REFPROPERTYKEY key, + int insert, propstore_value **result) +{ + propstore_format *format=NULL, *format_candidate; + propstore_value *value=NULL, *value_candidate; + + if (IsEqualGUID(&key->fmtid, &FMTID_NamedProperties)) + { + /* This is used in the property store format [MS-PROPSTORE] + * for named values and probably gets special treatment. */ + ERR("don't know how to handle FMTID_NamedProperties\n"); + return E_FAIL; + } + + LIST_FOR_EACH_ENTRY(format_candidate, &This->formats, propstore_format, entry) + { + if (IsEqualGUID(&format_candidate->fmtid, &key->fmtid)) + { + format = format_candidate; + break; + } + } + + if (!format) + { + if (!insert) + return TYPE_E_ELEMENTNOTFOUND; + + format = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*format)); + if (!format) + return E_OUTOFMEMORY; + + format->fmtid = key->fmtid; + list_init(&format->values); + list_add_tail(&This->formats, &format->entry); + } + + LIST_FOR_EACH_ENTRY(value_candidate, &format->values, propstore_value, entry) + { + if (value_candidate->pid == key->pid) + { + value = value_candidate; + break; + } + } + + if (!value) + { + if (!insert) + return TYPE_E_ELEMENTNOTFOUND; + + value = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*value)); + if (!value) + return E_OUTOFMEMORY; + + value->pid = key->pid; + list_add_tail(&format->values, &value->entry); + format->count++; + } + + *result = value; + + return S_OK; +} + +static HRESULT WINAPI PropertyStore_GetValue(IPropertyStoreCache *iface, + REFPROPERTYKEY key, PROPVARIANT *pv) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_value *value; + HRESULT hr; + + TRACE("%p,%p,%p\n", iface, key, pv); + + if (!pv) + return E_POINTER; + + EnterCriticalSection(&This->lock); + + hr = PropertyStore_LookupValue(This, key, 0, &value); + + if (SUCCEEDED(hr)) + hr = PropVariantCopy(pv, &value->propvar); + else if (hr == TYPE_E_ELEMENTNOTFOUND) + { + PropVariantInit(pv); + hr = S_OK; + } + + LeaveCriticalSection(&This->lock); + + return hr; +} + +static HRESULT WINAPI PropertyStore_SetValue(IPropertyStoreCache *iface, + REFPROPERTYKEY key, REFPROPVARIANT propvar) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_value *value; + HRESULT hr; + PROPVARIANT temp; + + TRACE("%p,%p,%p\n", iface, key, propvar); + + EnterCriticalSection(&This->lock); + + hr = PropertyStore_LookupValue(This, key, 1, &value); + + if (SUCCEEDED(hr)) + hr = PropVariantCopy(&temp, propvar); + + if (SUCCEEDED(hr)) + { + PropVariantClear(&value->propvar); + value->propvar = temp; + } + + LeaveCriticalSection(&This->lock); + + return hr; +} + +static HRESULT WINAPI PropertyStore_Commit(IPropertyStoreCache *iface) +{ + FIXME("%p: stub\n", iface); + return S_OK; +} + +static HRESULT WINAPI PropertyStore_GetState(IPropertyStoreCache *iface, + REFPROPERTYKEY key, PSC_STATE *pstate) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_value *value; + HRESULT hr; + + TRACE("%p,%p,%p\n", iface, key, pstate); + + EnterCriticalSection(&This->lock); + + hr = PropertyStore_LookupValue(This, key, 0, &value); + + if (SUCCEEDED(hr)) + *pstate = value->state; + + LeaveCriticalSection(&This->lock); + + if (FAILED(hr)) + *pstate = PSC_NORMAL; + + return hr; +} + +static HRESULT WINAPI PropertyStore_GetValueAndState(IPropertyStoreCache *iface, + REFPROPERTYKEY key, PROPVARIANT *ppropvar, PSC_STATE *pstate) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_value *value; + HRESULT hr; + + TRACE("%p,%p,%p,%p\n", iface, key, ppropvar, pstate); + + EnterCriticalSection(&This->lock); + + hr = PropertyStore_LookupValue(This, key, 0, &value); + + if (SUCCEEDED(hr)) + hr = PropVariantCopy(ppropvar, &value->propvar); + + if (SUCCEEDED(hr)) + *pstate = value->state; + + LeaveCriticalSection(&This->lock); + + if (FAILED(hr)) + { + PropVariantInit(ppropvar); + *pstate = PSC_NORMAL; + } + + return hr; +} + +static HRESULT WINAPI PropertyStore_SetState(IPropertyStoreCache *iface, + REFPROPERTYKEY key, PSC_STATE pstate) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_value *value; + HRESULT hr; + + TRACE("%p,%p,%d\n", iface, key, pstate); + + EnterCriticalSection(&This->lock); + + hr = PropertyStore_LookupValue(This, key, 0, &value); + + if (SUCCEEDED(hr)) + value->state = pstate; + + LeaveCriticalSection(&This->lock); + + return hr; +} + +static HRESULT WINAPI PropertyStore_SetValueAndState(IPropertyStoreCache *iface, + REFPROPERTYKEY key, const PROPVARIANT *ppropvar, PSC_STATE state) +{ + PropertyStore *This = impl_from_IPropertyStoreCache(iface); + propstore_value *value; + HRESULT hr; + PROPVARIANT temp; + + TRACE("%p,%p,%p,%d\n", iface, key, ppropvar, state); + + EnterCriticalSection(&This->lock); + + hr = PropertyStore_LookupValue(This, key, 1, &value); + + if (SUCCEEDED(hr)) + hr = PropVariantCopy(&temp, ppropvar); + + if (SUCCEEDED(hr)) + { + PropVariantClear(&value->propvar); + value->propvar = temp; + value->state = state; + } + + LeaveCriticalSection(&This->lock); + + return hr; +} + +static const IPropertyStoreCacheVtbl PropertyStore_Vtbl = { + PropertyStore_QueryInterface, + PropertyStore_AddRef, + PropertyStore_Release, + PropertyStore_GetCount, + PropertyStore_GetAt, + PropertyStore_GetValue, + PropertyStore_SetValue, + PropertyStore_Commit, + PropertyStore_GetState, + PropertyStore_GetValueAndState, + PropertyStore_SetState, + PropertyStore_SetValueAndState +}; + +HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) +{ + PropertyStore *This; + HRESULT ret; + + TRACE("(%p,%s,%p)\n", pUnkOuter, debugstr_guid(iid), ppv); + + *ppv = NULL; + + if (pUnkOuter) return CLASS_E_NOAGGREGATION; + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(PropertyStore)); + if (!This) return E_OUTOFMEMORY; + + This->IPropertyStoreCache_iface.lpVtbl = &PropertyStore_Vtbl; + This->ref = 1; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PropertyStore.lock"); + list_init(&This->formats); + + ret = IPropertyStoreCache_QueryInterface(&This->IPropertyStoreCache_iface, iid, ppv); + IPropertyStoreCache_Release(&This->IPropertyStoreCache_iface); + + return ret; +} Propchange: trunk/reactos/dll/win32/propsys/propstore.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propsys.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys.rc (added) +++ trunk/reactos/dll/win32/propsys/propsys.rc [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,1 @@ +1 WINE_REGISTRY propsys_classes.rgs Propchange: trunk/reactos/dll/win32/propsys/propsys.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propsys.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys.spec (added) +++ trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,210 @@ + 3 stub GetProxyDllInfo + +400 stub PROPSYS_400 +402 stub PROPSYS_402 +403 stub PROPSYS_403 +404 stub PROPSYS_404 +405 stub PROPSYS_405 +406 stub PROPSYS_406 +407 stub PROPSYS_407 +408 stub PROPSYS_408 +409 stub PROPSYS_409 +410 stub PROPSYS_410 +411 stub PROPSYS_411 +412 stub PROPSYS_412 +413 stub PROPSYS_413 +414 stub PROPSYS_414 +415 stub PROPSYS_415 +416 stub PROPSYS_416 +417 stub PROPSYS_417 +418 stub PROPSYS_418 +420 stub PROPSYS_420 +421 stub PROPSYS_421 +422 stub PROPSYS_422 + +@ stub ClearPropVariantArray +@ stub ClearVariantArray +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() +@ stub InitPropVariantFromBooleanVector +@ stdcall InitPropVariantFromBuffer(ptr long ptr) +@ stub InitPropVariantFromCLSID +@ stub InitPropVariantFromDoubleVector +@ stub InitPropVariantFromFileTime +@ stub InitPropVariantFromFileTimeVector +@ stdcall InitPropVariantFromGUIDAsString(ptr ptr) +@ stub InitPropVariantFromInt16Vector +@ stub InitPropVariantFromInt32Vector +@ stub InitPropVariantFromInt64Vector +@ stub InitPropVariantFromPropVariantVectorElem +@ stub InitPropVariantFromResource +@ stub InitPropVariantFromStrRet +@ stub InitPropVariantFromStringAsVector +@ stub InitPropVariantFromStringVector +@ stub InitPropVariantFromUInt16Vector +@ stub InitPropVariantFromUInt32Vector +@ stub InitPropVariantFromUInt64Vector +@ stub InitPropVariantVectorFromPropVariant +@ stub InitVariantFromBooleanArray +@ stdcall InitVariantFromBuffer(ptr long ptr) +@ stub InitVariantFromDoubleArray +@ stub InitVariantFromFileTime +@ stub InitVariantFromFileTimeArray +@ stdcall InitVariantFromGUIDAsString(ptr ptr) +@ stub InitVariantFromInt16Array +@ stub InitVariantFromInt32Array +@ stub InitVariantFromInt64Array +@ stub InitVariantFromResource +@ stub InitVariantFromStrRet +@ stub InitVariantFromStringArray +@ stub InitVariantFromUInt16Array +@ stub InitVariantFromUInt32Array +@ stub InitVariantFromUInt64Array +@ stub InitVariantFromVariantArrayElem +@ stub PSCoerceToCanonicalValue +@ stub PSCreateAdapterFromPropertyStore +@ stub PSCreateDelayedMultiplexPropertyStore +@ stub PSCreateMemoryPropertyStore +@ stub PSCreateMultiplexPropertyStore +@ stub PSCreatePropertyChangeArray +@ stub PSCreatePropertyStoreFromObject +@ stub PSCreatePropertyStoreFromPropertySetStorage +@ stub PSCreateSimplePropertyChange +@ stub PSEnumeratePropertyDescriptions +@ stub PSFormatForDisplay +@ stub PSFormatForDisplayAlloc +@ stub PSFormatPropertyValue +@ stub PSGetItemPropertyHandler +@ stub PSGetItemPropertyHandlerWithCreateObject +@ stub PSGetNameFromPropertyKey +@ stub PSGetNamedPropertyFromPropertyStorage +@ stdcall PSGetPropertyDescription(ptr ptr ptr) +@ stub PSGetPropertyDescriptionByName +@ stub PSGetPropertyDescriptionListFromString +@ stub PSGetPropertyFromPropertyStorage +@ stub PSGetPropertyKeyFromName +@ stub PSGetPropertySystem +@ stub PSGetPropertyValue +@ stub PSLookupPropertyHandlerCLSID +@ stdcall PSPropertyKeyFromString(wstr ptr) +@ stdcall PSRefreshPropertySchema() +@ stdcall PSRegisterPropertySchema(wstr) +@ stub PSSetPropertyValue +@ stdcall PSStringFromPropertyKey(ptr ptr long) +@ stdcall PSUnregisterPropertySchema(wstr) +@ stdcall PropVariantChangeType(ptr ptr long long) +@ stdcall PropVariantCompareEx(ptr ptr long long) +@ stub PropVariantGetBooleanElem +@ stub PropVariantGetDoubleElem +@ stub PropVariantGetElementCount +@ stub PropVariantGetFileTimeElem +@ stub PropVariantGetInt16Elem +@ stub PropVariantGetInt32Elem +@ stub PropVariantGetInt64Elem +@ stub PropVariantGetStringElem +@ stub PropVariantGetUInt16Elem +@ stub PropVariantGetUInt32Elem +@ stub PropVariantGetUInt64Elem +@ stub PropVariantToBSTR +@ stub PropVariantToBoolean +@ stub PropVariantToBooleanVector +@ stub PropVariantToBooleanVectorAlloc +@ stub PropVariantToBooleanWithDefault +@ stub PropVariantToBuffer +@ stub PropVariantToDouble +@ stub PropVariantToDoubleVector +@ stub PropVariantToDoubleVectorAlloc +@ stub PropVariantToDoubleWithDefault +@ stub PropVariantToFileTime +@ stub PropVariantToFileTimeVector +@ stub PropVariantToFileTimeVectorAlloc +@ stdcall PropVariantToGUID(ptr ptr) +@ stdcall PropVariantToInt16(ptr ptr) +@ stub PropVariantToInt16Vector +@ stub PropVariantToInt16VectorAlloc +@ stub PropVariantToInt16WithDefault +@ stdcall PropVariantToInt32(ptr ptr) +@ stub PropVariantToInt32Vector +@ stub PropVariantToInt32VectorAlloc +@ stub PropVariantToInt32WithDefault +@ stdcall PropVariantToInt64(ptr ptr) +@ stub PropVariantToInt64Vector +@ stub PropVariantToInt64VectorAlloc +@ stub PropVariantToInt64WithDefault +@ stub PropVariantToStrRet +@ stub PropVariantToString +@ stub PropVariantToStringAlloc +@ stub PropVariantToStringVector +@ stub PropVariantToStringVectorAlloc +@ stub PropVariantToStringWithDefault +@ stdcall PropVariantToUInt16(ptr ptr) +@ stub PropVariantToUInt16Vector +@ stub PropVariantToUInt16VectorAlloc +@ stub PropVariantToUInt16WithDefault +@ stdcall PropVariantToUInt32(ptr ptr) +@ stub PropVariantToUInt32Vector +@ stub PropVariantToUInt32VectorAlloc +@ stub PropVariantToUInt32WithDefault +@ stdcall PropVariantToUInt64(ptr ptr) +@ stub PropVariantToUInt64Vector +@ stub PropVariantToUInt64VectorAlloc +@ stub PropVariantToUInt64WithDefault +@ stub PropVariantToVariant +@ stub StgDeserializePropVariant +@ stub StgSerializePropVariant +@ stub VariantCompare +@ stub VariantGetBooleanElem +@ stub VariantGetDoubleElem +@ stub VariantGetElementCount +@ stub VariantGetInt16Elem +@ stub VariantGetInt32Elem +@ stub VariantGetInt64Elem +@ stub VariantGetStringElem +@ stub VariantGetUInt16Elem +@ stub VariantGetUInt32Elem +@ stub VariantGetUInt64Elem +@ stub VariantToBoolean +@ stub VariantToBooleanArray +@ stub VariantToBooleanArrayAlloc +@ stub VariantToBooleanWithDefault +@ stub VariantToBuffer +@ stub VariantToDosDateTime +@ stub VariantToDouble +@ stub VariantToDoubleArray +@ stub VariantToDoubleArrayAlloc +@ stub VariantToDoubleWithDefault +@ stub VariantToFileTime +@ stdcall VariantToGUID(ptr ptr) +@ stub VariantToInt16 +@ stub VariantToInt16Array +@ stub VariantToInt16ArrayAlloc +@ stub VariantToInt16WithDefault +@ stub VariantToInt32 +@ stub VariantToInt32Array +@ stub VariantToInt32ArrayAlloc +@ stub VariantToInt32WithDefault +@ stub VariantToInt64 +@ stub VariantToInt64Array +@ stub VariantToInt64ArrayAlloc +@ stub VariantToInt64WithDefault +@ stub VariantToPropVariant +@ stub VariantToStrRet +@ stub VariantToString +@ stub VariantToStringAlloc +@ stub VariantToStringArray +@ stub VariantToStringArrayAlloc +@ stub VariantToStringWithDefault +@ stub VariantToUInt16 +@ stub VariantToUInt16Array +@ stub VariantToUInt16ArrayAlloc +@ stub VariantToUInt16WithDefault +@ stub VariantToUInt32 +@ stub VariantToUInt32Array +@ stub VariantToUInt32ArrayAlloc +@ stub VariantToUInt32WithDefault +@ stub VariantToUInt64 +@ stub VariantToUInt64Array +@ stub VariantToUInt64ArrayAlloc +@ stub VariantToUInt64WithDefault Propchange: trunk/reactos/dll/win32/propsys/propsys.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propsys_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys_…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys_classes.idl (added) +++ trunk/reactos/dll/win32/propsys/propsys_classes.idl [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,26 @@ +/* + * Coclasses for propsys + * + * Copyright 2012 Vincent Povirk for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +[ + helpstring("Packed Property Storage Object"), + threading(both), + uuid(9a02e012-6303-4e1e-b9a1-630f802592c5) +] +coclass InMemoryPropertyStore { interface IPropertyStoreCache; } Propchange: trunk/reactos/dll/win32/propsys/propsys_classes.idl ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propsys_classes.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys_…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys_classes.rgs (added) +++ trunk/reactos/dll/win32/propsys/propsys_classes.rgs [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,13 @@ +HKCR +{ + NoRemove Interface + { + } + NoRemove CLSID + { + '{9A02E012-6303-4E1E-B9A1-630F802592C5}' = s 'Packed Property Storage Object' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + } +} Propchange: trunk/reactos/dll/win32/propsys/propsys_classes.rgs ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propsys_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys_…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys_main.c (added) +++ trunk/reactos/dll/win32/propsys/propsys_main.c [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,404 @@ +/* + * propsys main + * + * Copyright 1997, 2002 Alexandre Julliard + * Copyright 2008 James Hawkins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#include <config.h> + +#include <stdarg.h> + +#include <windef.h> +#include <winbase.h> +#include <objbase.h> +#include <rpcproxy.h> +#include <propsys.h> +#include <wine/debug.h> +#include <wine/unicode.h> + +#include "propsys_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(propsys); + +static HINSTANCE propsys_hInstance; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + + switch (fdwReason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + propsys_hInstance = hinstDLL; + DisableThreadLibraryCalls(hinstDLL); + break; + case DLL_PROCESS_DETACH: + break; + default: + break; + } + + return TRUE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources( propsys_hInstance ); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources( propsys_hInstance ); +} + +static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv); + *ppv = iface; + }else if(IsEqualGUID(&IID_IClassFactory, riid)) { + TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv); + *ppv = iface; + } + + if(*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) +{ + TRACE("(%p)\n", iface); + return 2; +} + +static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) +{ + TRACE("(%p)\n", iface); + return 1; +} + +static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) +{ + TRACE("(%p)->(%x)\n", iface, fLock); + + return S_OK; +} + +static HRESULT WINAPI InMemoryPropertyStoreFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **ppv) +{ + TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); + + return PropertyStore_CreateInstance(outer, riid, ppv); +} + +static const IClassFactoryVtbl InMemoryPropertyStoreFactoryVtbl = { + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + InMemoryPropertyStoreFactory_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory InMemoryPropertyStoreFactory = { &InMemoryPropertyStoreFactoryVtbl }; + +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) +{ + if(IsEqualGUID(&CLSID_InMemoryPropertyStore, rclsid)) { + TRACE("(CLSID_InMemoryPropertyStore %s %p)\n", debugstr_guid(riid), ppv); + return IClassFactory_QueryInterface(&InMemoryPropertyStoreFactory, riid, ppv); + } + + FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); + return CLASS_E_CLASSNOTAVAILABLE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI PSRegisterPropertySchema(PCWSTR path) +{ + FIXME("%s stub\n", debugstr_w(path)); + + return S_OK; +} + +HRESULT WINAPI PSUnregisterPropertySchema(PCWSTR path) +{ + FIXME("%s stub\n", debugstr_w(path)); + + return E_NOTIMPL; +} + +HRESULT WINAPI PSGetPropertyDescription(REFPROPERTYKEY propkey, REFIID riid, void **ppv) +{ + FIXME("%p, %p, %p\n", propkey, riid, ppv); + return E_NOTIMPL; +} + +HRESULT WINAPI PSRefreshPropertySchema(void) +{ + FIXME("\n"); + return S_OK; +} + +HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY pkey, LPWSTR psz, UINT cch) +{ + static const WCHAR guid_fmtW[] = {'{','%','0','8','X','-','%','0','4','X','-', + '%','0','4','X','-','%','0','2','X','%','0','2','X','-', + '%','0','2','X','%','0','2','X','%','0','2','X', + '%','0','2','X','%','0','2','X','%','0','2','X','}',0}; + static const WCHAR pid_fmtW[] = {'%','u',0}; + + WCHAR pidW[PKEY_PIDSTR_MAX + 1]; + LPWSTR p = psz; + int len; + + TRACE("(%p, %p, %u)\n", pkey, psz, cch); + + if (!psz) + return E_POINTER; + + /* GUIDSTRING_MAX accounts for null terminator, +1 for space character. */ + if (cch <= GUIDSTRING_MAX + 1) + return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + + if (!pkey) + { + psz[0] = '\0'; + return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + } + + sprintfW(psz, guid_fmtW, pkey->fmtid.Data1, pkey->fmtid.Data2, + pkey->fmtid.Data3, pkey->fmtid.Data4[0], pkey->fmtid.Data4[1], + pkey->fmtid.Data4[2], pkey->fmtid.Data4[3], pkey->fmtid.Data4[4], + pkey->fmtid.Data4[5], pkey->fmtid.Data4[6], pkey->fmtid.Data4[7]); + + /* Overwrite the null terminator with the space character. */ + p += GUIDSTRING_MAX - 1; + *p++ = ' '; + cch -= GUIDSTRING_MAX - 1 + 1; + + len = sprintfW(pidW, pid_fmtW, pkey->pid); + + if (cch >= len + 1) + { + strcpyW(p, pidW); + return S_OK; + } + else + { + WCHAR *ptr = pidW + len - 1; + + psz[0] = '\0'; + *p++ = '\0'; + cch--; + + /* Replicate a quirk of the native implementation where the contents + * of the property ID string are written backwards to the output + * buffer, skipping the rightmost digit. */ + if (cch) + { + ptr--; + while (cch--) + *p++ = *ptr--; + } + + return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + } +} + +static const BYTE hex2bin[] = +{ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x00 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x10 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x20 */ + 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, /* 0x30 */ + 0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, /* 0x40 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x50 */ + 0,10,11,12,13,14,15 /* 0x60 */ +}; + +static BOOL validate_indices(LPCWSTR s, int min, int max) +{ + int i; + + for (i = min; i <= max; i++) + { + if (!s[i]) + return FALSE; + + if (i == 0) + { + if (s[i] != '{') + return FALSE; + } + else if (i == 9 || i == 14 || i == 19 || i == 24) + { + if (s[i] != '-') + return FALSE; + } + else if (i == 37) + { + if (s[i] != '}') + return FALSE; + } + else + { + if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0')) + return FALSE; + } + } + + return TRUE; +} + +/* Adapted from CLSIDFromString helper in dlls/ole32/compobj.c and + * UuidFromString in dlls/rpcrt4/rpcrt4_main.c. */ +static BOOL string_to_guid(LPCWSTR s, LPGUID id) +{ + /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */ + + if (!validate_indices(s, 0, 8)) return FALSE; + id->Data1 = (hex2bin[s[1]] << 28 | hex2bin[s[2]] << 24 | hex2bin[s[3]] << 20 | hex2bin[s[4]] << 16 | + hex2bin[s[5]] << 12 | hex2bin[s[6]] << 8 | hex2bin[s[7]] << 4 | hex2bin[s[8]]); + if (!validate_indices(s, 9, 14)) return FALSE; + id->Data2 = hex2bin[s[10]] << 12 | hex2bin[s[11]] << 8 | hex2bin[s[12]] << 4 | hex2bin[s[13]]; + if (!validate_indices(s, 15, 19)) return FALSE; + id->Data3 = hex2bin[s[15]] << 12 | hex2bin[s[16]] << 8 | hex2bin[s[17]] << 4 | hex2bin[s[18]]; + + /* these are just sequential bytes */ + + if (!validate_indices(s, 20, 21)) return FALSE; + id->Data4[0] = hex2bin[s[20]] << 4 | hex2bin[s[21]]; + if (!validate_indices(s, 22, 24)) return FALSE; + id->Data4[1] = hex2bin[s[22]] << 4 | hex2bin[s[23]]; + + if (!validate_indices(s, 25, 26)) return FALSE; + id->Data4[2] = hex2bin[s[25]] << 4 | hex2bin[s[26]]; + if (!validate_indices(s, 27, 28)) return FALSE; + id->Data4[3] = hex2bin[s[27]] << 4 | hex2bin[s[28]]; + if (!validate_indices(s, 29, 30)) return FALSE; + id->Data4[4] = hex2bin[s[29]] << 4 | hex2bin[s[30]]; + if (!validate_indices(s, 31, 32)) return FALSE; + id->Data4[5] = hex2bin[s[31]] << 4 | hex2bin[s[32]]; + if (!validate_indices(s, 33, 34)) return FALSE; + id->Data4[6] = hex2bin[s[33]] << 4 | hex2bin[s[34]]; + if (!validate_indices(s, 35, 37)) return FALSE; + id->Data4[7] = hex2bin[s[35]] << 4 | hex2bin[s[36]]; + + return TRUE; +} + +HRESULT WINAPI PSPropertyKeyFromString(LPCWSTR pszString, PROPERTYKEY *pkey) +{ + int has_minus = 0, has_comma = 0; + + TRACE("(%s, %p)\n", debugstr_w(pszString), pkey); + + if (!pszString || !pkey) + return E_POINTER; + + memset(pkey, 0, sizeof(PROPERTYKEY)); + + if (!string_to_guid(pszString, &pkey->fmtid)) + return E_INVALIDARG; + + pszString += GUIDSTRING_MAX - 1; + + if (!*pszString) + return E_INVALIDARG; + + /* Only the space seems to be recognized as whitespace. The comma is only + * recognized once and processing terminates if another comma is found. */ + while (*pszString == ' ' || *pszString == ',') + { + if (*pszString == ',') + { + if (has_comma) + return S_OK; + else + has_comma = 1; + } + pszString++; + } + + if (!*pszString) + return E_INVALIDARG; + + /* Only two minus signs are recognized if no comma is detected. The first + * sign is ignored, and the second is interpreted. If a comma is detected + * before the minus sign, then only one minus sign counts, and property ID + * interpretation begins with the next character. */ + if (has_comma) + { + if (*pszString == '-') + { + has_minus = 1; + pszString++; + } + } + else + { + if (*pszString == '-') + pszString++; + + /* Skip any intermediate spaces after the first minus sign. */ + while (*pszString == ' ') + pszString++; + + if (*pszString == '-') + { + has_minus = 1; + pszString++; + } + + /* Skip any remaining spaces after minus sign. */ + while (*pszString == ' ') + pszString++; + } + + /* Overflow is not checked. */ + while (isdigitW(*pszString)) + { + pkey->pid *= 10; + pkey->pid += (*pszString - '0'); + pszString++; + } + + if (has_minus) + pkey->pid = ~pkey->pid + 1; + + return S_OK; +} Propchange: trunk/reactos/dll/win32/propsys/propsys_main.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propsys_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys_…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys_private.h (added) +++ trunk/reactos/dll/win32/propsys/propsys_private.h [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,21 @@ +/* + * propsys private definitions + * + * Copyright 2012 Vincent Povirk for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +HRESULT PropertyStore_CreateInstance(IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN; Propchange: trunk/reactos/dll/win32/propsys/propsys_private.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/propsys/propvar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propvar.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propvar.c (added) +++ trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -1,0 +1,603 @@ +/* + * PropVariant implementation + * + * Copyright 2008 James Hawkins for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +//#include <stdarg.h> +#include <stdio.h> + +#define NONAMELESSUNION + +#include <windef.h> +#include <winbase.h> +//#include "winerror.h" +#include <winreg.h> +//#include "winuser.h" +#include <shlobj.h> +#include <propvarutil.h> + +#include <wine/debug.h> +#include <wine/unicode.h> + +WINE_DEFAULT_DEBUG_CHANNEL(propsys); + +static HRESULT PROPVAR_ConvertFILETIME(PROPVARIANT *ppropvarDest, + REFPROPVARIANT propvarSrc, VARTYPE vt) +{ + SYSTEMTIME time; + + FileTimeToSystemTime(&propvarSrc->u.filetime, &time); + + switch (vt) + { + case VT_LPSTR: + { + static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d"; + + ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0, + lstrlenA(format) + 1); + if (!ppropvarDest->u.pszVal) + return E_OUTOFMEMORY; + + sprintf(ppropvarDest->u.pszVal, format, time.wYear, time.wMonth, + time.wDay, time.wHour, time.wMinute, + time.wSecond, time.wMilliseconds); + + return S_OK; + } + + default: + FIXME("Unhandled target type: %d\n", vt); + } + + return E_FAIL; +} + +static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits, + int dest_signed, LONGLONG *res) +{ + int src_signed; + + switch (pv->vt) + { + case VT_I1: + src_signed = 1; + *res = pv->u.cVal; + break; + case VT_UI1: + src_signed = 0; + *res = pv->u.bVal; + break; + case VT_I2: + src_signed = 1; + *res = pv->u.iVal; + break; + case VT_UI2: + src_signed = 0; + *res = pv->u.uiVal; + break; + case VT_I4: + src_signed = 1; + *res = pv->u.lVal; + break; + case VT_UI4: + src_signed = 0; + *res = pv->u.ulVal; + break; + case VT_I8: + src_signed = 1; + *res = pv->u.hVal.QuadPart; + break; + case VT_UI8: + src_signed = 0; + *res = pv->u.uhVal.QuadPart; + break; + case VT_EMPTY: + src_signed = 0; + *res = 0; + break; + default: + FIXME("unhandled vt %d\n", pv->vt); + return E_NOTIMPL; + } + + if (*res < 0 && src_signed != dest_signed) + return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); + + if (dest_bits < 64) + { + if (dest_signed) + { + if (*res >= ((LONGLONG)1 << (dest_bits-1)) || + *res < ((LONGLONG)-1 << (dest_bits-1))) + return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); + } + else + { + if ((ULONGLONG)(*res) >= ((ULONGLONG)1 << dest_bits)) + return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); + } + } + + return S_OK; +} + +HRESULT WINAPI PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret) +{ + LONGLONG res; + HRESULT hr; + + TRACE("%p,%p\n", propvarIn, ret); + + hr = PROPVAR_ConvertNumber(propvarIn, 16, 1, &res); + if (SUCCEEDED(hr)) *ret = (SHORT)res; + return hr; +} + +HRESULT WINAPI PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret) +{ + LONGLONG res; + HRESULT hr; + + TRACE("%p,%p\n", propvarIn, ret); + + hr = PROPVAR_ConvertNumber(propvarIn, 32, 1, &res); + if (SUCCEEDED(hr)) *ret = (LONG)res; + return hr; +} + +HRESULT WINAPI PropVariantToInt64(REFPROPVARIANT propvarIn, LONGLONG *ret) +{ + LONGLONG res; + HRESULT hr; + + TRACE("%p,%p\n", propvarIn, ret); + + hr = PROPVAR_ConvertNumber(propvarIn, 64, 1, &res); + if (SUCCEEDED(hr)) *ret = (LONGLONG)res; + return hr; +} + +HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret) +{ + LONGLONG res; + HRESULT hr; + + TRACE("%p,%p\n", propvarIn, ret); + + hr = PROPVAR_ConvertNumber(propvarIn, 16, 0, &res); + if (SUCCEEDED(hr)) *ret = (USHORT)res; + return hr; +} + +HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret) +{ + LONGLONG res; + HRESULT hr; + + TRACE("%p,%p\n", propvarIn, ret); + + hr = PROPVAR_ConvertNumber(propvarIn, 32, 0, &res); + if (SUCCEEDED(hr)) *ret = (ULONG)res; + return hr; +} + +HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret) +{ + LONGLONG res; + HRESULT hr; + + TRACE("%p,%p\n", propvarIn, ret); + + hr = PROPVAR_ConvertNumber(propvarIn, 64, 0, &res); + if (SUCCEEDED(hr)) *ret = (ULONGLONG)res; + return hr; +} + +/****************************************************************** + * PropVariantChangeType (PROPSYS.@) + */ +HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, + PROPVAR_CHANGE_FLAGS flags, VARTYPE vt) +{ + HRESULT hr; + + FIXME("(%p, %p, %d, %d, %d): semi-stub!\n", ppropvarDest, propvarSrc, + propvarSrc->vt, flags, vt); + + switch (vt) + { + case VT_I2: + { + SHORT res; + hr = PropVariantToInt16(propvarSrc, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_I2; + ppropvarDest->u.iVal = res; + } + return hr; + } + case VT_UI2: + { + USHORT res; + hr = PropVariantToUInt16(propvarSrc, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_UI2; + ppropvarDest->u.uiVal = res; + } + return hr; + } + case VT_I4: + { + LONG res; + hr = PropVariantToInt32(propvarSrc, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_I4; + ppropvarDest->u.lVal = res; + } + return hr; + } + case VT_UI4: + { + ULONG res; + hr = PropVariantToUInt32(propvarSrc, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_UI4; + ppropvarDest->u.ulVal = res; + } + return hr; + } + case VT_I8: + { + LONGLONG res; + hr = PropVariantToInt64(propvarSrc, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_I8; + ppropvarDest->u.hVal.QuadPart = res; + } + return hr; + } + case VT_UI8: + { + ULONGLONG res; + hr = PropVariantToUInt64(propvarSrc, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_UI8; + ppropvarDest->u.uhVal.QuadPart = res; + } + return hr; + } + } + + switch (propvarSrc->vt) + { + case VT_FILETIME: + return PROPVAR_ConvertFILETIME(ppropvarDest, propvarSrc, vt); + default: + FIXME("Unhandled source type: %d\n", propvarSrc->vt); + } + + return E_FAIL; +} + +static void PROPVAR_GUIDToWSTR(REFGUID guid, WCHAR *str) +{ + static const WCHAR format[] = {'{','%','0','8','X','-','%','0','4','X','-','%','0','4','X', + '-','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2','X', + '%','0','2','X','%','0','2','X','%','0','2','X','}',0}; + + sprintfW(str, format, guid->Data1, guid->Data2, guid->Data3, + guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], + guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); +} + +HRESULT WINAPI InitPropVariantFromGUIDAsString(REFGUID guid, PROPVARIANT *ppropvar) +{ + TRACE("(%p %p)\n", guid, ppropvar); + + if(!guid) + return E_FAIL; + + ppropvar->vt = VT_LPWSTR; + ppropvar->u.pwszVal = CoTaskMemAlloc(39*sizeof(WCHAR)); + if(!ppropvar->u.pwszVal) + return E_OUTOFMEMORY; + + PROPVAR_GUIDToWSTR(guid, ppropvar->u.pwszVal); + return S_OK; +} + +HRESULT WINAPI InitVariantFromGUIDAsString(REFGUID guid, VARIANT *pvar) +{ + TRACE("(%p %p)\n", guid, pvar); + + if(!guid) { + FIXME("guid == NULL\n"); + return E_FAIL; + } + + V_VT(pvar) = VT_BSTR; + V_BSTR(pvar) = SysAllocStringLen(NULL, 38); + if(!V_BSTR(pvar)) + return E_OUTOFMEMORY; + + PROPVAR_GUIDToWSTR(guid, V_BSTR(pvar)); + return S_OK; +} + +HRESULT WINAPI InitPropVariantFromBuffer(const VOID *pv, UINT cb, PROPVARIANT *ppropvar) +{ + TRACE("(%p %u %p)\n", pv, cb, ppropvar); + + ppropvar->u.caub.pElems = CoTaskMemAlloc(cb); + if(!ppropvar->u.caub.pElems) + return E_OUTOFMEMORY; + + ppropvar->vt = VT_VECTOR|VT_UI1; + ppropvar->u.caub.cElems = cb; + memcpy(ppropvar->u.caub.pElems, pv, cb); + return S_OK; +} + +HRESULT WINAPI InitVariantFromBuffer(const VOID *pv, UINT cb, VARIANT *pvar) +{ + SAFEARRAY *arr; + void *data; + HRESULT hres; + + TRACE("(%p %u %p)\n", pv, cb, pvar); + + arr = SafeArrayCreateVector(VT_UI1, 0, cb); + if(!arr) + return E_OUTOFMEMORY; + + hres = SafeArrayAccessData(arr, &data); + if(FAILED(hres)) { + SafeArrayDestroy(arr); + return hres; + } + + memcpy(data, pv, cb); + + hres = SafeArrayUnaccessData(arr); + if(FAILED(hres)) { + SafeArrayDestroy(arr); + return hres; + } + + V_VT(pvar) = VT_ARRAY|VT_UI1; + V_ARRAY(pvar) = arr; + return S_OK; +} + +static inline DWORD PROPVAR_HexToNum(const WCHAR *hex) +{ + DWORD ret; + + if(hex[0]>='0' && hex[0]<='9') + ret = hex[0]-'0'; + else if(hex[0]>='a' && hex[0]<='f') + ret = hex[0]-'a'+10; + else if(hex[0]>='A' && hex[0]<='F') + ret = hex[0]-'A'+10; + else + return -1; + + ret <<= 4; + if(hex[1]>='0' && hex[1]<='9') + return ret + hex[1]-'0'; + else if(hex[1]>='a' && hex[1]<='f') + return ret + hex[1]-'a'+10; + else if(hex[1]>='A' && hex[1]<='F') + return ret + hex[1]-'A'+10; + else + return -1; +} + +static inline HRESULT PROPVAR_WCHARToGUID(const WCHAR *str, int len, GUID *guid) +{ + DWORD i, val=0; + const WCHAR *p; + + memset(guid, 0, sizeof(GUID)); + + if(len!=38 || str[0]!='{' || str[9]!='-' || str[14]!='-' + || str[19]!='-' || str[24]!='-' || str[37]!='}') { + WARN("Error parsing %s\n", debugstr_w(str)); + return E_INVALIDARG; + } + + p = str+1; + for(i=0; i<4 && val!=-1; i++) { + val = PROPVAR_HexToNum(p); + guid->Data1 = (guid->Data1<<8) + val; + p += 2; + } + p++; + for(i=0; i<2 && val!=-1; i++) { + val = PROPVAR_HexToNum(p); + guid->Data2 = (guid->Data2<<8) + val; + p += 2; + } + p++; + for(i=0; i<2 && val!=-1; i++) { + val = PROPVAR_HexToNum(p); + guid->Data3 = (guid->Data3<<8) + val; + p += 2; + } + p++; + for(i=0; i<8 && val!=-1; i++) { + if(i == 2) + p++; + + val = guid->Data4[i] = PROPVAR_HexToNum(p); + p += 2; + } + + if(val == -1) { + WARN("Error parsing %s\n", debugstr_w(str)); + memset(guid, 0, sizeof(GUID)); + return E_INVALIDARG; + } + return S_OK; +} + +HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid) +{ + TRACE("%p %p)\n", ppropvar, guid); + + switch(ppropvar->vt) { + case VT_BSTR: + return PROPVAR_WCHARToGUID(ppropvar->u.bstrVal, SysStringLen(ppropvar->u.bstrVal), guid); + case VT_LPWSTR: + return PROPVAR_WCHARToGUID(ppropvar->u.pwszVal, strlenW(ppropvar->u.pwszVal), guid); + + default: + FIXME("unsupported vt: %d\n", ppropvar->vt); + return E_NOTIMPL; + } +} + +HRESULT WINAPI VariantToGUID(const VARIANT *pvar, GUID *guid) +{ + TRACE("(%p %p)\n", pvar, guid); + + switch(V_VT(pvar)) { + case VT_BSTR: { + HRESULT hres = PROPVAR_WCHARToGUID(V_BSTR(pvar), SysStringLen(V_BSTR(pvar)), guid); + if(hres == E_INVALIDARG) + return E_FAIL; + return hres; + } + + default: + FIXME("unsupported vt: %d\n", V_VT(pvar)); + return E_NOTIMPL; + } +} + +static int isemptyornull(const PROPVARIANT *propvar) +{ + if (propvar->vt == VT_EMPTY || propvar->vt == VT_NULL) + return 1; + if ((propvar->vt & VT_ARRAY) == VT_ARRAY) + { + int i; + for (i=0; i<propvar->u.parray->cDims; i++) + { + if (propvar->u.parray->rgsabound[i].cElements != 0) + break; + } + return i == propvar->u.parray->cDims; + } + /* FIXME: vectors, byrefs, errors? */ + return 0; +} + +INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, + PROPVAR_COMPARE_UNIT unit, PROPVAR_COMPARE_FLAGS flags) +{ + const PROPVARIANT *propvar2_converted; + PROPVARIANT propvar2_static; + HRESULT hr; + INT res=-1; + + TRACE("%p,%p,%x,%x\n", propvar1, propvar2, unit, flags); + + if (isemptyornull(propvar1)) + { + if (isemptyornull(propvar2)) + return 0; + return (flags & PVCF_TREATEMPTYASGREATERTHAN) ? 1 : -1; + } + + if (isemptyornull(propvar2)) + return (flags & PVCF_TREATEMPTYASGREATERTHAN) ? -1 : 1; + + if (propvar1->vt != propvar2->vt) + { + hr = PropVariantChangeType(&propvar2_static, propvar2, 0, propvar1->vt); + + if (FAILED(hr)) + return -1; + + propvar2_converted = &propvar2_static; + } + else + propvar2_converted = propvar2; + +#define CMP_INT_VALUE(var) do { \ + if (propvar1->u.var > propvar2_converted->u.var) \ + res = 1; \ + else if (propvar1->u.var < propvar2_converted->u.var) \ + res = -1; \ + else \ + res = 0; \ + } while (0) + + switch (propvar1->vt) + { + case VT_I1: + CMP_INT_VALUE(cVal); + break; + case VT_UI1: + CMP_INT_VALUE(bVal); + break; + case VT_I2: + CMP_INT_VALUE(iVal); + break; + case VT_UI2: + CMP_INT_VALUE(uiVal); + break; + case VT_I4: + CMP_INT_VALUE(lVal); + break; + case VT_UI4: + CMP_INT_VALUE(uiVal); + break; + case VT_I8: + CMP_INT_VALUE(hVal.QuadPart); + break; + case VT_UI8: + CMP_INT_VALUE(uhVal.QuadPart); + break; + case VT_BSTR: + /* FIXME: Use string flags. */ + res = lstrcmpW(propvar1->u.bstrVal, propvar2->u.bstrVal); + break; + default: + FIXME("vartype %d not handled\n", propvar1->vt); + res = -1; + break; + } + + if (propvar2_converted == &propvar2_static) + PropVariantClear(&propvar2_static); + + return res; +} Propchange: trunk/reactos/dll/win32/propsys/propvar.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Mar 22 12:08:04 2013 @@ -142,6 +142,7 @@ reactos/dll/win32/pidgen # Synced to Wine-1.5.19 reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Synced to Wine-1.5.4 +reactos/dll/win32/propsys # Synced to Wine-1.5.26 reactos/dll/win32/pstorec # Synced to Wine-1.5.4 reactos/dll/win32/qmgr # Synced to Wine-1.2-rc5? reactos/dll/win32/qmgrprxy # Synced to Wine-1.14?
11 years, 9 months
1
0
0
0
[akhaldi] 58566: [PSDK] * Update propvarutil.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 12:02:09 2013 New Revision: 58566 URL:
http://svn.reactos.org/svn/reactos?rev=58566&view=rev
Log: [PSDK] * Update propvarutil.h. Modified: trunk/reactos/include/psdk/propvarutil.h Modified: trunk/reactos/include/psdk/propvarutil.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/propvarutil.h…
============================================================================== --- trunk/reactos/include/psdk/propvarutil.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/propvarutil.h [iso-8859-1] Fri Mar 22 12:02:09 2013 @@ -19,7 +19,6 @@ #ifndef __WINE_PROPVARUTIL_H #define __WINE_PROPVARUTIL_H -#include <propidl.h> #include <shtypes.h> #include <shlwapi.h> @@ -35,7 +34,85 @@ typedef int PROPVAR_CHANGE_FLAGS; +enum tagPROPVAR_COMPARE_UNIT +{ + PVCU_DEFAULT = 0x00000000, + PVCU_SECOND = 0x00000001, + PVCU_MINUTE = 0x00000002, + PVCU_HOUR = 0x00000003, + PVCU_DAY = 0x00000004, + PVCU_MONTH = 0x00000005, + PVCU_YEAR = 0x00000006, +}; + +typedef int PROPVAR_COMPARE_UNIT; + +enum tagPROPVAR_COMPARE_FLAGS +{ + PVCF_DEFAULT = 0x00000000, + PVCF_TREATEMPTYASGREATERTHAN = 0x00000001, + PVCF_USESTRCMP = 0x00000002, + PVCF_USESTRCMPC = 0x00000004, + PVCF_USESTRCMPI = 0x00000008, + PVCF_USESTRCMPIC = 0x00000010, +}; + +typedef int PROPVAR_COMPARE_FLAGS; + HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, PROPVAR_CHANGE_FLAGS flags, VARTYPE vt); +HRESULT WINAPI InitPropVariantFromGUIDAsString(REFGUID guid, PROPVARIANT *ppropvar); +HRESULT WINAPI InitVariantFromGUIDAsString(REFGUID guid, VARIANT *pvar); +HRESULT WINAPI InitPropVariantFromBuffer(const VOID *pv, UINT cb, PROPVARIANT *ppropvar); +HRESULT WINAPI InitVariantFromBuffer(const VOID *pv, UINT cb, VARIANT *pvar); +HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid); +HRESULT WINAPI VariantToGUID(const VARIANT *pvar, GUID *guid); +INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2, + PROPVAR_COMPARE_UNIT uint, PROPVAR_COMPARE_FLAGS flags); + +HRESULT WINAPI PropVariantToInt16(REFPROPVARIANT propvarIn, SHORT *ret); +HRESULT WINAPI PropVariantToInt32(REFPROPVARIANT propvarIn, LONG *ret); +HRESULT WINAPI PropVariantToInt64(REFPROPVARIANT propvarIn, LONGLONG *ret); +HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret); +HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret); +HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret); + +#ifdef __cplusplus + +HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar); +HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar); +HRESULT InitPropVariantFromInt64(LONGLONG llVal, PROPVARIANT *ppropvar); + +#ifndef NO_PROPVAR_INLINES + +inline HRESULT InitPropVariantFromBoolean(BOOL fVal, PROPVARIANT *ppropvar) +{ + ppropvar->vt = VT_BOOL; + ppropvar->boolVal = fVal ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; +} + +inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar) +{ + HRESULT hres; + + hres = SHStrDupW(psz, &ppropvar->pwszVal); + if(SUCCEEDED(hres)) + ppropvar->vt = VT_LPWSTR; + else + PropVariantInit(ppropvar); + + return hres; +} + +inline HRESULT InitPropVariantFromInt64(LONGLONG llVal, PROPVARIANT *ppropvar) +{ + ppropvar->vt = VT_I8; + ppropvar->hVal.QuadPart = llVal; + return S_OK; +} + +#endif +#endif #endif /* __WINE_PROPVARUTIL_H */
11 years, 9 months
1
0
0
0
[akhaldi] 58565: [CRT] * Annotate mbstring.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 12:00:26 2013 New Revision: 58565 URL:
http://svn.reactos.org/svn/reactos?rev=58565&view=rev
Log: [CRT] * Annotate mbstring.h. Modified: trunk/reactos/include/crt/mbstring.h Modified: trunk/reactos/include/crt/mbstring.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mbstring.h?rev…
============================================================================== --- trunk/reactos/include/crt/mbstring.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/mbstring.h [iso-8859-1] Fri Mar 22 12:00:26 2013 @@ -31,100 +31,791 @@ #ifndef _MBSTRING_DEFINED #define _MBSTRING_DEFINED - _CRTIMP unsigned char *__cdecl _mbsdup(const unsigned char *_Str); - _CRTIMP unsigned int __cdecl _mbbtombc(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbbtombc_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _mbbtype(unsigned char _Ch,int _CType); - _CRTIMP int __cdecl _mbbtype_l(unsigned char _Ch,int _CType,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbctombb(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbctombb_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _mbsbtype(const unsigned char *_Str,size_t _Pos); - _CRTIMP int __cdecl _mbsbtype_l(const unsigned char *_Str,size_t _Pos,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbscat(unsigned char *_Dest,const unsigned char *_Source); - _CRTIMP unsigned char *_mbscat_l(unsigned char *_Dest,const unsigned char *_Source,_locale_t _Locale); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbschr(const unsigned char *_Str,unsigned int _Ch); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbschr_l(const unsigned char *_Str,unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _mbscmp(const unsigned char *_Str1,const unsigned char *_Str2); - _CRTIMP int __cdecl _mbscmp_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); - _CRTIMP int __cdecl _mbscoll(const unsigned char *_Str1,const unsigned char *_Str2); - _CRTIMP int __cdecl _mbscoll_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbscpy(unsigned char *_Dest,const unsigned char *_Source); - _CRTIMP unsigned char *_mbscpy_l(unsigned char *_Dest,const unsigned char *_Source,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbscspn(const unsigned char *_Str,const unsigned char *_Control); - _CRTIMP size_t __cdecl _mbscspn_l(const unsigned char *_Str,const unsigned char *_Control,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsdec(const unsigned char *_Start,const unsigned char *_Pos); - _CRTIMP unsigned char *__cdecl _mbsdec_l(const unsigned char *_Start,const unsigned char *_Pos,_locale_t _Locale); - _CRTIMP int __cdecl _mbsicmp(const unsigned char *_Str1,const unsigned char *_Str2); - _CRTIMP int __cdecl _mbsicmp_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); - _CRTIMP int __cdecl _mbsicoll(const unsigned char *_Str1,const unsigned char *_Str2); - _CRTIMP int __cdecl _mbsicoll_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsinc(const unsigned char *_Ptr); - _CRTIMP unsigned char *__cdecl _mbsinc_l(const unsigned char *_Ptr,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbslen(const unsigned char *_Str); - _CRTIMP size_t __cdecl _mbslen_l(const unsigned char *_Str,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbsnlen(const unsigned char *_Str,size_t _MaxCount); - _CRTIMP size_t __cdecl _mbsnlen_l(const unsigned char *_Str,size_t _MaxCount,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbslwr(unsigned char *_String); - _CRTIMP unsigned char *_mbslwr_l(unsigned char *_String,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsnbcat(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); - _CRTIMP unsigned char *__cdecl _mbsnbcat_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); - _CRTIMP int __cdecl _mbsnbcmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsnbcmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP int __cdecl _mbsnbcoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsnbcoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbsnbcnt(const unsigned char *_Str,size_t _MaxCount); - _CRTIMP size_t __cdecl _mbsnbcnt_l(const unsigned char *_Str,size_t _MaxCount,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsnbcpy(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); - _CRTIMP int __cdecl _mbsnbcpy_s(unsigned char* dst, size_t size, const unsigned char* src, size_t n); - _CRTIMP unsigned char *__cdecl _mbsnbcpy_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); - _CRTIMP int __cdecl _mbsnbicmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsnbicmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP int __cdecl _mbsnbicoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsnbicoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsnbset(unsigned char *_Str,unsigned int _Ch,size_t _MaxCount); - _CRTIMP unsigned char *__cdecl _mbsnbset_l(unsigned char *_Str,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsncat(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); - _CRTIMP unsigned char *__cdecl _mbsncat_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbsnccnt(const unsigned char *_Str,size_t _MaxCount); - _CRTIMP size_t __cdecl _mbsnccnt_l(const unsigned char *_Str,size_t _MaxCount,_locale_t _Locale); - _CRTIMP int __cdecl _mbsncmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsncmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP int __cdecl _mbsncoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsncoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsncpy(unsigned char *_Dest,const unsigned char *_Source,size_t _Count); - _CRTIMP unsigned char *__cdecl _mbsncpy_l(unsigned char *_Dest,const unsigned char *_Source,size_t _Count,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbsnextc (const unsigned char *_Str); - _CRTIMP unsigned int __cdecl _mbsnextc_l(const unsigned char *_Str,_locale_t _Locale); - _CRTIMP int __cdecl _mbsnicmp(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsnicmp_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP int __cdecl _mbsnicoll(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount); - _CRTIMP int __cdecl _mbsnicoll_l(const unsigned char *_Str1,const unsigned char *_Str2,size_t _MaxCount,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsninc(const unsigned char *_Str,size_t _Count); - _CRTIMP unsigned char *__cdecl _mbsninc_l(const unsigned char *_Str,size_t _Count,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsnset(unsigned char *_Dst,unsigned int _Val,size_t _MaxCount); - _CRTIMP unsigned char *__cdecl _mbsnset_l(unsigned char *_Dst,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbspbrk(const unsigned char *_Str,const unsigned char *_Control); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbspbrk_l(const unsigned char *_Str,const unsigned char *_Control,_locale_t _Locale); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsrchr(const unsigned char *_Str,unsigned int _Ch); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsrchr_l(const unsigned char *_Str,unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsrev(unsigned char *_Str); - _CRTIMP unsigned char *__cdecl _mbsrev_l(unsigned char *_Str,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsset(unsigned char *_Str,unsigned int _Val); - _CRTIMP unsigned char *__cdecl _mbsset_l(unsigned char *_Str,unsigned int _Val,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbsspn(const unsigned char *_Str,const unsigned char *_Control); - _CRTIMP size_t __cdecl _mbsspn_l(const unsigned char *_Str,const unsigned char *_Control,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsspnp(const unsigned char *_Str1,const unsigned char *_Str2); - _CRTIMP unsigned char *__cdecl _mbsspnp_l(const unsigned char *_Str1,const unsigned char *_Str2,_locale_t _Locale); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsstr(const unsigned char *_Str,const unsigned char *_Substr); - _CRTIMP _CONST_RETURN unsigned char *__cdecl _mbsstr_l(const unsigned char *_Str,const unsigned char *_Substr,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbstok(unsigned char *_Str,const unsigned char *_Delim); - _CRTIMP unsigned char *__cdecl _mbstok_l(unsigned char *_Str,const unsigned char *_Delim,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbsupr(unsigned char *_String); - _CRTIMP unsigned char *_mbsupr_l(unsigned char *_String,_locale_t _Locale); - _CRTIMP size_t __cdecl _mbclen(const unsigned char *_Str); - _CRTIMP size_t __cdecl _mbclen_l(const unsigned char *_Str,_locale_t _Locale); - _CRTIMP void __cdecl _mbccpy(unsigned char *_Dst,const unsigned char *_Src); - _CRTIMP void __cdecl _mbccpy_l(unsigned char *_Dst,const unsigned char *_Src,_locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsdup( + _In_z_ const unsigned char *_Str); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbbtombc( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbbtombc_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbbtype( + _In_ unsigned char _Ch, + _In_ int _CType); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbbtype_l( + _In_ unsigned char _Ch, + _In_ int _CType, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctombb( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctombb_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _CRTIMP + int + __cdecl + _mbsbtype( + _In_reads_bytes_(_Pos) _Pre_z_ const unsigned char *_Str, + _In_ size_t _Pos); + + _CRTIMP + int + __cdecl + _mbsbtype_l( + _In_reads_bytes_(_Pos) _Pre_z_ const unsigned char *_Str, + _In_ size_t _Pos, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbscat( + _Inout_updates_z_(_String_length_(_Curr_) + _String_length_(_Source) + 1) unsigned char *_Dest, + _In_z_ const unsigned char *_Source); + + _CRTIMP + unsigned char* + _mbscat_l( + _Inout_z_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbschr( + _In_z_ const unsigned char *_Str, + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbschr_l( + _In_z_ const unsigned char *_Str, + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbscmp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbscmp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbscoll( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbscoll_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbscpy( + _Out_writes_z_(_String_length_(_Source) + 1) unsigned char *_Dest, + _In_z_ const unsigned char *_Source); + + _CRTIMP + unsigned char* + _mbscpy_l( + _Pre_notnull_ _Post_z_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbscspn( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Control); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbscspn_l( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Control, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsdec( + _In_reads_z_(_Pos-_Start + 1) const unsigned char *_Start, + _In_z_ const unsigned char *_Pos); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsdec_l( + _In_reads_z_(_Pos-_Start + 1) const unsigned char *_Start, + _In_z_ const unsigned char *_Pos, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsicmp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsicmp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsicoll( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsicoll_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsinc( + _In_z_ const unsigned char *_Ptr); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsinc_l( + _In_z_ const unsigned char *_Ptr, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbslen( + _In_z_ const unsigned char *_Str); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbslen_l( + _In_z_ const unsigned char *_Str, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsnlen( + _In_z_ const unsigned char *_Str, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsnlen_l( + _In_z_ const unsigned char *_Str, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbslwr( + _Inout_z_ unsigned char *_String); + + _CRTIMP + unsigned char* + _mbslwr_l( + _Inout_z_ unsigned char *_String, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsnbcat( + _Inout_z_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count); + + _CRTIMP + unsigned char* + __cdecl + _mbsnbcat_l( + _Inout_z_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbcmp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbcmp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbcoll( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbcoll_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsnbcnt( + _In_reads_bytes_(_MaxCount) _Pre_z_ const unsigned char *_Str, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsnbcnt_l( + _In_reads_bytes_(_MaxCount) _Pre_z_ const unsigned char *_Str, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsnbcpy( + _Out_writes_(_Count) _Post_maybez_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count); + + _CRTIMP + int + __cdecl + _mbsnbcpy_s( + _Out_writes_z_(size) unsigned char* dst, + _In_ size_t size, + _In_z_ const unsigned char* src, + _In_ size_t n); + + _CRTIMP + unsigned char* + __cdecl + _mbsnbcpy_l( + _Out_writes_(_Count) _Post_maybez_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbicmp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbicmp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbicoll( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnbicoll_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsnbset( + _Inout_updates_z_(_MaxCount) unsigned char *_Str, + _In_ unsigned int _Ch, + _In_ size_t _MaxCount); + + _CRTIMP + unsigned char* + __cdecl + _mbsnbset_l( + _Inout_updates_z_(_MaxCount) unsigned char *_Str, + _In_ unsigned int _Ch, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsncat( + _Inout_z_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count); + + _CRTIMP + unsigned char* + __cdecl + _mbsncat_l( + _Inout_z_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsnccnt( + _In_reads_bytes_(_MaxCount) _Pre_z_ const unsigned char *_Str, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsnccnt_l( + _In_reads_bytes_(_MaxCount) _Pre_z_ const unsigned char *_Str, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsncmp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsncmp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsncoll( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsncoll_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsncpy( + _Pre_notnull_ _Out_writes_(2 * _Count) _Post_maybez_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count); + + _CRTIMP + unsigned char* + __cdecl + _mbsncpy_l( + _Out_writes_(_Count) _Post_maybez_ unsigned char *_Dest, + _In_z_ const unsigned char *_Source, + _In_ size_t _Count, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbsnextc( + _In_z_ const unsigned char *_Str); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbsnextc_l( + _In_z_ const unsigned char *_Str, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnicmp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnicmp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnicoll( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount); + + _Check_return_ + _CRTIMP + int + __cdecl + _mbsnicoll_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsninc( + _In_reads_bytes_(_Count) _Pre_z_ const unsigned char *_Str, + _In_ size_t _Count); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsninc_l( + _In_reads_bytes_(_Count) _Pre_z_ const unsigned char *_Str, + _In_ size_t _Count, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsnset( + _Inout_updates_z_(_MaxCount) unsigned char *_Dst, + _In_ unsigned int _Val, + _In_ size_t _MaxCount); + + _CRTIMP + unsigned char* + __cdecl + _mbsnset_l( + _Inout_updates_z_(_MaxCount) unsigned char *_Dst, + _In_ unsigned int _Val, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbspbrk( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Control); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbspbrk_l( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Control, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbsrchr( + _In_z_ const unsigned char *_Str, + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbsrchr_l( + _In_z_ const unsigned char *_Str, + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsrev( + _Inout_z_ unsigned char *_Str); + + _CRTIMP + unsigned char* + __cdecl + _mbsrev_l( + _Inout_z_ unsigned char *_Str, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsset( + _Inout_z_ unsigned char *_Str, + _In_ unsigned int _Val); + + _CRTIMP + unsigned char* + __cdecl + _mbsset_l( + _Inout_z_ unsigned char *_Str, + _In_ unsigned int _Val, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsspn( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Control); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbsspn_l( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Control, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsspnp( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbsspnp_l( + _In_z_ const unsigned char *_Str1, + _In_z_ const unsigned char *_Str2, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbsstr( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Substr); + + _Check_return_ + _CRTIMP + _CONST_RETURN + unsigned char* + __cdecl + _mbsstr_l( + _In_z_ const unsigned char *_Str, + _In_z_ const unsigned char *_Substr, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbstok( + _Inout_opt_z_ unsigned char *_Str, + _In_z_ const unsigned char *_Delim); + + _Check_return_ + _CRTIMP + unsigned char* + __cdecl + _mbstok_l( + _Inout_opt_z_ unsigned char *_Str, + _In_z_ const unsigned char *_Delim, + _In_opt_ _locale_t _Locale); + + _CRTIMP + unsigned char* + __cdecl + _mbsupr( + _Inout_z_ unsigned char *_String); + + _CRTIMP + unsigned char* + _mbsupr_l( + _Inout_z_ unsigned char *_String, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbclen( + _In_z_ const unsigned char *_Str); + + _Check_return_ + _CRTIMP + size_t + __cdecl + _mbclen_l( + _In_z_ const unsigned char *_Str, + _In_opt_ _locale_t _Locale); + + _CRTIMP + void + __cdecl + _mbccpy( + _Out_writes_bytes_(2) unsigned char *_Dst, + _In_z_ const unsigned char *_Src); + + _CRTIMP + void + __cdecl + _mbccpy_l( + _Out_writes_bytes_(2) unsigned char *_Dst, + _In_z_ const unsigned char *_Src, + _In_opt_ _locale_t _Locale); + #define _mbccmp(_cpc1,_cpc2) _mbsncmp((_cpc1),(_cpc2),1) #ifdef __cplusplus @@ -143,64 +834,406 @@ #endif #endif - _CRTIMP int __cdecl _ismbcalnum(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcalnum_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcalpha(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcalpha_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcdigit(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcdigit_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcgraph(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcgraph_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbclegal(unsigned int _Ch); - _CRTIMP int __cdecl _ismbclegal_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbclower(unsigned int _Ch); - _CRTIMP int __cdecl _ismbclower_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcprint(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcprint_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcpunct(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcpunct_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcspace(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcspace_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcupper(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcupper_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbctolower(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbctolower_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbctoupper(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbctoupper_l(unsigned int _Ch,_locale_t _Locale); -#endif + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcalnum( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcalnum_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcalpha( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcalpha_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcdigit( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcdigit_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcgraph( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcgraph_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbclegal( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbclegal_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbclower( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbclower_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcprint( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcprint_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcpunct( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcpunct_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcspace( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcspace_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcupper( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + __cdecl _ismbcupper_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctolower( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctolower_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctoupper( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctoupper_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + +#endif /* _MBSTRING_DEFINED */ #ifndef _MBLEADTRAIL_DEFINED #define _MBLEADTRAIL_DEFINED - _CRTIMP int __cdecl _ismbblead(unsigned int _Ch); - _CRTIMP int __cdecl _ismbblead_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbbtrail(unsigned int _Ch); - _CRTIMP int __cdecl _ismbbtrail_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbslead(const unsigned char *_Str,const unsigned char *_Pos); - _CRTIMP int __cdecl _ismbslead_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale); - _CRTIMP int __cdecl _ismbstrail(const unsigned char *_Str,const unsigned char *_Pos); - _CRTIMP int __cdecl _ismbstrail_l(const unsigned char *_Str,const unsigned char *_Pos,_locale_t _Locale); -#endif - - _CRTIMP int __cdecl _ismbchira(unsigned int _Ch); - _CRTIMP int __cdecl _ismbchira_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbckata(unsigned int _Ch); - _CRTIMP int __cdecl _ismbckata_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcsymbol(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcsymbol_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcl0(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcl0_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcl1(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcl1_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP int __cdecl _ismbcl2(unsigned int _Ch); - _CRTIMP int __cdecl _ismbcl2_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbcjistojms(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbcjistojms_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbcjmstojis(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbcjmstojis_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbctohira(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbctohira_l(unsigned int _Ch,_locale_t _Locale); - _CRTIMP unsigned int __cdecl _mbctokata(unsigned int _Ch); - _CRTIMP unsigned int __cdecl _mbctokata_l(unsigned int _Ch,_locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbblead( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbblead_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbbtrail( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbbtrail_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbslead( + _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str, + _In_z_ const unsigned char *_Pos); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbslead_l( + _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str, + _In_z_ const unsigned char *_Pos, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbstrail( + _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str, + _In_z_ const unsigned char *_Pos); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbstrail_l( + _In_reads_z_(_Pos - _Str + 1) const unsigned char *_Str, + _In_z_ const unsigned char *_Pos, + _In_opt_ _locale_t _Locale); + +#endif /* _MBLEADTRAIL_DEFINED */ + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbchira( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbchira_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbckata( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbckata_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcsymbol( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcsymbol_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcl0( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcl0_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcl1( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcl1_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcl2( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + int + __cdecl + _ismbcl2_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbcjistojms( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbcjistojms_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbcjmstojis( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbcjmstojis_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctohira( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctohira_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctokata( + _In_ unsigned int _Ch); + + _Check_return_ + _CRTIMP + unsigned int + __cdecl + _mbctokata_l( + _In_ unsigned int _Ch, + _In_opt_ _locale_t _Locale); #ifdef __cplusplus } @@ -210,4 +1243,4 @@ #include <sec_api/mbstring_s.h> -#endif +#endif /* _INC_MBSTRING */
11 years, 9 months
1
0
0
0
[spetreolle] 58564: [HIVES] No need for NAME_ON_CD anymore since the multi arch hive files implementation. (r58271)
by spetreolle@svn.reactos.org
Author: spetreolle Date: Thu Mar 21 00:10:58 2013 New Revision: 58564 URL:
http://svn.reactos.org/svn/reactos?rev=58564&view=rev
Log: [HIVES] No need for NAME_ON_CD anymore since the multi arch hive files implementation. (r58271) Modified: trunk/reactos/boot/bootdata/CMakeLists.txt Modified: trunk/reactos/boot/bootdata/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/CMakeLists.t…
============================================================================== --- trunk/reactos/boot/bootdata/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/CMakeLists.txt [iso-8859-1] Thu Mar 21 00:10:58 2013 @@ -3,10 +3,10 @@ #common hives add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/txtsetup.sif DESTINATION reactos NO_CAB FOR bootcd regtest) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivecls.inf DESTINATION reactos NO_CAB NAME_ON_CD hivecls.inf FOR bootcd regtest) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivedef.inf DESTINATION reactos NO_CAB NAME_ON_CD hivedef.inf FOR bootcd regtest) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesft.inf DESTINATION reactos NO_CAB NAME_ON_CD hivesft.inf FOR bootcd regtest) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesys.inf DESTINATION reactos NO_CAB NAME_ON_CD hivesys.inf FOR bootcd regtest) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivecls.inf DESTINATION reactos NO_CAB FOR bootcd regtest) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivedef.inf DESTINATION reactos NO_CAB FOR bootcd regtest) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesft.inf DESTINATION reactos NO_CAB FOR bootcd regtest) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesys.inf DESTINATION reactos NO_CAB FOR bootcd regtest) # livecd hives list(APPEND CD_HIVES
11 years, 9 months
1
0
0
0
[jimtabor] 58563: - Add missing file for revision 58562.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Mar 20 22:34:48 2013 New Revision: 58563 URL:
http://svn.reactos.org/svn/reactos?rev=58563&view=rev
Log: - Add missing file for revision 58562. Modified: trunk/reactos/win32ss/include/ntuser.h Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
============================================================================== --- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Wed Mar 20 22:34:48 2013 @@ -3310,6 +3310,7 @@ #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050 #define TWOPARAM_ROUTINE_EXITREACTOS 0xfffd0051 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052 +#define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE 0xfffd0053 #define MSQ_STATE_CAPTURE 0x1 #define MSQ_STATE_ACTIVE 0x2 #define MSQ_STATE_FOCUS 0x3
11 years, 9 months
1
0
0
0
[jimtabor] 58562: [Win32k|User32] - Use set foreground instead of setting active during a mouse click. Add support hack since this should be handled on server side. - This is an ATI patch fix.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Mar 20 22:31:42 2013 New Revision: 58562 URL:
http://svn.reactos.org/svn/reactos?rev=58562&view=rev
Log: [Win32k|User32] - Use set foreground instead of setting active during a mouse click. Add support hack since this should be handled on server side. - This is an ATI patch fix. Modified: trunk/reactos/win32ss/user/ntuser/focus.c trunk/reactos/win32ss/user/ntuser/focus.h trunk/reactos/win32ss/user/ntuser/simplecall.c trunk/reactos/win32ss/user/user32/windows/nonclient.c Modified: trunk/reactos/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] Wed Mar 20 22:31:42 2013 @@ -866,6 +866,17 @@ API Call */ BOOL FASTCALL +co_IntSetForegroundWindowMouse(PWND Window) +{ + if (Window) ASSERT_REFS_CO(Window); + + return co_IntSetForegroundAndFocusWindow(Window, TRUE); +} + +/* + API Call +*/ +BOOL FASTCALL IntLockSetForegroundWindow(UINT uLockCode) { ULONG Err = ERROR_ACCESS_DENIED; Modified: trunk/reactos/win32ss/user/ntuser/focus.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/focus.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/focus.h [iso-8859-1] Wed Mar 20 22:31:42 2013 @@ -19,5 +19,6 @@ BOOL FASTCALL co_IntMouseActivateWindow(PWND Window); BOOL FASTCALL co_IntSetForegroundWindow(PWND Window); BOOL FASTCALL co_IntSetActiveWindow(PWND,HWND *,BOOL,BOOL,BOOL); +BOOL FASTCALL co_IntSetForegroundWindowMouse(PWND Window); BOOL FASTCALL IntLockSetForegroundWindow(UINT uLockCode); BOOL FASTCALL IntAllowSetForegroundWindow(DWORD dwProcessId); Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Wed Mar 20 22:31:42 2013 @@ -577,6 +577,12 @@ TRACE("co_IntSetForegroundWindow 2 \n"); break; + case HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE: + TRACE("co_IntSetForegroundWindow 1 0x%p\n",hWnd); + Ret = co_IntSetForegroundWindowMouse(Window); + TRACE("co_IntSetForegroundWindow 2 0x%p\n",hWnd); + break; + case HWNDLOCK_ROUTINE_UPDATEWINDOW: Ret = co_UserRedrawWindow( Window, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN); break; Modified: trunk/reactos/win32ss/user/user32/windows/nonclient.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/nonclient.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/nonclient.c [iso-8859-1] Wed Mar 20 22:31:42 2013 @@ -987,7 +987,8 @@ case HTCAPTION: { HWND hTopWnd = GetAncestor(hWnd, GA_ROOT); - if (SetActiveWindow(hTopWnd) || GetActiveWindow() == hTopWnd) + if ( NtUserCallHwndLock(hTopWnd, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE) || + GetActiveWindow() == hTopWnd) { SendMessageW(hWnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam); }
11 years, 9 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
25
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
Results per page:
10
25
50
100
200