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
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2006
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
595 discussions
Start a n
N
ew thread
[jimtabor] 22523: GetGlyphOutline, large wine port. Still testing.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jun 23 16:29:38 2006 New Revision: 22523 URL:
http://svn.reactos.ru/svn/reactos?rev=22523&view=rev
Log: GetGlyphOutline, large wine port. Still testing. Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj…
============================================================================== --- trunk/reactos/
…
[View More]
subsystems/win32/win32k/objects/text.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/text.c Fri Jun 23 16:29:38 2006 @@ -29,6 +29,10 @@ #include <ft2build.h> #include FT_FREETYPE_H #include <freetype/tttables.h> +#include <freetype/fttrigon.h> +#include <freetype/ftglyph.h> +#include <freetype/ftoutln.h> +#include <freetype/ftwinfnt.h> #define NDEBUG #include <debug.h> @@ -2227,6 +2231,44 @@ return 0; } +static +void +FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt) +{ + pt->x.value = vec->x >> 6; + pt->x.fract = (vec->x & 0x3f) << 10; + pt->x.fract |= ((pt->x.fract >> 6) | (pt->x.fract >> 12)); + pt->y.value = vec->y >> 6; + pt->y.fract = (vec->y & 0x3f) << 10; + pt->y.fract |= ((pt->y.fract >> 6) | (pt->y.fract >> 12)); + return; +} + +/* + This function builds an FT_Fixed from a float. It puts the integer part + in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed. + It fails if the integer part of the float number is greater than SHORT_MAX. +*/ +static inline FT_Fixed FT_FixedFromFloat(float f) +{ + short value = f; + unsigned short fract = (f - value) * 0xFFFF; + return (FT_Fixed)((long)value << 16 | (unsigned long)fract); +} + +/* + This function builds an FT_Fixed from a FIXED. It simply put f.value + in the highest 16 bits and f.fract in the lowest 16 bits of the FT_Fixed. +*/ +static inline FT_Fixed FT_FixedFromFIXED(FIXED f) +{ + return (FT_Fixed)((long)f.value << 16 | (unsigned long)f.fract); +} + +/* + * Based on WineEngGetGlyphOutline + * + */ ULONG APIENTRY NtGdiGetGlyphOutline( @@ -2235,12 +2277,631 @@ IN UINT iFormat, OUT LPGLYPHMETRICS pgm, IN ULONG cjBuf, - OUT OPTIONAL PVOID pvBuf, + OUT OPTIONAL PVOID UnsafeBuf, IN LPMAT2 pmat2, IN BOOL bIgnoreRotation) { - UNIMPLEMENTED; - return 0; + static const FT_Matrix identityMat = {(1 << 16), 0, 0, (1 << 16)}; + PDC dc; + PTEXTOBJ TextObj; + PFONTGDI FontGDI; + HFONT hFont = 0; + NTSTATUS Status; + GLYPHMETRICS gm; + ULONG Size; + FT_Face ft_face; + FT_UInt glyph_index; + DWORD width, height, pitch, needed = 0; + FT_Bitmap ft_bitmap; + FT_Error error; + INT left, right, top = 0, bottom = 0; + FT_Angle angle = 0; + FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; + FLOAT eM11, widthRatio = 1.0; + FT_Matrix transMat = identityMat; + BOOL needsTransform = FALSE; + INT orientation; + LONG aveWidth; + INT adv, lsb, bbx; /* These three hold to widths of the unrotated chars */ + OUTLINETEXTMETRICW *potm; + PVOID pvBuf = NULL; + + DPRINT("%p, %d, %08x, %p, %08lx, %p, %p\n", hdc, wch, iFormat, pgm, + cjBuf, UnsafeBuf, pmat2); + + dc = DC_LockDc(hdc); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return GDI_ERROR; + } + eM11 = dc->w.xformWorld2Vport.eM11; + hFont = dc->w.hFont; + TextObj = TEXTOBJ_LockText(hFont); + DC_UnlockDc(dc); + if (!TextObj) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return GDI_ERROR; + } + FontGDI = ObjToGDI(TextObj->Font, FONT); + ft_face = FontGDI->face; + + aveWidth = FT_IS_SCALABLE(ft_face) ? TextObj->logfont.lfWidth: 0; + orientation = FT_IS_SCALABLE(ft_face) ? TextObj->logfont.lfOrientation: 0; + + Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL); + potm = ExAllocatePoolWithTag(PagedPool, Size, TAG_GDITEXT); + if (!potm) + { + SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); + TEXTOBJ_UnlockText(TextObj); + return GDI_ERROR; + } + IntGetOutlineTextMetrics(FontGDI, Size, potm); + + IntLockFreeType; + + /* During testing, I never saw this used. In here just incase.*/ + if (ft_face->charmap == NULL) + { + DPRINT("WARNING: No charmap selected!\n"); + DPRINT("This font face has %d charmaps\n", ft_face->num_charmaps); + int n; + FT_CharMap found = 0, charmap; + + for (n = 0; n < ft_face->num_charmaps; n++) + { + charmap = ft_face->charmaps[n]; + DPRINT("found charmap encoding: %u\n", charmap->encoding); + if (charmap->encoding != 0) + { + found = charmap; + break; + } + } + if (!found) + { + DPRINT1("WARNING: Could not find desired charmap!\n"); + } + error = FT_Set_Charmap(ft_face, found); + if (error) + { + DPRINT1("WARNING: Could not set the charmap!\n"); + } + } + +// FT_Set_Pixel_Sizes(ft_face, +// TextObj->logfont.lfWidth, + /* FIXME should set character height if neg */ +// (TextObj->logfont.lfHeight < 0 ? - TextObj->logfont.lfHeight : +// TextObj->logfont.lfHeight == 0 ? 11 : TextObj->logfont.lfHeight)); + + TEXTOBJ_UnlockText(TextObj); + + if (iFormat & GGO_GLYPH_INDEX) + { + glyph_index = wch; + iFormat &= ~GGO_GLYPH_INDEX; + } + else glyph_index = FT_Get_Char_Index(ft_face, wch); + + if (orientation || (iFormat != GGO_METRICS && iFormat != GGO_BITMAP) || aveWidth || pmat2) + load_flags |= FT_LOAD_NO_BITMAP; + + error = FT_Load_Glyph(ft_face, glyph_index, load_flags); + if (error) + { + DPRINT1("WARNING: Failed to load and render glyph! [index: %u]\n", glyph_index); + IntUnLockFreeType; + if (potm) ExFreePool(potm); + return GDI_ERROR; + } + IntUnLockFreeType; + + if (aveWidth && potm) + { + widthRatio = (FLOAT)aveWidth * eM11 / + (FLOAT) potm->otmTextMetrics.tmAveCharWidth; + } + + left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; + right = (INT)((ft_face->glyph->metrics.horiBearingX + + ft_face->glyph->metrics.width) * widthRatio + 63) & -64; + + adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; + lsb = left >> 6; + bbx = (right - left) >> 6; + + DPRINT("Advance = %d, lsb = %d, bbx = %d\n",adv, lsb, bbx); + + IntLockFreeType; + + /* Scaling transform */ + if (aveWidth) + { + FT_Matrix scaleMat; + DPRINT("Scaling Trans!\n"); + scaleMat.xx = FT_FixedFromFloat(widthRatio); + scaleMat.xy = 0; + scaleMat.yx = 0; + scaleMat.yy = (1 << 16); + FT_Matrix_Multiply(&scaleMat, &transMat); + needsTransform = TRUE; + } + + /* Slant transform */ + if (potm->otmTextMetrics.tmItalic) + { + FT_Matrix slantMat; + DPRINT("Slant Trans!\n"); + slantMat.xx = (1 << 16); + slantMat.xy = ((1 << 16) >> 2); + slantMat.yx = 0; + slantMat.yy = (1 << 16); + FT_Matrix_Multiply(&slantMat, &transMat); + needsTransform = TRUE; + } + + /* Rotation transform */ + if (orientation) + { + FT_Matrix rotationMat; + FT_Vector vecAngle; + DPRINT("Rotation Trans!\n"); + angle = FT_FixedFromFloat((float)orientation / 10.0); + FT_Vector_Unit(&vecAngle, angle); + rotationMat.xx = vecAngle.x; + rotationMat.xy = -vecAngle.y; + rotationMat.yx = -rotationMat.xy; + rotationMat.yy = rotationMat.xx; + FT_Matrix_Multiply(&rotationMat, &transMat); + needsTransform = TRUE; + } + + /* Extra transformation specified by caller */ + if (pmat2) + { + FT_Matrix extraMat; + DPRINT("MAT2 Matrix Trans!\n"); + extraMat.xx = FT_FixedFromFIXED(pmat2->eM11); + extraMat.xy = FT_FixedFromFIXED(pmat2->eM21); + extraMat.yx = FT_FixedFromFIXED(pmat2->eM12); + extraMat.yy = FT_FixedFromFIXED(pmat2->eM22); + FT_Matrix_Multiply(&extraMat, &transMat); + needsTransform = TRUE; + } + + if (potm) ExFreePool(potm); /* It looks like we are finished with potm ATM.*/ + + if (!needsTransform) + { + DPRINT("No Need to be Transformed!\n"); + top = (ft_face->glyph->metrics.horiBearingY + 63) & -64; + bottom = (ft_face->glyph->metrics.horiBearingY - + ft_face->glyph->metrics.height) & -64; + gm.gmCellIncX = adv; + gm.gmCellIncY = 0; + } + else + { + INT xc, yc; + FT_Vector vec; + for(xc = 0; xc < 2; xc++) + { + for(yc = 0; yc < 2; yc++) + { + vec.x = (ft_face->glyph->metrics.horiBearingX + + xc * ft_face->glyph->metrics.width); + vec.y = ft_face->glyph->metrics.horiBearingY - + yc * ft_face->glyph->metrics.height; + DPRINT("Vec %ld,%ld\n", vec.x, vec.y); + FT_Vector_Transform(&vec, &transMat); + if(xc == 0 && yc == 0) + { + left = right = vec.x; + top = bottom = vec.y; + } + else + { + if(vec.x < left) left = vec.x; + else if(vec.x > right) right = vec.x; + if(vec.y < bottom) bottom = vec.y; + else if(vec.y > top) top = vec.y; + } + } + } + left = left & -64; + right = (right + 63) & -64; + bottom = bottom & -64; + top = (top + 63) & -64; + + DPRINT("transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom); + vec.x = ft_face->glyph->metrics.horiAdvance; + vec.y = 0; + FT_Vector_Transform(&vec, &transMat); + gm.gmCellIncX = (vec.x+63) >> 6; + gm.gmCellIncY = -((vec.y+63) >> 6); + } + gm.gmBlackBoxX = (right - left) >> 6; + gm.gmBlackBoxY = (top - bottom) >> 6; + gm.gmptGlyphOrigin.x = left >> 6; + gm.gmptGlyphOrigin.y = top >> 6; + + DPRINT("CX %d CY %d BBX %d BBY %d GOX %d GOY %d\n", + gm.gmCellIncX, gm.gmCellIncY, + gm.gmBlackBoxX, gm.gmBlackBoxY, + gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.y); + + IntUnLockFreeType; + + if (pgm) + { + Status = MmCopyToCaller(pgm, &gm, sizeof(GLYPHMETRICS)); + if (! NT_SUCCESS(Status)) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return GDI_ERROR; + } + DPRINT("Copied GLYPHMETRICS to User!\n"); + } + + if (iFormat == GGO_METRICS) + { + DPRINT("GGO_METRICS Exit!\n"); + return 1; /* FIXME */ + } + + if (ft_face->glyph->format != ft_glyph_format_outline && iFormat != GGO_BITMAP) + { + DPRINT1("loaded a bitmap\n"); + return GDI_ERROR; + } + + if (UnsafeBuf && cjBuf) + { + pvBuf = ExAllocatePoolWithTag(PagedPool, cjBuf, TAG_GDITEXT); + if (pvBuf == NULL) + { + SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); + return GDI_ERROR; + } + RtlZeroMemory(pvBuf, cjBuf); + } + + + switch(iFormat) + { + case GGO_BITMAP: + width = gm.gmBlackBoxX; + height = gm.gmBlackBoxY; + pitch = ((width + 31) >> 5) << 2; + needed = pitch * height; + + if(!pvBuf || !cjBuf) break; + + switch(ft_face->glyph->format) + { + case ft_glyph_format_bitmap: + { + BYTE *src = ft_face->glyph->bitmap.buffer, *dst = pvBuf; + INT w = (ft_face->glyph->bitmap.width + 7) >> 3; + INT h = ft_face->glyph->bitmap.rows; + while(h--) + { + RtlCopyMemory(dst, src, w); + src += ft_face->glyph->bitmap.pitch; + dst += pitch; + } + break; + } + + case ft_glyph_format_outline: + ft_bitmap.width = width; + ft_bitmap.rows = height; + ft_bitmap.pitch = pitch; + ft_bitmap.pixel_mode = ft_pixel_mode_mono; + ft_bitmap.buffer = pvBuf; + + IntLockFreeType; + if(needsTransform) + { + FT_Outline_Transform(&ft_face->glyph->outline, &transMat); + } + FT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom ); + /* Note: FreeType will only set 'black' bits for us. */ + RtlZeroMemory(pvBuf, needed); + FT_Outline_Get_Bitmap(library, &ft_face->glyph->outline, &ft_bitmap); + IntUnLockFreeType; + break; + + default: + DPRINT1("loaded glyph format %x\n", ft_face->glyph->format); + if(pvBuf) ExFreePool(pvBuf); + return GDI_ERROR; + } + break; + + case GGO_GRAY2_BITMAP: + case GGO_GRAY4_BITMAP: + case GGO_GRAY8_BITMAP: + { + unsigned int mult, row, col; + BYTE *start, *ptr; + + width = gm.gmBlackBoxX; + height = gm.gmBlackBoxY; + pitch = (width + 3) / 4 * 4; + needed = pitch * height; + + if(!pvBuf || !cjBuf) break; + + ft_bitmap.width = width; + ft_bitmap.rows = height; + ft_bitmap.pitch = pitch; + ft_bitmap.pixel_mode = ft_pixel_mode_grays; + ft_bitmap.buffer = pvBuf; + + IntLockFreeType; + if(needsTransform) + { + FT_Outline_Transform(&ft_face->glyph->outline, &transMat); + } + FT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom ); + RtlZeroMemory(ft_bitmap.buffer, cjBuf); + FT_Outline_Get_Bitmap(library, &ft_face->glyph->outline, &ft_bitmap); + IntUnLockFreeType; + + if(iFormat == GGO_GRAY2_BITMAP) + mult = 4; + else if(iFormat == GGO_GRAY4_BITMAP) + mult = 16; + else if(iFormat == GGO_GRAY8_BITMAP) + mult = 64; + else + { + ASSERT(0); + break; + } + + start = pvBuf; + for(row = 0; row < height; row++) + { + ptr = start; + for(col = 0; col < width; col++, ptr++) + { + *ptr = (((int)*ptr) * mult + 128) / 256; + } + start += pitch; + } + break; + } + + case GGO_NATIVE: + { + int contour, point = 0, first_pt; + FT_Outline *outline = &ft_face->glyph->outline; + TTPOLYGONHEADER *pph; + TTPOLYCURVE *ppc; + DWORD pph_start, cpfx, type; + + if(cjBuf == 0) pvBuf = NULL; /* This is okay, need cjBuf to allocate. */ + + IntLockFreeType; + if (needsTransform && pvBuf) FT_Outline_Transform(outline, &transMat); + + for(contour = 0; contour < outline->n_contours; contour++) + { + pph_start = needed; + pph = (TTPOLYGONHEADER *)((char *)pvBuf + needed); + first_pt = point; + if(pvBuf) + { + pph->dwType = TT_POLYGON_TYPE; + FTVectorToPOINTFX(&outline->points[point], &pph->pfxStart); + } + needed += sizeof(*pph); + point++; + while(point <= outline->contours[contour]) + { + ppc = (TTPOLYCURVE *)((char *)pvBuf + needed); + type = (outline->tags[point] & FT_Curve_Tag_On) ? + TT_PRIM_LINE : TT_PRIM_QSPLINE; + cpfx = 0; + do + { + if(pvBuf) + FTVectorToPOINTFX(&outline->points[point], &ppc->apfx[cpfx]); + cpfx++; + point++; + } while(point <= outline->contours[contour] && + (outline->tags[point] & FT_Curve_Tag_On) == + (outline->tags[point-1] & FT_Curve_Tag_On)); + + /* At the end of a contour Windows adds the start point, but + only for Beziers */ + if(point > outline->contours[contour] && + !(outline->tags[point-1] & FT_Curve_Tag_On)) + { + if(pvBuf) + FTVectorToPOINTFX(&outline->points[first_pt], &ppc->apfx[cpfx]); + cpfx++; + } + else if(point <= outline->contours[contour] && + outline->tags[point] & FT_Curve_Tag_On) + { + /* add closing pt for bezier */ + if(pvBuf) + FTVectorToPOINTFX(&outline->points[point], &ppc->apfx[cpfx]); + cpfx++; + point++; + } + if(pvBuf) + { + ppc->wType = type; + ppc->cpfx = cpfx; + } + needed += sizeof(*ppc) + (cpfx - 1) * sizeof(POINTFX); + } + if(pvBuf) pph->cb = needed - pph_start; + } + IntUnLockFreeType; + break; + } + case GGO_BEZIER: + { + /* Convert the quadratic Beziers to cubic Beziers. + The parametric eqn for a cubic Bezier is, from PLRM: + r(t) = at^3 + bt^2 + ct + r0 + with the control points: + r1 = r0 + c/3 + r2 = r1 + (c + b)/3 + r3 = r0 + c + b + a + + A quadratic Beizer has the form: + p(t) = (1-t)^2 p0 + 2(1-t)t p1 + t^2 p2 + + So equating powers of t leads to: + r1 = 2/3 p1 + 1/3 p0 + r2 = 2/3 p1 + 1/3 p2 + and of course r0 = p0, r3 = p2 + */ + + int contour, point = 0, first_pt; + FT_Outline *outline = &ft_face->glyph->outline; + TTPOLYGONHEADER *pph; + TTPOLYCURVE *ppc; + DWORD pph_start, cpfx, type; + FT_Vector cubic_control[4]; + if(cjBuf == 0) pvBuf = NULL; + + if (needsTransform && pvBuf) + { + IntLockFreeType; + FT_Outline_Transform(outline, &transMat); + IntUnLockFreeType; + } + + for(contour = 0; contour < outline->n_contours; contour++) + { + pph_start = needed; + pph = (TTPOLYGONHEADER *)((char *)pvBuf + needed); + first_pt = point; + if(pvBuf) + { + pph->dwType = TT_POLYGON_TYPE; + FTVectorToPOINTFX(&outline->points[point], &pph->pfxStart); + } + needed += sizeof(*pph); + point++; + while(point <= outline->contours[contour]) + { + ppc = (TTPOLYCURVE *)((char *)pvBuf + needed); + type = (outline->tags[point] & FT_Curve_Tag_On) ? + TT_PRIM_LINE : TT_PRIM_CSPLINE; + cpfx = 0; + do + { + if(type == TT_PRIM_LINE) + { + if(pvBuf) + FTVectorToPOINTFX(&outline->points[point], &ppc->apfx[cpfx]); + cpfx++; + point++; + } + else + { + /* Unlike QSPLINEs, CSPLINEs always have their endpoint + so cpfx = 3n */ + + /* FIXME: Possible optimization in endpoint calculation + if there are two consecutive curves */ + cubic_control[0] = outline->points[point-1]; + if(!(outline->tags[point-1] & FT_Curve_Tag_On)) + { + cubic_control[0].x += outline->points[point].x + 1; + cubic_control[0].y += outline->points[point].y + 1; + cubic_control[0].x >>= 1; + cubic_control[0].y >>= 1; + } + if(point+1 > outline->contours[contour]) + cubic_control[3] = outline->points[first_pt]; + else + { + cubic_control[3] = outline->points[point+1]; + if(!(outline->tags[point+1] & FT_Curve_Tag_On)) + { + cubic_control[3].x += outline->points[point].x + 1; + cubic_control[3].y += outline->points[point].y + 1; + cubic_control[3].x >>= 1; + cubic_control[3].y >>= 1; + } + } + /* r1 = 1/3 p0 + 2/3 p1 + r2 = 1/3 p2 + 2/3 p1 */ + cubic_control[1].x = (2 * outline->points[point].x + 1) / 3; + cubic_control[1].y = (2 * outline->points[point].y + 1) / 3; + cubic_control[2] = cubic_control[1]; + cubic_control[1].x += (cubic_control[0].x + 1) / 3; + cubic_control[1].y += (cubic_control[0].y + 1) / 3; + cubic_control[2].x += (cubic_control[3].x + 1) / 3; + cubic_control[2].y += (cubic_control[3].y + 1) / 3; + if(pvBuf) + { + FTVectorToPOINTFX(&cubic_control[1], &ppc->apfx[cpfx]); + FTVectorToPOINTFX(&cubic_control[2], &ppc->apfx[cpfx+1]); + FTVectorToPOINTFX(&cubic_control[3], &ppc->apfx[cpfx+2]); + } + cpfx += 3; + point++; + } + } + while(point <= outline->contours[contour] && + (outline->tags[point] & FT_Curve_Tag_On) == + (outline->tags[point-1] & FT_Curve_Tag_On)); + /* At the end of a contour Windows adds the start point, + but only for Beziers and we've already done that. + */ + if(point <= outline->contours[contour] && + outline->tags[point] & FT_Curve_Tag_On) + { + /* This is the closing pt of a bezier, but we've already + added it, so just inc point and carry on */ + point++; + } + if(pvBuf) + { + ppc->wType = type; + ppc->cpfx = cpfx; + } + needed += sizeof(*ppc) + (cpfx - 1) * sizeof(POINTFX); + } + if(pvBuf) pph->cb = needed - pph_start; + } + break; + } + + default: + DPRINT1("Unsupported format %d\n", iFormat); + if(pvBuf) ExFreePool(pvBuf); + return GDI_ERROR; + } + + if (pvBuf) + { + Status = MmCopyToCaller(UnsafeBuf, pvBuf, cjBuf); + if (! NT_SUCCESS(Status)) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + ExFreePool(pvBuf); + return GDI_ERROR; + } + DPRINT("NtGdiGetGlyphOutline K -> U worked!\n"); + ExFreePool(pvBuf); + } + + DPRINT("NtGdiGetGlyphOutline END and needed %d\n", needed); + return needed; } DWORD
[View Less]
18 years, 12 months
1
0
0
0
[hpoussin] 22522: Fix retrieving of NTP server from registry Set svn:eol-style and svn:keywords properties
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri Jun 23 12:13:50 2006 New Revision: 22522 URL:
http://svn.reactos.ru/svn/reactos?rev=22522&view=rev
Log: Fix retrieving of NTP server from registry Set svn:eol-style and svn:keywords properties Modified: trunk/reactos/dll/cpl/timedate/Cz.rc (props changed) trunk/reactos/dll/cpl/timedate/Dk.rc (props changed) trunk/reactos/dll/cpl/timedate/Es.rc (props changed) trunk/reactos/dll/cpl/timedate/Fr.rc (props changed) trunk/reactos/dll/cpl/
…
[View More]
timedate/Gr.rc (props changed) trunk/reactos/dll/cpl/timedate/Hu.rc (contents, props changed) trunk/reactos/dll/cpl/timedate/It.rc (contents, props changed) trunk/reactos/dll/cpl/timedate/Ja.rc (props changed) trunk/reactos/dll/cpl/timedate/Nl.rc (props changed) trunk/reactos/dll/cpl/timedate/Pl.rc (props changed) trunk/reactos/dll/cpl/timedate/Ru.rc (props changed) trunk/reactos/dll/cpl/timedate/Sv.rc (props changed) trunk/reactos/dll/cpl/timedate/clock.c (contents, props changed) trunk/reactos/dll/cpl/timedate/dateandtime.c (contents, props changed) trunk/reactos/dll/cpl/timedate/internettime.c (contents, props changed) trunk/reactos/dll/cpl/timedate/monthcal.c (contents, props changed) trunk/reactos/dll/cpl/timedate/ntpclient.c (contents, props changed) trunk/reactos/dll/cpl/timedate/timezone.c (contents, props changed) [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/cpl/timedate/Hu.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/Hu.rc?rev=…
Modified: trunk/reactos/dll/cpl/timedate/It.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/It.rc?rev=…
Modified: trunk/reactos/dll/cpl/timedate/clock.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/clock.c?re…
Modified: trunk/reactos/dll/cpl/timedate/dateandtime.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/dateandtim…
Modified: trunk/reactos/dll/cpl/timedate/internettime.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/internetti…
Modified: trunk/reactos/dll/cpl/timedate/monthcal.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/monthcal.c…
Modified: trunk/reactos/dll/cpl/timedate/ntpclient.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/ntpclient.…
Modified: trunk/reactos/dll/cpl/timedate/timezone.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/timedate/timezone.c…
[View Less]
18 years, 12 months
1
0
0
0
[ion] 22521: - Cache system static information, such as PAGE_SIZE at kernel32 startup, so we can reference it in our code without always quertying the system for it.
by ion@svn.reactos.org
Author: ion Date: Fri Jun 23 03:44:17 2006 New Revision: 22521 URL:
http://svn.reactos.ru/svn/reactos?rev=22521&view=rev
Log: - Cache system static information, such as PAGE_SIZE at kernel32 startup, so we can reference it in our code without always quertying the system for it. Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dll…
===========
…
[View More]
=================================================================== --- trunk/reactos/dll/win32/kernel32/misc/dllmain.c (original) +++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c Fri Jun 23 03:44:17 2006 @@ -55,6 +55,8 @@ #define WIN_OBJ_DIR L"\\Windows" #define SESSION_DIR L"\\Sessions" + +SYSTEM_BASIC_INFORMATION BaseCachedSysInfo; /* FUNCTIONS *****************************************************************/ @@ -382,6 +384,17 @@ return FALSE; } + /* Cache static system information */ + Status = ZwQuerySystemInformation(SystemBasicInformation, + &BaseCachedSysInfo, + sizeof(BaseCachedSysInfo), + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failure to get system information\n"); + return FALSE; + } + /* Insert more dll attach stuff here! */ DllInitialized = TRUE; DPRINT("Initialization complete\n");
[View Less]
18 years, 12 months
1
0
0
0
[ion] 22520: [AUDIT] - Unlock Thomas's low resource notification code, since it's clean. - Entirely rewrite Kernel32 Probe functions to um, actually probe (ported Thomas's code in the kernel and adjusted for user-mode and then checked with WINE's code). I can't begin to fathom what the previous routines were supposed to be doing.
by ion@svn.reactos.org
Author: ion Date: Fri Jun 23 03:40:50 2006 New Revision: 22520 URL:
http://svn.reactos.ru/svn/reactos?rev=22520&view=rev
Log: [AUDIT] - Unlock Thomas's low resource notification code, since it's clean. - Entirely rewrite Kernel32 Probe functions to um, actually probe (ported Thomas's code in the kernel and adjusted for user-mode and then checked with WINE's code). I can't begin to fathom what the previous routines were supposed to be doing. Modified: trunk/reactos/dll/win32/kernel32/
…
[View More]
mem/isbad.c trunk/reactos/dll/win32/kernel32/mem/procmem.c (props changed) trunk/reactos/dll/win32/kernel32/mem/resnotify.c (props changed) trunk/reactos/dll/win32/kernel32/mem/section.c (props changed) trunk/reactos/dll/win32/kernel32/mem/virtual.c (props changed) trunk/reactos/include/ndk/mmfuncs.h Modified: trunk/reactos/dll/win32/kernel32/mem/isbad.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/isba…
============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/isbad.c (original) +++ trunk/reactos/dll/win32/kernel32/mem/isbad.c Fri Jun 23 03:40:50 2006 @@ -1,259 +1,246 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries +/* + * PROJECT: ReactOS Win32 Base API + * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/kernel32/mem/isbad.c - * PURPOSE: - * PROGRAMMER: Ariadne ( ariadne(a)xs4all.nl) - * Ge van Geldorp - * Filip Navara - * UPDATE HISTORY: - * Created 03/10/99 - */ + * PURPOSE: Handles probing of memory addresses + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) + * Thomas Weidenmueller (w3seek(a)reactos.org) + */ + +/* INCLUDES ******************************************************************/ #include <k32.h> #define NDEBUG -#include "../include/debug.h" - -/* FIXME: Stubs. What is it for? */ -/* - * @implemented - */ -UINT -wcsnlen ( - LPCWSTR lpsz, - UINT ucchMax - ) -{ - UINT i = 0; - while( i < ucchMax && lpsz[i] ) i++; - return i; -} - - -/* FIXME: Stubs. What is it for? */ -/* - * @implemented - */ -UINT -strnlen ( - LPCSTR lpsz, - UINT uiMax - ) -{ - UINT i = 0; - while( i < uiMax && lpsz[i] ) i++; - return i; -} - -/* --- --- --- */ +#include "debug.h" + +extern SYSTEM_BASIC_INFORMATION BaseCachedSysInfo; + +/* FUNCTIONS *****************************************************************/ /* * @implemented */ BOOL STDCALL -IsBadReadPtr ( - CONST VOID * lp, - UINT ucb - ) -{ - MEMORY_BASIC_INFORMATION MemoryInformation; - - if ( ucb == 0 ) - { - return TRUE; - } - - VirtualQuery ( - lp, - & MemoryInformation, - sizeof (MEMORY_BASIC_INFORMATION) - ); - - if ( MemoryInformation.State != MEM_COMMIT ) - { - return TRUE; - } - - if ( MemoryInformation.RegionSize < ucb ) - { - return TRUE; - } - - if ( MemoryInformation.Protect == PAGE_EXECUTE ) - { - return TRUE; - } - - if ( MemoryInformation.Protect == PAGE_NOACCESS ) - { - return TRUE; - } - - return FALSE; - -} - - -/* - * @implemented - */ -BOOL -STDCALL -IsBadHugeReadPtr ( - CONST VOID * lp, - UINT ucb - ) -{ - return IsBadReadPtr (lp, ucb); -} - - -/* - * @implemented - */ -BOOL -STDCALL -IsBadCodePtr ( - FARPROC lpfn - ) -{ - MEMORY_BASIC_INFORMATION MemoryInformation; - - - VirtualQuery ( - lpfn, - & MemoryInformation, - sizeof (MEMORY_BASIC_INFORMATION) - ); - - if ( MemoryInformation.State != MEM_COMMIT ) - { - return TRUE; - } - - if ( (MemoryInformation.Protect == PAGE_EXECUTE) - || (MemoryInformation.Protect == PAGE_EXECUTE_READ) - ) - { - return FALSE; - } - - return TRUE; -} - - -/* - * @implemented - */ -BOOL -STDCALL -IsBadWritePtr ( - LPVOID lp, - UINT ucb - ) -{ - MEMORY_BASIC_INFORMATION MemoryInformation; - - if ( ucb == 0 ) - { - return TRUE; - } - - VirtualQuery ( - lp, - & MemoryInformation, - sizeof (MEMORY_BASIC_INFORMATION) - ); - - if ( MemoryInformation.State != MEM_COMMIT ) - { - return TRUE; - } - - if ( MemoryInformation.RegionSize < ucb ) - { - return TRUE; - } - - - if ( MemoryInformation.Protect == PAGE_READONLY) - { - return TRUE; - } - - if ( (MemoryInformation.Protect == PAGE_EXECUTE) - || (MemoryInformation.Protect == PAGE_EXECUTE_READ) - ) - { - return TRUE; - } - - if ( MemoryInformation.Protect == PAGE_NOACCESS ) - { - return TRUE; - } - - return FALSE; -} - - -/* - * @implemented - */ -BOOL -STDCALL -IsBadHugeWritePtr ( - LPVOID lp, - UINT ucb - ) -{ - return IsBadWritePtr (lp, ucb); -} - - -/* - * @implemented - */ -BOOL -STDCALL -IsBadStringPtrW ( - LPCWSTR lpsz, - UINT ucchMax - ) -{ - UINT Len = wcsnlen ( - lpsz + 1, - ucchMax >> 1 - ); - return IsBadReadPtr ( - lpsz, - Len << 1 - ); -} - - -/* - * @implemented - */ -BOOL -STDCALL -IsBadStringPtrA ( - LPCSTR lpsz, - UINT ucchMax - ) -{ - UINT Len = strnlen ( - lpsz + 1, - ucchMax - ); - return IsBadReadPtr ( - lpsz, - Len - ); -} - +IsBadReadPtr(IN LPCVOID lp, + IN UINT_PTR ucb) +{ + ULONG PageSize; + BOOLEAN Result = FALSE; + volatile CHAR *Current; + PCHAR Last; + + /* Quick cases */ + if (!ucb) return FALSE; + if (!lp) return TRUE; + + /* Get the page size */ + PageSize = BaseCachedSysInfo.PageSize; + + /* Calculate the last page */ + Last = (PCHAR)((ULONG_PTR)lp + ucb - 1); + + /* Another quick failure case */ + if ((ULONG_PTR)Last < (ULONG_PTR)lp) return TRUE; + + /* Enter SEH */ + _SEH_TRY + { + /* Probe the entire range */ + Current = (volatile CHAR*)lp; + Last = (PCHAR)(PAGE_ROUND_DOWN(Last)); + do + { + *Current; + Current = (volatile CHAR*)(PAGE_ROUND_DOWN(Current) + PAGE_SIZE); + } while (Current <= Last); + } + _SEH_HANDLE + { + /* We hit an exception, so return true */ + Result = TRUE; + } + _SEH_END + + /* Return exception status */ + return Result; +} + +/* + * @implemented + */ +BOOL +NTAPI +IsBadHugeReadPtr(LPCVOID lp, + UINT_PTR ucb) +{ + /* Implementation is the same on 32-bit */ + return IsBadReadPtr(lp, ucb); +} + +/* + * @implemented + */ +BOOL +NTAPI +IsBadCodePtr(FARPROC lpfn) +{ + /* Executing has the same privileges as reading */ + return IsBadReadPtr((LPVOID)lpfn, 1); +} + +/* + * @implemented + */ +BOOL +NTAPI +IsBadWritePtr(LPVOID lp, + UINT_PTR ucb) +{ + ULONG PageSize; + BOOLEAN Result = FALSE; + volatile CHAR *Current; + PCHAR Last; + + /* Quick cases */ + if (!ucb) return FALSE; + if (!lp) return TRUE; + + /* Get the page size */ + PageSize = BaseCachedSysInfo.PageSize; + + /* Calculate the last page */ + Last = (PCHAR)((ULONG_PTR)lp + ucb - 1); + + /* Another quick failure case */ + if ((ULONG_PTR)Last < (ULONG_PTR)lp) return TRUE; + + /* Enter SEH */ + _SEH_TRY + { + /* Probe the entire range */ + Current = (volatile CHAR*)lp; + Last = (PCHAR)(PAGE_ROUND_DOWN(Last)); + do + { + *Current = *Current; + Current = (volatile CHAR*)(PAGE_ROUND_DOWN(Current) + PAGE_SIZE); + } while (Current <= Last); + } + _SEH_HANDLE + { + /* We hit an exception, so return true */ + Result = TRUE; + } + _SEH_END + + /* Return exception status */ + return Result; +} + +/* + * @implemented + */ +BOOL +NTAPI +IsBadHugeWritePtr(LPVOID lp, + UINT_PTR ucb) +{ + /* Implementation is the same on 32-bit */ + return IsBadWritePtr(lp, ucb); +} + +/* + * @implemented + */ +BOOL +NTAPI +IsBadStringPtrW(IN LPCWSTR lpsz, + UINT_PTR ucchMax) +{ + BOOLEAN Result = FALSE; + volatile WCHAR *Current; + PWCHAR Last; + WCHAR Char; + + /* Quick cases */ + if (!ucchMax) return FALSE; + if (!lpsz) return TRUE; + + /* Calculate the last page */ + Last = (PWCHAR)((ULONG_PTR)lpsz + (ucchMax * 2) - 2); + + /* Another quick failure case */ + if ((ULONG_PTR)Last < (ULONG_PTR)lpsz) return TRUE; + + /* Enter SEH */ + _SEH_TRY + { + /* Probe the entire range */ + Current = (volatile WCHAR*)lpsz; + Last = (PWCHAR)(PAGE_ROUND_DOWN(Last)); + do + { + Char = *Current; + Current++; + } while (Char && (Current <= Last)); + } + _SEH_HANDLE + { + /* We hit an exception, so return true */ + Result = TRUE; + } + _SEH_END + + /* Return exception status */ + return Result; +} + +/* + * @implemented + */ +BOOL +NTAPI +IsBadStringPtrA(IN LPCSTR lpsz, + UINT_PTR ucchMax) +{ + BOOLEAN Result = FALSE; + volatile CHAR *Current; + PCHAR Last; + CHAR Char; + + /* Quick cases */ + if (!ucchMax) return FALSE; + if (!lpsz) return TRUE; + + /* Calculate the last page */ + Last = (PCHAR)((ULONG_PTR)lpsz + ucchMax - 1); + + /* Another quick failure case */ + if ((ULONG_PTR)Last < (ULONG_PTR)lpsz) return TRUE; + + /* Enter SEH */ + _SEH_TRY + { + /* Probe the entire range */ + Current = (volatile CHAR*)lpsz; + Last = (PCHAR)(PAGE_ROUND_DOWN(Last)); + do + { + Char = *Current; + Current++; + } while (Char && (Current <= Last)); + } + _SEH_HANDLE + { + /* We hit an exception, so return true */ + Result = TRUE; + } + _SEH_END + + /* Return exception status */ + return Result; +} /* EOF */ Propchange: trunk/reactos/dll/win32/kernel32/mem/procmem.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/kernel32/mem/resnotify.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/kernel32/mem/section.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/win32/kernel32/mem/virtual.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/include/ndk/mmfuncs.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ndk/mmfuncs.h?rev=2…
============================================================================== --- trunk/reactos/include/ndk/mmfuncs.h (original) +++ trunk/reactos/include/ndk/mmfuncs.h Fri Jun 23 03:40:50 2006 @@ -232,8 +232,8 @@ IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN PVOID Buffer, - IN ULONG NumberOfBytesToWrite, - OUT PULONG NumberOfBytesWritten + IN SIZE_T NumberOfBytesToWrite, + OUT PSIZE_T NumberOfBytesWritten ); NTSYSAPI
[View Less]
18 years, 12 months
1
0
0
0
[ion] 22519: [AUDIT] These files are clean and simple stubs around NT apis and/or WINE code. - Reformat the files. - Fix A->W calling. - Simpliy WriteProcessMemory to use NtProtectVirtualMemory to query the current state. - Call some APIs with the right DesiredAccess instead of allways sending _ALL_ACCESS. (for example, only use SECTION_MAP_READ | QUERY unless the caller wants r/w. - Flush ITLB when writing to process memory.
by ion@svn.reactos.org
Author: ion Date: Fri Jun 23 03:06:14 2006 New Revision: 22519 URL:
http://svn.reactos.ru/svn/reactos?rev=22519&view=rev
Log: [AUDIT] These files are clean and simple stubs around NT apis and/or WINE code. - Reformat the files. - Fix A->W calling. - Simpliy WriteProcessMemory to use NtProtectVirtualMemory to query the current state. - Call some APIs with the right DesiredAccess instead of allways sending _ALL_ACCESS. (for example, only use SECTION_MAP_READ | QUERY unless the caller
…
[View More]
wants r/w. - Flush ITLB when writing to process memory. Modified: trunk/reactos/dll/win32/kernel32/mem/procmem.c trunk/reactos/dll/win32/kernel32/mem/section.c trunk/reactos/dll/win32/kernel32/mem/virtual.c Modified: trunk/reactos/dll/win32/kernel32/mem/procmem.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/proc…
============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/procmem.c (original) +++ trunk/reactos/dll/win32/kernel32/mem/procmem.c Fri Jun 23 03:06:14 2006 @@ -1,10 +1,9 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/kernel32/mem/procmem.c - * PURPOSE: - * PROGRAMMER: Boudewijn Dekker +/* + * PROJECT: ReactOS Win32 Base API + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/kernel32/mem/procmem.c + * PURPOSE: Handles virtual memory APIs + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -12,7 +11,7 @@ #include <k32.h> #define NDEBUG -#include "../include/debug.h" +#include "debug.h" /* FUNCTIONS *****************************************************************/ @@ -20,138 +19,138 @@ * @implemented */ BOOL -STDCALL -ReadProcessMemory ( - HANDLE hProcess, - LPCVOID lpBaseAddress, - LPVOID lpBuffer, - DWORD nSize, - LPDWORD lpNumberOfBytesRead - ) +NTAPI +ReadProcessMemory(IN HANDLE hProcess, + IN LPCVOID lpBaseAddress, + IN LPVOID lpBuffer, + IN DWORD nSize, + OUT LPDWORD lpNumberOfBytesRead) { + NTSTATUS Status; - NTSTATUS Status; + /* Do the read */ + Status = NtReadVirtualMemory(hProcess, + (PVOID)lpBaseAddress, + lpBuffer, + nSize, + lpNumberOfBytesRead); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus (Status); + return FALSE; + } - Status = NtReadVirtualMemory( hProcess, (PVOID)lpBaseAddress,lpBuffer, nSize, - (PULONG)lpNumberOfBytesRead - ); - - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } - return TRUE; + /* Return success */ + return TRUE; } - /* * @implemented */ BOOL -STDCALL -WriteProcessMemory ( - HANDLE hProcess, - LPVOID lpBaseAddress, - LPCVOID lpBuffer, - SIZE_T nSize, - SIZE_T *lpNumberOfBytesWritten - ) +NTAPI +WriteProcessMemory(IN HANDLE hProcess, + IN LPVOID lpBaseAddress, + IN LPCVOID lpBuffer, + IN SIZE_T nSize, + OUT SIZE_T *lpNumberOfBytesWritten) { - NTSTATUS Status, ProtectStatus = STATUS_SUCCESS; - MEMORY_BASIC_INFORMATION MemInfo; - ULONG Length; - BOOLEAN UnProtect; + NTSTATUS Status; + ULONG OldValue; + SIZE_T RegionSize; + PVOID Base; + BOOLEAN UnProtect; - if (lpNumberOfBytesWritten) + /* Set parameters for protect call */ + RegionSize = nSize; + Base = lpBaseAddress; + + /* Check the current status */ + Status = NtProtectVirtualMemory(hProcess, + &Base, + &RegionSize, + PAGE_EXECUTE_READWRITE, + &OldValue); + if (NT_SUCCESS(Status)) + { + /* Check if we are unprotecting */ + UnProtect = OldValue & (PAGE_READWRITE | + PAGE_WRITECOPY | + PAGE_EXECUTE_READWRITE | + PAGE_EXECUTE_WRITECOPY) ? FALSE : TRUE; + if (UnProtect) { - *lpNumberOfBytesWritten = 0; - } + /* Set the new protection */ + Status = NtProtectVirtualMemory(hProcess, + &Base, + &RegionSize, + OldValue, + &OldValue); - while (nSize) - { - Status = NtQueryVirtualMemory(hProcess, + /* Write the memory */ + Status = NtWriteVirtualMemory(hProcess, lpBaseAddress, - MemoryBasicInformation, - &MemInfo, - sizeof(MEMORY_BASIC_INFORMATION), - NULL); - + (LPVOID)lpBuffer, + nSize, + lpNumberOfBytesWritten); if (!NT_SUCCESS(Status)) { + /* We failed */ SetLastErrorByStatus(Status); return FALSE; } - Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); - if (Length > nSize) + + /* Flush the ITLB */ + NtFlushInstructionCache(hProcess, lpBaseAddress, nSize); + return TRUE; + } + else + { + /* Check if we were read only */ + if ((OldValue & PAGE_NOACCESS) || (OldValue & PAGE_READONLY)) { - Length = nSize; - } - UnProtect = MemInfo.Protect & (PAGE_READWRITE|PAGE_WRITECOPY|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY) ? FALSE : TRUE; - if (UnProtect) - { - MemInfo.BaseAddress = lpBaseAddress; - MemInfo.RegionSize = Length; - if (MemInfo.Protect & (PAGE_EXECUTE|PAGE_EXECUTE_READ)) - { - MemInfo.Protect &= ~(PAGE_EXECUTE|PAGE_EXECUTE_READ); - MemInfo.Protect |= PAGE_EXECUTE_READWRITE; - } - else - { - MemInfo.Protect &= ~(PAGE_READONLY|PAGE_NOACCESS); - MemInfo.Protect |= PAGE_READWRITE; - } - - ProtectStatus = NtProtectVirtualMemory(hProcess, - &MemInfo.BaseAddress, - &MemInfo.RegionSize, - MemInfo.Protect, - &MemInfo.Protect); - if (!NT_SUCCESS(ProtectStatus)) - { - SetLastErrorByStatus(ProtectStatus); - return FALSE; - } - Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); - if (Length > nSize) - { - Length = nSize; - } + /* Restore protection and fail */ + NtProtectVirtualMemory(hProcess, + &Base, + &RegionSize, + OldValue, + &OldValue); + SetLastErrorByStatus(STATUS_ACCESS_VIOLATION); + return FALSE; } + /* Otherwise, do the write */ Status = NtWriteVirtualMemory(hProcess, lpBaseAddress, (LPVOID)lpBuffer, - Length, - &Length); - if (UnProtect) + nSize, + lpNumberOfBytesWritten); + + /* And restore the protection */ + NtProtectVirtualMemory(hProcess, + &Base, + &RegionSize, + OldValue, + &OldValue); + if (!NT_SUCCESS(Status)) { - ProtectStatus = NtProtectVirtualMemory(hProcess, - &MemInfo.BaseAddress, - &MemInfo.RegionSize, - MemInfo.Protect, - &MemInfo.Protect); - } - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } - if (UnProtect && !NT_SUCCESS(ProtectStatus)) - { - SetLastErrorByStatus (ProtectStatus); + /* We failed */ + SetLastErrorByStatus(STATUS_ACCESS_VIOLATION); return FALSE; } - lpBaseAddress = (LPVOID)((ULONG_PTR)lpBaseAddress + Length); - lpBuffer = (LPCVOID)((ULONG_PTR)lpBuffer + Length); - nSize -= Length; - if (lpNumberOfBytesWritten) - { - *lpNumberOfBytesWritten += Length; - } + + /* Flush the ITLB */ + NtFlushInstructionCache(hProcess, lpBaseAddress, nSize); + return TRUE; } - return TRUE; + } + else + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } } /* EOF */ Modified: trunk/reactos/dll/win32/kernel32/mem/section.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/sect…
============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/section.c (original) +++ trunk/reactos/dll/win32/kernel32/mem/section.c Fri Jun 23 03:06:14 2006 @@ -1,10 +1,9 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/kernel32/mem/section.c - * PURPOSE: Implementing file mapping - * PROGRAMMER: David Welch (welch(a)mcmail.com) +/* + * PROJECT: ReactOS Win32 Base API + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/kernel32/mem/section.c + * PURPOSE: Handles virtual memory APIs + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -12,371 +11,367 @@ #include <k32.h> #define NDEBUG -#include "../include/debug.h" +#include "debug.h" /* FUNCTIONS *****************************************************************/ -#define MASK_PAGE_FLAGS (PAGE_READONLY | PAGE_READWRITE | PAGE_WRITECOPY) -#define MASK_SEC_FLAGS (SEC_COMMIT | SEC_IMAGE | SEC_NOCACHE | SEC_RESERVE) - -/* - * @implemented - */ -HANDLE STDCALL -CreateFileMappingA(HANDLE hFile, - LPSECURITY_ATTRIBUTES lpFileMappingAttributes, - DWORD flProtect, - DWORD dwMaximumSizeHigh, - DWORD dwMaximumSizeLow, - LPCSTR lpName) -{ - NTSTATUS Status; - HANDLE SectionHandle; - LARGE_INTEGER MaximumSize; - PLARGE_INTEGER MaximumSizePointer; - OBJECT_ATTRIBUTES ObjectAttributes; - ANSI_STRING AnsiName; - UNICODE_STRING UnicodeName; - PSECURITY_DESCRIPTOR SecurityDescriptor; - - if ((flProtect & (MASK_PAGE_FLAGS | MASK_SEC_FLAGS)) != flProtect) - { - DPRINT1("Invalid flProtect 0x%08x\n", flProtect); +/* + * @implemented + */ +HANDLE +NTAPI +CreateFileMappingA(IN HANDLE hFile, + IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, + IN DWORD flProtect, + IN DWORD dwMaximumSizeHigh, + IN DWORD dwMaximumSizeLow, + IN LPCSTR lpName) +{ + NTSTATUS Status; + ANSI_STRING AnsiName; + PUNICODE_STRING UnicodeCache; + LPCWSTR UnicodeName = NULL; + + /* Check for a name */ + if (lpName) + { + /* Use TEB Cache */ + UnicodeCache = &NtCurrentTeb()->StaticUnicodeString; + + /* Convert to unicode */ + RtlInitAnsiString(&AnsiName, lpName); + Status = RtlAnsiStringToUnicodeString(UnicodeCache, &AnsiName, FALSE); + if (!NT_SUCCESS(Status)) + { + /* Conversion failed */ + SetLastErrorByStatus(Status); + return NULL; + } + + /* Otherwise, save the buffer */ + UnicodeName = (LPCWSTR)UnicodeCache->Buffer; + } + + /* Call the Unicode version */ + return CreateFileMappingW(hFile, + lpFileMappingAttributes, + flProtect, + dwMaximumSizeHigh, + dwMaximumSizeLow, + UnicodeName); +} + +/* + * @implemented + */ +HANDLE +NTAPI +CreateFileMappingW(HANDLE hFile, + LPSECURITY_ATTRIBUTES lpFileMappingAttributes, + DWORD flProtect, + DWORD dwMaximumSizeHigh, + DWORD dwMaximumSizeLow, + LPCWSTR lpName) +{ + NTSTATUS Status; + HANDLE SectionHandle; + OBJECT_ATTRIBUTES LocalAttributes; + POBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING SectionName; + ACCESS_MASK DesiredAccess; + LARGE_INTEGER LocalSize; + PLARGE_INTEGER SectionSize = NULL; + ULONG Attributes; + + /* Set default access */ + DesiredAccess = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ; + + /* Get the attributes for the actual allocation and cleanup flProtect */ + Attributes = flProtect & (SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_NOCACHE | SEC_COMMIT); + flProtect ^= Attributes; + + /* If the caller didn't say anything, assume SEC_COMMIT */ + if (!Attributes) Attributes = SEC_COMMIT; + + /* Now check if the caller wanted write access */ + if (flProtect == PAGE_READWRITE) + { + /* Give it */ + DesiredAccess |= (SECTION_MAP_WRITE | SECTION_MAP_READ); + } + + /* Now check if we got a name */ + if (lpName) RtlInitUnicodeString(&SectionName, lpName); + + /* Now convert the object attributes */ + ObjectAttributes = BasepConvertObjectAttributes(&LocalAttributes, + lpFileMappingAttributes, + lpName ? &SectionName : NULL); + + /* Check if we got a size */ + if (dwMaximumSizeLow || dwMaximumSizeHigh) + { + /* Use a LARGE_INTEGER and convert */ + SectionSize = &LocalSize; + SectionSize->LowPart = dwMaximumSizeLow; + SectionSize->HighPart = dwMaximumSizeHigh; + } + + /* Make sure the handle is valid */ + if (hFile == INVALID_HANDLE_VALUE) + { + /* It's not, we'll only go on if we have a size */ + hFile = NULL; + if (!SectionSize) + { + /* No size, so this isn't a valid non-mapped section */ + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + } + + /* Now create the actual section */ + Status = NtCreateSection(&SectionHandle, + DesiredAccess, + ObjectAttributes, + SectionSize, + flProtect, + Attributes, + hFile); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return NULL; + } + + /* Return the section */ + return SectionHandle; +} + +/* + * @implemented + */ +LPVOID +NTAPI +MapViewOfFileEx(HANDLE hFileMappingObject, + DWORD dwDesiredAccess, + DWORD dwFileOffsetHigh, + DWORD dwFileOffsetLow, + DWORD dwNumberOfBytesToMap, + LPVOID lpBaseAddress) +{ + NTSTATUS Status; + LARGE_INTEGER SectionOffset; + ULONG ViewSize; + ULONG Protect; + LPVOID ViewBase; + + /* Convert the offset */ + SectionOffset.LowPart = dwFileOffsetLow; + SectionOffset.HighPart = dwFileOffsetHigh; + + /* Save the size and base */ + ViewBase = lpBaseAddress; + ViewSize = dwNumberOfBytesToMap; + + /* Convert flags to NT Protection Attributes */ + if (dwDesiredAccess & FILE_MAP_WRITE) + { + Protect = PAGE_READWRITE; + } + else if (dwDesiredAccess & FILE_MAP_READ) + { + Protect = PAGE_READONLY; + } + else if (dwDesiredAccess & FILE_MAP_COPY) + { + Protect = PAGE_WRITECOPY; + } + else + { + Protect = PAGE_NOACCESS; + } + + /* Map the section */ + Status = ZwMapViewOfSection(hFileMappingObject, + NtCurrentProcess(), + &ViewBase, + 0, + 0, + &SectionOffset, + &ViewSize, + ViewShare, + 0, + Protect); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return NULL; + } + + /* Return the base */ + return ViewBase; +} + +/* + * @implemented + */ +LPVOID +NTAPI +MapViewOfFile(HANDLE hFileMappingObject, + DWORD dwDesiredAccess, + DWORD dwFileOffsetHigh, + DWORD dwFileOffsetLow, + DWORD dwNumberOfBytesToMap) +{ + /* Call the extended API */ + return MapViewOfFileEx(hFileMappingObject, + dwDesiredAccess, + dwFileOffsetHigh, + dwFileOffsetLow, + dwNumberOfBytesToMap, + NULL); +} + +/* + * @implemented + */ +BOOL +NTAPI +UnmapViewOfFile(LPVOID lpBaseAddress) +{ + NTSTATUS Status; + + /* Unmap the section */ + Status = NtUnmapViewOfSection(NtCurrentProcess(), lpBaseAddress); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Otherwise, return sucess */ + return TRUE; +} + +/* + * @implemented + */ +HANDLE +NTAPI +OpenFileMappingA(DWORD dwDesiredAccess, + BOOL bInheritHandle, + LPCSTR lpName) +{ + NTSTATUS Status; + ANSI_STRING AnsiName; + PUNICODE_STRING UnicodeCache; + + /* Check for a name */ + if (lpName) + { + /* Use TEB Cache */ + UnicodeCache = &NtCurrentTeb()->StaticUnicodeString; + + /* Convert to unicode */ + RtlInitAnsiString(&AnsiName, lpName); + Status = RtlAnsiStringToUnicodeString(UnicodeCache, &AnsiName, FALSE); + if (!NT_SUCCESS(Status)) + { + /* Conversion failed */ + SetLastErrorByStatus(Status); + return NULL; + } + } + else + { + /* We need a name */ SetLastError(ERROR_INVALID_PARAMETER); return NULL; - } - if (lpFileMappingAttributes) - { - SecurityDescriptor = lpFileMappingAttributes->lpSecurityDescriptor; - } - else - { - SecurityDescriptor = NULL; - } - - if (dwMaximumSizeLow == 0 && dwMaximumSizeHigh == 0) - { - MaximumSizePointer = NULL; - } - else - { - MaximumSize.u.LowPart = dwMaximumSizeLow; - MaximumSize.u.HighPart = dwMaximumSizeHigh; - MaximumSizePointer = &MaximumSize; - } - - if (lpName != NULL) - { - RtlInitAnsiString(&AnsiName, - (LPSTR)lpName); - RtlAnsiStringToUnicodeString(&UnicodeName, - &AnsiName, - TRUE); - } - - InitializeObjectAttributes(&ObjectAttributes, - (lpName ? &UnicodeName : NULL), - 0, - (lpName ? hBaseDir : NULL), - SecurityDescriptor); - - Status = NtCreateSection(&SectionHandle, - SECTION_ALL_ACCESS, - &ObjectAttributes, - MaximumSizePointer, - flProtect & MASK_PAGE_FLAGS, - flProtect & MASK_SEC_FLAGS, - ((hFile != INVALID_HANDLE_VALUE) ? hFile : NULL)); - if (lpName != NULL) - { - RtlFreeUnicodeString(&UnicodeName); - } - - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return NULL; - } - return SectionHandle; -} - - -/* - * @implemented - */ -HANDLE STDCALL -CreateFileMappingW(HANDLE hFile, - LPSECURITY_ATTRIBUTES lpFileMappingAttributes, - DWORD flProtect, - DWORD dwMaximumSizeHigh, - DWORD dwMaximumSizeLow, - LPCWSTR lpName) -{ - NTSTATUS Status; - HANDLE SectionHandle; - LARGE_INTEGER MaximumSize; - PLARGE_INTEGER MaximumSizePointer; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING UnicodeName; - PSECURITY_DESCRIPTOR SecurityDescriptor; - - if ((flProtect & (MASK_PAGE_FLAGS | MASK_SEC_FLAGS)) != flProtect) - { - DPRINT1("Invalid flProtect 0x%08x\n", flProtect); + } + + /* Call the Unicode version */ + return OpenFileMappingW(dwDesiredAccess, + bInheritHandle, + (LPCWSTR)UnicodeCache->Buffer); +} + +/* + * @implemented + */ +HANDLE +NTAPI +OpenFileMappingW(DWORD dwDesiredAccess, + BOOL bInheritHandle, + LPCWSTR lpName) +{ + NTSTATUS Status; + HANDLE SectionHandle; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING UnicodeName; + + /* We need a name */ + if (!lpName) + { + /* Otherwise, fail */ SetLastError(ERROR_INVALID_PARAMETER); return NULL; - } - if (lpFileMappingAttributes) - { - SecurityDescriptor = lpFileMappingAttributes->lpSecurityDescriptor; - } - else - { - SecurityDescriptor = NULL; - } - - if (dwMaximumSizeLow == 0 && dwMaximumSizeHigh == 0) - { - MaximumSizePointer = NULL; - } - else - { - MaximumSize.u.LowPart = dwMaximumSizeLow; - MaximumSize.u.HighPart = dwMaximumSizeHigh; - MaximumSizePointer = &MaximumSize; - } - - if (lpName != NULL) - { - RtlInitUnicodeString(&UnicodeName, - lpName); - } - - InitializeObjectAttributes(&ObjectAttributes, - (lpName ? &UnicodeName : NULL), - 0, - (lpName ? hBaseDir : NULL), - SecurityDescriptor); - - Status = NtCreateSection(&SectionHandle, - SECTION_ALL_ACCESS, - &ObjectAttributes, - MaximumSizePointer, - flProtect & MASK_PAGE_FLAGS, - flProtect & MASK_SEC_FLAGS, - ((hFile != INVALID_HANDLE_VALUE) ? hFile : NULL)); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return NULL; - } - return SectionHandle; -} - - -/* - * @implemented - */ -LPVOID STDCALL -MapViewOfFileEx(HANDLE hFileMappingObject, - DWORD dwDesiredAccess, - DWORD dwFileOffsetHigh, - DWORD dwFileOffsetLow, - DWORD dwNumberOfBytesToMap, - LPVOID lpBaseAddress) -{ - NTSTATUS Status; - LARGE_INTEGER SectionOffset; - ULONG ViewSize; - ULONG Protect; - LPVOID BaseAddress; - - SectionOffset.u.LowPart = dwFileOffsetLow; - SectionOffset.u.HighPart = dwFileOffsetHigh; - - if ( ( dwDesiredAccess & FILE_MAP_WRITE) == FILE_MAP_WRITE) - Protect = PAGE_READWRITE; - else if ((dwDesiredAccess & FILE_MAP_READ) == FILE_MAP_READ) - Protect = PAGE_READONLY; - else if ((dwDesiredAccess & FILE_MAP_ALL_ACCESS) == FILE_MAP_ALL_ACCESS) - Protect = PAGE_READWRITE; - else if ((dwDesiredAccess & FILE_MAP_COPY) == FILE_MAP_COPY) - Protect = PAGE_WRITECOPY; - else - Protect = PAGE_READWRITE; - - if (lpBaseAddress == NULL) - { - BaseAddress = NULL; - } - else - { - BaseAddress = lpBaseAddress; - } - - ViewSize = (ULONG) dwNumberOfBytesToMap; - - Status = ZwMapViewOfSection(hFileMappingObject, - NtCurrentProcess(), - &BaseAddress, - 0, - dwNumberOfBytesToMap, - &SectionOffset, - &ViewSize, - ViewShare, - 0, - Protect); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return NULL; - } - return BaseAddress; -} - - -/* - * @implemented - */ -LPVOID STDCALL -MapViewOfFile(HANDLE hFileMappingObject, - DWORD dwDesiredAccess, - DWORD dwFileOffsetHigh, - DWORD dwFileOffsetLow, - DWORD dwNumberOfBytesToMap) -{ - return MapViewOfFileEx(hFileMappingObject, - dwDesiredAccess, - dwFileOffsetHigh, - dwFileOffsetLow, - dwNumberOfBytesToMap, - NULL); -} - - -/* - * @implemented - */ -BOOL STDCALL -UnmapViewOfFile(LPVOID lpBaseAddress) -{ - NTSTATUS Status; - - Status = NtUnmapViewOfSection(NtCurrentProcess(), - lpBaseAddress); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } - return TRUE; -} - - -/* - * @implemented - */ -HANDLE STDCALL -OpenFileMappingA(DWORD dwDesiredAccess, - BOOL bInheritHandle, - LPCSTR lpName) -{ - NTSTATUS Status; - HANDLE SectionHandle; - OBJECT_ATTRIBUTES ObjectAttributes; - ANSI_STRING AnsiName; - UNICODE_STRING UnicodeName; - - if (lpName == NULL) - { - SetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } - - RtlInitAnsiString(&AnsiName, - (LPSTR)lpName); - RtlAnsiStringToUnicodeString(&UnicodeName, - &AnsiName, - TRUE); - - InitializeObjectAttributes(&ObjectAttributes, - &UnicodeName, - (bInheritHandle ? OBJ_INHERIT : 0), - hBaseDir, - NULL); - Status = NtOpenSection(&SectionHandle, - SECTION_ALL_ACCESS, - &ObjectAttributes); - RtlFreeUnicodeString (&UnicodeName); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return NULL; - } - - return SectionHandle; -} - - -/* - * @implemented - */ -HANDLE STDCALL -OpenFileMappingW(DWORD dwDesiredAccess, - BOOL bInheritHandle, - LPCWSTR lpName) -{ - NTSTATUS Status; - HANDLE SectionHandle; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING UnicodeName; - - if (lpName == NULL) - { - SetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } - - RtlInitUnicodeString(&UnicodeName, - lpName); - InitializeObjectAttributes(&ObjectAttributes, - &UnicodeName, - (bInheritHandle ? OBJ_INHERIT : 0), - hBaseDir, - NULL); - Status = ZwOpenSection(&SectionHandle, - SECTION_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return NULL; - } - - return SectionHandle; -} - - -/* - * @implemented - */ -BOOL STDCALL + } + + /* Convert attributes */ + RtlInitUnicodeString(&UnicodeName, lpName); + InitializeObjectAttributes(&ObjectAttributes, + &UnicodeName, + (bInheritHandle ? OBJ_INHERIT : 0), + hBaseDir, + NULL); + + /* Convert COPY to READ */ + if (dwDesiredAccess == FILE_MAP_COPY) dwDesiredAccess = FILE_MAP_READ; + + /* Open the section */ + Status = ZwOpenSection(&SectionHandle, + dwDesiredAccess, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return NULL; + } + + /* Otherwise, return the handle */ + return SectionHandle; +} + +/* + * @implemented + */ +BOOL +NTAPI FlushViewOfFile(LPCVOID lpBaseAddress, - DWORD dwNumberOfBytesToFlush) -{ - NTSTATUS Status; - ULONG NumberOfBytesFlushed; - - Status = NtFlushVirtualMemory(NtCurrentProcess(), - (LPVOID)lpBaseAddress, - dwNumberOfBytesToFlush, - &NumberOfBytesFlushed); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } - return TRUE; + DWORD dwNumberOfBytesToFlush) +{ + NTSTATUS Status; + ULONG NumberOfBytesFlushed; + + /* Flush the view */ + Status = NtFlushVirtualMemory(NtCurrentProcess(), + (LPVOID)lpBaseAddress, + dwNumberOfBytesToFlush, + &NumberOfBytesFlushed); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Return success */ + return TRUE; } /* EOF */ Modified: trunk/reactos/dll/win32/kernel32/mem/virtual.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/virt…
============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/virtual.c (original) +++ trunk/reactos/dll/win32/kernel32/mem/virtual.c Fri Jun 23 03:06:14 2006 @@ -1,10 +1,9 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/kernel32/mem/virtual.c - * PURPOSE: Passing the Virtualxxx functions onto the kernel - * PROGRAMMER: David Welch (welch(a)mcmail.com) +/* + * PROJECT: ReactOS Win32 Base API + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/kernel32/mem/virtual.c + * PURPOSE: Handles virtual memory APIs + * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) */ /* INCLUDES ******************************************************************/ @@ -12,221 +11,250 @@ #include <k32.h> #define NDEBUG -#include "../include/debug.h" +#include "debug.h" /* FUNCTIONS *****************************************************************/ /* * @implemented */ -LPVOID STDCALL -VirtualAllocEx(HANDLE hProcess, - LPVOID lpAddress, - SIZE_T dwSize, - DWORD flAllocationType, - DWORD flProtect) -{ - NTSTATUS Status; - - Status = NtAllocateVirtualMemory(hProcess, - (PVOID *)&lpAddress, - 0, - &dwSize, - flAllocationType, - flProtect); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return(NULL); - } - return(lpAddress); -} - - -/* - * @implemented - */ -LPVOID STDCALL -VirtualAlloc(LPVOID lpAddress, - SIZE_T dwSize, - DWORD flAllocationType, - DWORD flProtect) -{ - return(VirtualAllocEx(GetCurrentProcess(), - lpAddress, - dwSize, - flAllocationType, - flProtect)); -} - - -/* - * @implemented - */ -BOOL STDCALL -VirtualFreeEx(HANDLE hProcess, - LPVOID lpAddress, - SIZE_T dwSize, - DWORD dwFreeType) -{ - NTSTATUS Status; - - Status = NtFreeVirtualMemory(hProcess, - (PVOID *)&lpAddress, - (PULONG)&dwSize, - dwFreeType); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return(FALSE); - } - return(TRUE); -} - - -/* - * @implemented - */ -BOOL STDCALL -VirtualFree(LPVOID lpAddress, - SIZE_T dwSize, - DWORD dwFreeType) -{ - return(VirtualFreeEx(GetCurrentProcess(), - lpAddress, - dwSize, - dwFreeType)); -} - - -/* - * @implemented - */ -BOOL STDCALL -VirtualProtect(LPVOID lpAddress, - SIZE_T dwSize, - DWORD flNewProtect, - PDWORD lpflOldProtect) -{ - return(VirtualProtectEx(GetCurrentProcess(), - lpAddress, - dwSize, - flNewProtect, - lpflOldProtect)); -} - - -/* - * @implemented - */ -BOOL STDCALL -VirtualProtectEx(HANDLE hProcess, - LPVOID lpAddress, - SIZE_T dwSize, - DWORD flNewProtect, - PDWORD lpflOldProtect) -{ - NTSTATUS Status; - - Status = NtProtectVirtualMemory(hProcess, - &lpAddress, - &dwSize, - flNewProtect, - (PULONG)lpflOldProtect); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return(FALSE); - } - return(TRUE); -} - - -/* - * @implemented - */ -BOOL STDCALL -VirtualLock(LPVOID lpAddress, - SIZE_T dwSize) -{ - ULONG BytesLocked; - NTSTATUS Status; - - Status = NtLockVirtualMemory(NtCurrentProcess(), - lpAddress, - dwSize, - &BytesLocked); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return(FALSE); - } - return(TRUE); -} - - -/* - * @implemented - */ -DWORD STDCALL -VirtualQuery(LPCVOID lpAddress, - PMEMORY_BASIC_INFORMATION lpBuffer, - SIZE_T dwLength) -{ - return(VirtualQueryEx(NtCurrentProcess(), - lpAddress, - lpBuffer, - dwLength)); -} - - -/* - * @implemented - */ -DWORD STDCALL -VirtualQueryEx(HANDLE hProcess, - LPCVOID lpAddress, - PMEMORY_BASIC_INFORMATION lpBuffer, - SIZE_T dwLength) -{ - NTSTATUS Status; - ULONG ResultLength; - - Status = NtQueryVirtualMemory(hProcess, - (LPVOID)lpAddress, - MemoryBasicInformation, - lpBuffer, - sizeof(MEMORY_BASIC_INFORMATION), - &ResultLength ); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return 0; - } - return(ResultLength); -} - - -/* - * @implemented - */ -BOOL STDCALL -VirtualUnlock(LPVOID lpAddress, - SIZE_T dwSize) -{ - ULONG BytesLocked; - NTSTATUS Status; - - Status = NtUnlockVirtualMemory(NtCurrentProcess(), - lpAddress, - dwSize, - &BytesLocked); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return(FALSE); - } - return(TRUE); +LPVOID +NTAPI +VirtualAllocEx(IN HANDLE hProcess, + IN LPVOID lpAddress, + IN SIZE_T dwSize, + IN DWORD flAllocationType, + IN DWORD flProtect) +{ + NTSTATUS Status; + + /* Allocate the memory */ + Status = NtAllocateVirtualMemory(hProcess, + (PVOID *)&lpAddress, + 0, + &dwSize, + flAllocationType, + flProtect); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return NULL; + } + + /* Return the allocated address */ + return lpAddress; +} + +/* + * @implemented + */ +LPVOID +NTAPI +VirtualAlloc(IN LPVOID lpAddress, + IN SIZE_T dwSize, + IN DWORD flAllocationType, + IN DWORD flProtect) +{ + /* Call the extended API */ + return VirtualAllocEx(GetCurrentProcess(), + lpAddress, + dwSize, + flAllocationType, + flProtect); +} + +/* + * @implemented + */ +BOOL +NTAPI +VirtualFreeEx(IN HANDLE hProcess, + IN LPVOID lpAddress, + IN SIZE_T dwSize, + IN DWORD dwFreeType) +{ + NTSTATUS Status; + + /* Free the memory */ + Status = NtFreeVirtualMemory(hProcess, + (PVOID *)&lpAddress, + (PULONG)&dwSize, + dwFreeType); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Return success */ + return TRUE; +} + +/* + * @implemented + */ +BOOL +NTAPI +VirtualFree(IN LPVOID lpAddress, + IN SIZE_T dwSize, + IN DWORD dwFreeType) +{ + /* Call the extended API */ + return VirtualFreeEx(GetCurrentProcess(), + lpAddress, + dwSize, + dwFreeType); +} + +/* + * @implemented + */ +BOOL +NTAPI +VirtualProtect(IN LPVOID lpAddress, + IN SIZE_T dwSize, + IN DWORD flNewProtect, + OUT PDWORD lpflOldProtect) +{ + /* Call the extended API */ + return VirtualProtectEx(GetCurrentProcess(), + lpAddress, + dwSize, + flNewProtect, + lpflOldProtect); +} + +/* + * @implemented + */ +BOOL +NTAPI +VirtualProtectEx(IN HANDLE hProcess, + IN LPVOID lpAddress, + IN SIZE_T dwSize, + IN DWORD flNewProtect, + OUT PDWORD lpflOldProtect) +{ + NTSTATUS Status; + + /* Change the protection */ + Status = NtProtectVirtualMemory(hProcess, + &lpAddress, + &dwSize, + flNewProtect, + (PULONG)lpflOldProtect); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Return success */ + return TRUE; +} + +/* + * @implemented + */ +BOOL +NTAPI +VirtualLock(IN LPVOID lpAddress, + IN SIZE_T dwSize) +{ + ULONG BytesLocked; + NTSTATUS Status; + + /* Lock the memory */ + Status = NtLockVirtualMemory(NtCurrentProcess(), + lpAddress, + dwSize, + &BytesLocked); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Return success */ + return TRUE; +} + +/* + * @implemented + */ +DWORD +NTAPI +VirtualQuery(IN LPCVOID lpAddress, + OUT PMEMORY_BASIC_INFORMATION lpBuffer, + IN SIZE_T dwLength) +{ + /* Call the extended API */ + return VirtualQueryEx(NtCurrentProcess(), + lpAddress, + lpBuffer, + dwLength); +} + +/* + * @implemented + */ +DWORD +NTAPI +VirtualQueryEx(IN HANDLE hProcess, + IN LPCVOID lpAddress, + OUT PMEMORY_BASIC_INFORMATION lpBuffer, + IN SIZE_T dwLength) +{ + NTSTATUS Status; + ULONG ResultLength; + + /* Query basic information */ + Status = NtQueryVirtualMemory(hProcess, + (LPVOID)lpAddress, + MemoryBasicInformation, + lpBuffer, + sizeof(MEMORY_BASIC_INFORMATION), + &ResultLength); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return 0; + } + + /* Return the length returned */ + return ResultLength; +} + +/* + * @implemented + */ +BOOL +NTAPI +VirtualUnlock(IN LPVOID lpAddress, + IN SIZE_T dwSize) +{ + ULONG BytesLocked; + NTSTATUS Status; + + /* Unlock the memory */ + Status = NtUnlockVirtualMemory(NtCurrentProcess(), + lpAddress, + dwSize, + &BytesLocked); + if (!NT_SUCCESS(Status)) + { + /* We failed */ + SetLastErrorByStatus(Status); + return FALSE; + } + + /* Return success */ + return TRUE; } /* EOF */
[View Less]
18 years, 12 months
1
0
0
0
[hpoussin] 22518: Don't enumerate the serial port used for debugging
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri Jun 23 02:57:32 2006 New Revision: 22518 URL:
http://svn.reactos.ru/svn/reactos?rev=22518&view=rev
Log: Don't enumerate the serial port used for debugging Modified: trunk/reactos/drivers/bus/acpi/include/acpi.h trunk/reactos/drivers/bus/acpi/ospm/fdo.c Modified: trunk/reactos/drivers/bus/acpi/include/acpi.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/bus/acpi/include/ac…
==================================================================
…
[View More]
============ --- trunk/reactos/drivers/bus/acpi/include/acpi.h (original) +++ trunk/reactos/drivers/bus/acpi/include/acpi.h Fri Jun 23 02:57:32 2006 @@ -60,6 +60,7 @@ #include "actables.h" #include "acdispat.h" #include <ntddk.h> +#include <ndk/haltypes.h> #include <bm.h> #include <bn.h> #include <bmpower.h> Modified: trunk/reactos/drivers/bus/acpi/ospm/fdo.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/bus/acpi/ospm/fdo.c…
============================================================================== --- trunk/reactos/drivers/bus/acpi/ospm/fdo.c (original) +++ trunk/reactos/drivers/bus/acpi/ospm/fdo.c Fri Jun 23 02:57:32 2006 @@ -361,6 +361,77 @@ } +static BOOLEAN +AcpiCheckIfIsSerialDebugPort( + IN PACPI_DEVICE Device) +{ + ACPI_STATUS AcpiStatus; + BM_NODE *Node; + ACPI_BUFFER Buffer; + BOOLEAN Done; + RESOURCE* resource; + + if (!KdComPortInUse) + return FALSE; + + AcpiStatus = bm_get_node(Device->BmHandle, 0, &Node); + if (!ACPI_SUCCESS(AcpiStatus)) + return FALSE; + + /* Get current resources */ + Buffer.length = 0; + AcpiStatus = acpi_get_current_resources(Node->device.acpi_handle, &Buffer); + if ((AcpiStatus & ACPI_OK) == 0) + return FALSE; + if (Buffer.length == 0) + return FALSE; + + Buffer.pointer = ExAllocatePool(PagedPool, Buffer.length); + if (!Buffer.pointer) + return FALSE; + AcpiStatus = acpi_get_current_resources(Node->device.acpi_handle, &Buffer); + if (!ACPI_SUCCESS(AcpiStatus)) + { + ExFreePool(Buffer.pointer); + return FALSE; + } + + /* Loop through the list of resources to see if the + * device is using the serial port address + */ + Done = FALSE; + resource = (RESOURCE*)Buffer.pointer; + while (!Done) + { + switch (resource->id) + { + case io: + { + IO_RESOURCE *io_data = (IO_RESOURCE*) &resource->data; + if (*KdComPortInUse == ULongToPtr(io_data->min_base_address)) + { + ExFreePool(Buffer.pointer); + return TRUE; + } + break; + } + case end_tag: + { + Done = TRUE; + break; + } + default: + { + break; + } + } + resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length); + } + + ExFreePool(Buffer.pointer); + return FALSE; +} + static NTSTATUS FdoQueryBusRelations( IN PDEVICE_OBJECT DeviceObject, @@ -396,6 +467,15 @@ { ACPI_BUFFER Buffer; Device = CONTAINING_RECORD(CurrentEntry, ACPI_DEVICE, DeviceListEntry); + + if (AcpiCheckIfIsSerialDebugPort(Device)) + { + /* Skip this device */ + DPRINT("Found debug serial port ; skipping it\n"); + Relations->Count--; + CurrentEntry = CurrentEntry->Flink; + continue; + } /* FIXME: For ACPI namespace devices on the motherboard create filter DOs and attach them just above the ACPI bus device object (PDO) */
[View Less]
18 years, 12 months
1
0
0
0
[gedmurphy] 22517: [AUDIT] timedate.cpl For some reason, this had been unlocked but not had it's svn:needs-lock props removed. I've been working on this for the past few days and can verify it's clean.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Fri Jun 23 02:37:10 2006 New Revision: 22517 URL:
http://svn.reactos.ru/svn/reactos?rev=22517&view=rev
Log: [AUDIT] timedate.cpl For some reason, this had been unlocked but not had it's svn:needs-lock props removed. I've been working on this for the past few days and can verify it's clean. Modified: trunk/reactos/dll/cpl/timedate/clock.c (props changed) trunk/reactos/dll/cpl/timedate/monthcal.c (props changed) trunk/reactos/dll/cpl/timedate/
…
[View More]
ntpclient.c (props changed) trunk/reactos/dll/cpl/timedate/resource.h (props changed) trunk/reactos/dll/cpl/timedate/timedate.h (props changed) Propchange: trunk/reactos/dll/cpl/timedate/clock.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/timedate/monthcal.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/timedate/ntpclient.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/timedate/resource.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/dll/cpl/timedate/timedate.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
[View Less]
18 years, 12 months
1
0
0
0
[hpoussin] 22516: Fail start of the serial port currently used for debugging, according to http://blogs.msdn.com/doronh/archive/2006/06/07/621604.aspx
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri Jun 23 02:14:51 2006 New Revision: 22516 URL:
http://svn.reactos.ru/svn/reactos?rev=22516&view=rev
Log: Fail start of the serial port currently used for debugging, according to
http://blogs.msdn.com/doronh/archive/2006/06/07/621604.aspx
Modified: trunk/reactos/drivers/base/serial/pnp.c trunk/reactos/drivers/base/serial/serial.h trunk/reactos/drivers/base/serial/serial.rc (props changed) trunk/reactos/include/ndk/haltypes.h Modified: trunk/
…
[View More]
reactos/drivers/base/serial/pnp.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/base/serial/pnp.c?r…
============================================================================== --- trunk/reactos/drivers/base/serial/pnp.c (original) +++ trunk/reactos/drivers/base/serial/pnp.c Fri Jun 23 02:14:51 2006 @@ -193,6 +193,13 @@ return STATUS_INSUFFICIENT_RESOURCES; ComPortBase = (PUCHAR)DeviceExtension->BaseAddress; + /* Test if we are trying to start the serial port used for debugging */ + if (KdComPortInUse && *KdComPortInUse == ULongToPtr(DeviceExtension->BaseAddress)) + { + DPRINT("Failing IRP_MN_START_DEVICE as this serial port is used for debugging\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + if (DeviceExtension->UartType == UartUnknown) DeviceExtension->UartType = SerialDetectUartType(ComPortBase); @@ -329,7 +336,6 @@ */ case IRP_MN_START_DEVICE: /* 0x0 */ { - BOOLEAN ConflictDetected; DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n"); ASSERT(((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PnpState == dsStopped); @@ -343,20 +349,6 @@ ((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->ComPort); Status = STATUS_INSUFFICIENT_RESOURCES; break; - } - /* FIXME: HACK: verify that we don't have resource conflict, - * because PnP manager doesn't do it automatically - */ - Status = IoReportResourceForDetection( - DeviceObject->DriverObject, Stack->Parameters.StartDevice.AllocatedResources, 0, - NULL, NULL, 0, - &ConflictDetected); - if (!NT_SUCCESS(Status)) - { - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; } /* Call lower driver */ Modified: trunk/reactos/drivers/base/serial/serial.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/base/serial/serial.…
============================================================================== --- trunk/reactos/drivers/base/serial/serial.h (original) +++ trunk/reactos/drivers/base/serial/serial.h Fri Jun 23 02:14:51 2006 @@ -8,6 +8,7 @@ */ #include <ntddk.h> +#include <ndk/haltypes.h> #include <ntddser.h> #include <stdio.h> Propchange: trunk/reactos/drivers/base/serial/serial.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/include/ndk/haltypes.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ndk/haltypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/haltypes.h (original) +++ trunk/reactos/include/ndk/haltypes.h Fri Jun 23 02:14:51 2006 @@ -144,7 +144,7 @@ // HAL Exports // #ifndef _NTHAL_ -extern PUCHAR *KdComPortInUse; +extern PUCHAR NTSYSAPI *KdComPortInUse; #endif #endif
[View Less]
18 years, 12 months
1
0
0
0
[hpoussin] 22515: [AUDIT] serial.sys is clean. I wrote it myself and I didn't use unclean methods.
by hpoussin@svn.reactos.org
Author: hpoussin Date: Fri Jun 23 02:13:27 2006 New Revision: 22515 URL:
http://svn.reactos.ru/svn/reactos?rev=22515&view=rev
Log: [AUDIT] serial.sys is clean. I wrote it myself and I didn't use unclean methods. Modified: trunk/reactos/drivers/base/serial/circularbuffer.c (props changed) trunk/reactos/drivers/base/serial/cleanup.c (props changed) trunk/reactos/drivers/base/serial/close.c (props changed) trunk/reactos/drivers/base/serial/create.c (props changed)
…
[View More]
trunk/reactos/drivers/base/serial/devctrl.c (props changed) trunk/reactos/drivers/base/serial/info.c (props changed) trunk/reactos/drivers/base/serial/legacy.c (props changed) trunk/reactos/drivers/base/serial/misc.c (props changed) trunk/reactos/drivers/base/serial/pnp.c (props changed) trunk/reactos/drivers/base/serial/power.c (props changed) trunk/reactos/drivers/base/serial/rw.c (props changed) trunk/reactos/drivers/base/serial/serial.c (props changed) trunk/reactos/drivers/base/serial/serial.h (props changed) Propchange: trunk/reactos/drivers/base/serial/circularbuffer.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/cleanup.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/close.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/create.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/devctrl.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/info.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/legacy.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/misc.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/pnp.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/power.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/rw.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/serial.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/base/serial/serial.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
[View Less]
18 years, 12 months
1
0
0
0
[jimtabor] 22514: Update wine sync info.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jun 23 02:12:19 2006 New Revision: 22514 URL:
http://svn.reactos.ru/svn/reactos?rev=22514&view=rev
Log: Update wine sync info. Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=2…
============================================================================== --- trunk/reactos/media/doc/README.WINE (original) +++ trunk/reactos/media/doc/
…
[View More]
README.WINE Fri Jun 23 02:12:19 2006 @@ -119,8 +119,8 @@ reactos/dll/win32/user32/controls/edit.c # Synced at 20051210 reactos/dll/win32/user32/controls/icontitle.c # Synced at 20060617 reactos/dll/win32/user32/controls/listbox.c # Synced at 20060616 - reactos/dll/win32/user32/controls/scrollbar.c # Forked (?) - reactos/dll/win32/user32/controls/static.c # Out of sync + reactos/dll/win32/user32/controls/scrollbar.c # Forked + reactos/dll/win32/user32/controls/static.c # Synced at 20060622 reactos/dll/win32/user32/misc/dde.c # Last sync date unknown (dde_misc.c) reactos/dll/win32/user32/misc/ddeclient.c # Last sync date unknown @@ -130,6 +130,7 @@ reactos/dll/win32/user32/misc/winhelp.c # Last sync date unknown reactos/dll/win32/user32/misc/wsprintf.c # Out of sync + reactos/dll/win32/user32/windows/defwnd.c # Forked reactos/dll/win32/user32/windows/draw.c # Forked at Wine-20020904 (uitools.c) reactos/dll/win32/user32/windows/mdi.c # Out of sync reactos/dll/win32/user32/windows/menu.c # Forked
[View Less]
18 years, 12 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
60
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Results per page:
10
25
50
100
200