Author: tkreuzer
Date: Tue Dec 18 15:20:20 2012
New Revision: 57944
URL:
http://svn.reactos.org/svn/reactos?rev=57944&view=rev
Log:
[WIN32K]
- Add/fix some annotations
- Simplify code in NtGdiSetMiterLimit
Modified:
trunk/reactos/include/psdk/ntgdi.h
trunk/reactos/include/psdk/sal.h
trunk/reactos/win32ss/gdi/eng/pdevobj.c
trunk/reactos/win32ss/gdi/eng/pdevobj.h
trunk/reactos/win32ss/gdi/eng/xlateobj.h
trunk/reactos/win32ss/gdi/ntgdi/dcutil.c
trunk/reactos/win32ss/gdi/ntgdi/line.c
trunk/reactos/win32ss/gdi/ntgdi/path.c
Modified: trunk/reactos/include/psdk/ntgdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntgdi.h?rev=5…
==============================================================================
--- trunk/reactos/include/psdk/ntgdi.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/ntgdi.h [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -2385,6 +2385,7 @@
_In_ HDC hdc,
_In_ INT i);
+_Success_(return!=FALSE)
W32KAPI
BOOL
APIENTRY
Modified: trunk/reactos/include/psdk/sal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal.h?rev=579…
==============================================================================
--- trunk/reactos/include/psdk/sal.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/sal.h [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -519,7 +519,7 @@
//#define _Deref_pre_maybenull_
//#define _Deref_pre_notnull_
//#define _Deref_pre_null_
-//#define _Deref_pre_opt_bytecap_(size)
+#define _Deref_pre_opt_bytecap_(size)
_SAL11_Name(_Pre_opt_bytecap_) _Group_([SA_Pre(Null=SA_Maybe,Notref=1)]
[SA_Pre(WritableBytes="\n" _SA_SPECSTRIZE(size))])
//#define _Deref_pre_opt_bytecap_c_(size)
//#define _Deref_pre_opt_bytecap_x_(size)
//#define _Deref_pre_opt_bytecount_(size)
Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/pdevobj.c?…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -472,7 +472,7 @@
PPDEVOBJ
NTAPI
EngpGetPDEV(
- PUNICODE_STRING pustrDeviceName)
+ _In_ PUNICODE_STRING pustrDeviceName)
{
UNICODE_STRING ustrCurrent;
PPDEVOBJ ppdev;
@@ -775,7 +775,7 @@
return 0;
}
-
+_Success_(return!=FALSE)
BOOL
APIENTRY
NtGdiGetDeviceCapsAll(
Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/pdevobj.h?…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/pdevobj.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/pdevobj.h [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -160,22 +160,24 @@
PPDEVOBJ
NTAPI
-EngpGetPDEV(PUNICODE_STRING pustrDevice);
+EngpGetPDEV(
+ _In_ PUNICODE_STRING pustrDevice);
VOID
NTAPI
-PDEVOBJ_vRelease(PPDEVOBJ ppdev);
+PDEVOBJ_vRelease(
+ _Inout_ PPDEVOBJ ppdev);
PSURFACE
NTAPI
PDEVOBJ_pSurface(
- PPDEVOBJ ppdev);
+ _In_ PPDEVOBJ ppdev);
VOID
NTAPI
PDEVOBJ_vGetDeviceCaps(
- PPDEVOBJ ppdev,
- PDEVCAPS pDevCaps);
+ _In_ PPDEVOBJ ppdev,
+ _Out_ PDEVCAPS pDevCaps);
INIT_FUNCTION
NTSTATUS
@@ -184,6 +186,8 @@
PSIZEL
FASTCALL
-PDEVOBJ_sizl(PPDEVOBJ, PSIZEL);
+PDEVOBJ_sizl(
+ _In_ PPDEVOBJ ppdev,
+ _In_ PSIZEL psizl);
#endif /* !__WIN32K_PDEVOBJ_H */
Modified: trunk/reactos/win32ss/gdi/eng/xlateobj.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/xlateobj.h…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/xlateobj.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/xlateobj.h [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -9,7 +9,12 @@
struct _EXLATEOBJ;
-typedef ULONG (FASTCALL *PFN_XLATE)(struct _EXLATEOBJ *pexlo, ULONG iColor);
+_Function_class_(FN_XLATE)
+typedef
+ULONG
+(FASTCALL *PFN_XLATE)(
+ _In_ struct _EXLATEOBJ *pexlo,
+ _In_ ULONG iColor);
typedef struct _EXLATEOBJ
{
@@ -38,23 +43,51 @@
};
} EXLATEOBJ, *PEXLATEOBJ;
+extern EXLATEOBJ gexloTrivial;
+
+_Notnull_
PFN_XLATE
FORCEINLINE
-XLATEOBJ_pfnXlate(XLATEOBJ *pxlo)
+XLATEOBJ_pfnXlate(
+ _In_ XLATEOBJ *pxlo)
{
return ((PEXLATEOBJ)pxlo)->pfnXlate;
}
-extern EXLATEOBJ gexloTrivial;
+VOID
+NTAPI
+EXLATEOBJ_vInitialize(
+ _Out_ PEXLATEOBJ pexlo,
+ _In_ PPALETTE ppalSrc,
+ _In_ PPALETTE ppalDst,
+ _In_ COLORREF crSrcBackColor,
+ _In_ COLORREF crDstBackColor,
+ _In_ COLORREF crDstForeColor);
+VOID
+NTAPI
+EXLATEOBJ_vInitXlateFromDCs(
+ _Out_ PEXLATEOBJ pexlo,
+ _In_ PDC pdcSrc,
+ _In_ PDC pdcDst);
+
+VOID
+NTAPI
+EXLATEOBJ_vInitSrcMonoXlate(
+ _Out_ PEXLATEOBJ pexlo,
+ _In_ PPALETTE ppalDst,
+ _In_ COLORREF crBackgroundClr,
+ _In_ COLORREF crForegroundClr);
+
+VOID
+NTAPI
+EXLATEOBJ_vCleanup(
+ _Inout_ PEXLATEOBJ pexlo);
+
+_Always_(_Post_satisfies_(return==iColor))
ULONG
FASTCALL
-EXLATEOBJ_iXlateTrivial(PEXLATEOBJ pexlo, ULONG iColor);
+EXLATEOBJ_iXlateTrivial(
+ _In_ PEXLATEOBJ pexlo,
+ _In_ ULONG iColor);
-void
-DbgCmpXlate(XLATEOBJ *pxlo1, XLATEOBJ *pxlo2);
-
-VOID NTAPI EXLATEOBJ_vInitialize(PEXLATEOBJ pexlo, PPALETTE ppalSrc, PPALETTE ppalDst,
ULONG, ULONG, ULONG);
-VOID NTAPI EXLATEOBJ_vInitXlateFromDCs(PEXLATEOBJ pexlo, PDC pdcSrc, PDC pdcDst);
-VOID NTAPI EXLATEOBJ_vInitSrcMonoXlate(PEXLATEOBJ pexlo, PPALETTE ppalDst, ULONG Color0,
ULONG Color1);
-VOID NTAPI EXLATEOBJ_vCleanup(PEXLATEOBJ pexlo);
Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcutil.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -113,7 +113,7 @@
// Wine returns an error here. We set the default.
if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode
= WHITEONBLACK;
-
+
pdcattr->jStretchBltMode = iStretchMode;
}
return oSMode;
@@ -355,7 +355,8 @@
return Ret;
}
-BOOL _Success_(return != FALSE)
+_Success_(return != FALSE)
+BOOL
APIENTRY
NtGdiGetAndSetDCDword(
_In_ HDC hdc,
Modified: trunk/reactos/win32ss/gdi/ntgdi/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/line.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -540,7 +540,8 @@
/*
* @implemented
*/
-BOOL _Success_(return != FALSE)
+_Success_(return != FALSE)
+BOOL
APIENTRY
NtGdiMoveTo(
IN HDC hdc,
Modified: trunk/reactos/win32ss/gdi/ntgdi/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/path.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] Tue Dec 18 15:20:20 2012
@@ -2585,7 +2585,7 @@
{
DC *pDc;
gxf_long worker, worker1;
- NTSTATUS Status = STATUS_SUCCESS;
+ BOOL bResult = TRUE;
if (!(pDc = DC_LockDc(hdc)))
{
@@ -2601,26 +2601,19 @@
{
_SEH2_TRY
{
- ProbeForWrite(pdwOut,
- sizeof(DWORD),
- 1);
+ ProbeForWrite(pdwOut, sizeof(DWORD), 1);
*pdwOut = worker1.l;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- Status = _SEH2_GetExceptionCode();
+ SetLastNtError(_SEH2_GetExceptionCode());
+ bResult = FALSE;
}
_SEH2_END;
- if (!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- DC_UnlockDc(pDc);
- return FALSE;
- }
}
DC_UnlockDc(pDc);
- return TRUE;
+ return bResult;
}
BOOL