这篇教程C++ EngSetLastError函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中EngSetLastError函数的典型用法代码示例。如果您正苦于以下问题:C++ EngSetLastError函数的具体用法?C++ EngSetLastError怎么用?C++ EngSetLastError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了EngSetLastError函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: co_IntRegisterLogonProcessBOOL FASTCALLco_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register){ NTSTATUS Status; PEPROCESS Process; Status = PsLookupProcessByProcessId(ProcessId, &Process); if (!NT_SUCCESS(Status)) { EngSetLastError(RtlNtStatusToDosError(Status)); return FALSE; } ProcessId = Process->UniqueProcessId; ObDereferenceObject(Process); if (Register) { /* Register the logon process */ if (gpidLogon != 0) return FALSE; gpidLogon = ProcessId; } else { /* Deregister the logon process */ if (gpidLogon != ProcessId) return FALSE; gpidLogon = 0; } return TRUE;}
开发者ID:GYGit,项目名称:reactos,代码行数:36,
示例2: NtUserSetClipboardViewerHWND APIENTRYNtUserSetClipboardViewer(HWND hWndNewViewer){ HWND hWndNext = NULL; PWINSTATION_OBJECT pWinStaObj = NULL; PWND pWindow; UserEnterExclusive(); pWinStaObj = IntGetWinStaForCbAccess(); if (!pWinStaObj) goto cleanup; pWindow = UserGetWindowObject(hWndNewViewer); if (!pWindow) { EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); goto cleanup; } /* Return previous viewer. New viever window should send messages to rest of the chain */ if (pWinStaObj->spwndClipViewer) hWndNext = pWinStaObj->spwndClipViewer->head.h; /* Set new viewer window */ pWinStaObj->spwndClipViewer = pWindow;cleanup: if(pWinStaObj) ObDereferenceObject(pWinStaObj); UserLeave(); return hWndNext;}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:36,
示例3: NtUserUnlockWindowStationBOOL APIENTRYNtUserUnlockWindowStation(HWINSTA hWindowStation){ PWINSTATION_OBJECT Object; NTSTATUS Status; BOOL Ret; TRACE("About to set process window station with handle (%p)/n", hWindowStation); if (gpidLogon != PsGetCurrentProcessId()) { ERR("Unauthorized process attempted to unlock the window station!/n"); EngSetLastError(ERROR_ACCESS_DENIED); return FALSE; } Status = IntValidateWindowStationHandle(hWindowStation, UserMode, 0, &Object, 0); if (!NT_SUCCESS(Status)) { TRACE("Validation of window station handle (%p) failed/n", hWindowStation); SetLastNtError(Status); return FALSE; } Ret = (Object->Flags & WSS_LOCKED) == WSS_LOCKED; Object->Flags &= ~WSS_LOCKED; ObDereferenceObject(Object); return Ret;}
开发者ID:reactos,项目名称:reactos,代码行数:36,
示例4: IntSetDCBrushColorCOLORREF FASTCALLIntSetDCBrushColor(HDC hdc, COLORREF crColor){ COLORREF OldColor = CLR_INVALID; PDC dc; if (!(dc = DC_LockDc(hdc))) { EngSetLastError(ERROR_INVALID_HANDLE); return CLR_INVALID; } else { OldColor = (COLORREF) dc->pdcattr->ulBrushClr; dc->pdcattr->ulBrushClr = (ULONG) crColor; if ( dc->pdcattr->crBrushClr != crColor ) { dc->pdcattr->ulDirty_ |= DIRTY_FILL; dc->pdcattr->crBrushClr = crColor; } } DC_UnlockDc(dc); return OldColor;}
开发者ID:Strongc,项目名称:reactos,代码行数:24,
示例5: NtUserGetGUIThreadInfoBOOLAPIENTRYNtUserGetGUIThreadInfo( DWORD idThread, /* If NULL use foreground thread */ LPGUITHREADINFO lpgui){ NTSTATUS Status; PTHRDCARETINFO CaretInfo; GUITHREADINFO SafeGui; PDESKTOP Desktop; PUSER_MESSAGE_QUEUE MsgQueue; PTHREADINFO W32Thread; PETHREAD Thread = NULL; DECLARE_RETURN(BOOLEAN); TRACE("Enter NtUserGetGUIThreadInfo/n"); UserEnterShared(); Status = MmCopyFromCaller(&SafeGui, lpgui, sizeof(DWORD)); if(!NT_SUCCESS(Status)) { SetLastNtError(Status); RETURN( FALSE); } if(SafeGui.cbSize != sizeof(GUITHREADINFO)) { EngSetLastError(ERROR_INVALID_PARAMETER); RETURN( FALSE); } if (idThread) { Status = PsLookupThreadByThreadId((HANDLE)(DWORD_PTR)idThread, &Thread); if(!NT_SUCCESS(Status)) { EngSetLastError(ERROR_ACCESS_DENIED); RETURN( FALSE); } W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread; Desktop = W32Thread->rpdesk; if (!Thread || !Desktop ) { if(Thread) ObDereferenceObject(Thread); EngSetLastError(ERROR_ACCESS_DENIED); RETURN( FALSE); } if ( W32Thread->MessageQueue ) MsgQueue = W32Thread->MessageQueue; else { if ( Desktop ) MsgQueue = Desktop->ActiveMessageQueue; } } else { /* Get the foreground thread */ /* FIXME: Handle NULL queue properly? */ MsgQueue = IntGetFocusMessageQueue(); if(!MsgQueue) { EngSetLastError(ERROR_ACCESS_DENIED); RETURN( FALSE); } } CaretInfo = &MsgQueue->CaretInfo; SafeGui.flags = (CaretInfo->Visible ? GUI_CARETBLINKING : 0);/* if (W32Thread->pMenuState->pGlobalPopupMenu) { SafeGui.flags |= GUI_INMENUMODE; if (W32Thread->pMenuState->pGlobalPopupMenu->spwndNotify) SafeGui.hwndMenuOwner = UserHMGetHandle(W32Thread->pMenuState->pGlobalPopupMenu->spwndNotify); if (W32Thread->pMenuState->pGlobalPopupMenu->fHasMenuBar) { if (W32Thread->pMenuState->pGlobalPopupMenu->fIsSysMenu) { SafeGui.flags |= GUI_SYSTEMMENUMODE; } } else { SafeGui.flags |= GUI_POPUPMENUMODE; } } */ SafeGui.hwndMenuOwner = MsgQueue->MenuOwner; if (MsgQueue->MenuOwner) SafeGui.flags |= GUI_INMENUMODE | MsgQueue->MenuState; if (MsgQueue->MoveSize) SafeGui.flags |= GUI_INMOVESIZE;//.........这里部分代码省略.........
开发者ID:Moteesh,项目名称:reactos,代码行数:101,
示例6: GreStretchBltMaskBOOL APIENTRYGreStretchBltMask( HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD ROP, IN DWORD dwBackColor, HDC hDCMask, INT XOriginMask, INT YOriginMask){ PDC DCDest; PDC DCSrc = NULL; PDC DCMask = NULL; HDC ahDC[3]; PGDIOBJ apObj[3]; PDC_ATTR pdcattr; SURFACE *BitmapDest, *BitmapSrc = NULL; SURFACE *BitmapMask = NULL; RECTL DestRect; RECTL SourceRect; POINTL MaskPoint; BOOL Status = FALSE; EXLATEOBJ exlo; XLATEOBJ *XlateObj = NULL; POINTL BrushOrigin; BOOL UsesSource; BOOL UsesMask; FIXUP_ROP(ROP); UsesSource = ROP_USES_SOURCE(ROP); UsesMask = ROP_USES_MASK(ROP); if (0 == WidthDest || 0 == HeightDest || 0 == WidthSrc || 0 == HeightSrc) { EngSetLastError(ERROR_INVALID_PARAMETER); return TRUE; } if (!hDCDest || (UsesSource && !hDCSrc) || (UsesMask && !hDCMask)) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } ahDC[0] = hDCDest; ahDC[1] = UsesSource ? hDCSrc : NULL; ahDC[2] = UsesMask ? hDCMask : NULL; if (!GDIOBJ_bLockMultipleObjects(3, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE)) { WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to GreStretchBltMask/n", hDCDest, hDCSrc); EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } DCDest = apObj[0]; DCSrc = apObj[1]; DCMask = apObj[2]; if (DCDest->dctype == DC_TYPE_INFO) { if(DCSrc) GDIOBJ_vUnlockObject(&DCSrc->BaseObject); if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } if (UsesSource) { if (DCSrc->dctype == DC_TYPE_INFO) { GDIOBJ_vUnlockObject(&DCDest->BaseObject); GDIOBJ_vUnlockObject(&DCSrc->BaseObject); if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } } pdcattr = DCDest->pdcattr; DestRect.left = XOriginDest; DestRect.top = YOriginDest; DestRect.right = XOriginDest+WidthDest; DestRect.bottom = YOriginDest+HeightDest; IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2); DestRect.left += DCDest->ptlDCOrig.x; DestRect.top += DCDest->ptlDCOrig.y; DestRect.right += DCDest->ptlDCOrig.x; DestRect.bottom += DCDest->ptlDCOrig.y; SourceRect.left = XOriginSrc;//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:101,
示例7: NtGdiTransparentBltBOOL APIENTRYNtGdiTransparentBlt( HDC hdcDst, INT xDst, INT yDst, INT cxDst, INT cyDst, HDC hdcSrc, INT xSrc, INT ySrc, INT cxSrc, INT cySrc, COLORREF TransColor){ PDC DCDest, DCSrc; HDC ahDC[2]; PGDIOBJ apObj[2]; RECTL rcDest, rcSrc; SURFACE *BitmapDest, *BitmapSrc = NULL; ULONG TransparentColor = 0; BOOL Ret = FALSE; EXLATEOBJ exlo; if ((hdcDst == NULL) || (hdcSrc == NULL)) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } TRACE("Locking DCs/n"); ahDC[0] = hdcDst; ahDC[1] = hdcSrc ; if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE)) { WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend/n", hdcDst, hdcSrc); EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } DCDest = apObj[0]; DCSrc = apObj[1]; if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } rcDest.left = xDst; rcDest.top = yDst; rcDest.right = rcDest.left + cxDst; rcDest.bottom = rcDest.top + cyDst; IntLPtoDP(DCDest, (LPPOINT)&rcDest, 2); rcDest.left += DCDest->ptlDCOrig.x; rcDest.top += DCDest->ptlDCOrig.y; rcDest.right += DCDest->ptlDCOrig.x; rcDest.bottom += DCDest->ptlDCOrig.y; rcSrc.left = xSrc; rcSrc.top = ySrc; rcSrc.right = rcSrc.left + cxSrc; rcSrc.bottom = rcSrc.top + cySrc; IntLPtoDP(DCSrc, (LPPOINT)&rcSrc, 2); rcSrc.left += DCSrc->ptlDCOrig.x; rcSrc.top += DCSrc->ptlDCOrig.y; rcSrc.right += DCSrc->ptlDCOrig.x; rcSrc.bottom += DCSrc->ptlDCOrig.y; /* Prepare for blit */ DC_vPrepareDCsForBlit(DCDest, &rcDest, DCSrc, &rcSrc); BitmapDest = DCDest->dclevel.pSurface; if (!BitmapDest) { goto done; } BitmapSrc = DCSrc->dclevel.pSurface; if (!BitmapSrc) { goto done; } /* Translate Transparent (RGB) Color to the source palette */ EXLATEOBJ_vInitialize(&exlo, &gpalRGB, BitmapSrc->ppal, 0, 0, 0); TransparentColor = XLATEOBJ_iXlate(&exlo.xlo, (ULONG)TransColor); EXLATEOBJ_vCleanup(&exlo); EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest); Ret = IntEngTransparentBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj, &DCDest->co.ClipObj, &exlo.xlo, &rcDest, &rcSrc, TransparentColor, 0); EXLATEOBJ_vCleanup(&exlo);done://.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:101,
示例8: IntGdiExtCreatePenHPENAPIENTRYIntGdiExtCreatePen( DWORD dwPenStyle, DWORD dwWidth, IN ULONG ulBrushStyle, IN ULONG ulColor, IN ULONG_PTR ulClientHatch, IN ULONG_PTR ulHatch, DWORD dwStyleCount, PULONG pStyle, IN ULONG cjDIB, IN BOOL bOldStylePen, IN OPTIONAL HBRUSH hbrush){ HPEN hPen; PBRUSH pbrushPen; static const BYTE PatternAlternate[] = {0x55, 0x55, 0x55, 0}; static const BYTE PatternDash[] = {0xFF, 0xFF, 0xC0, 0}; static const BYTE PatternDot[] = {0xE3, 0x8E, 0x38, 0}; static const BYTE PatternDashDot[] = {0xFF, 0x81, 0xC0, 0}; static const BYTE PatternDashDotDot[] = {0xFF, 0x8E, 0x38, 0}; dwWidth = abs(dwWidth); if ( (dwPenStyle & PS_STYLE_MASK) == PS_NULL) { return StockObjects[NULL_PEN]; } if (bOldStylePen) { pbrushPen = PEN_AllocPenWithHandle(); } else { pbrushPen = PEN_AllocExtPenWithHandle(); } if (!pbrushPen) { EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); DPRINT("Can't allocate pen/n"); return 0; } hPen = pbrushPen->BaseObject.hHmgr; // If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation. if ((bOldStylePen) && (!dwWidth) && ((dwPenStyle & PS_STYLE_MASK) != PS_SOLID)) dwWidth = 1; pbrushPen->lWidth = dwWidth; pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth; pbrushPen->ulPenStyle = dwPenStyle; pbrushPen->BrushAttr.lbColor = ulColor; pbrushPen->iBrushStyle = ulBrushStyle; // FIXME: Copy the bitmap first ? pbrushPen->hbmClient = (HANDLE)ulClientHatch; pbrushPen->dwStyleCount = dwStyleCount; pbrushPen->pStyle = pStyle; pbrushPen->flAttrs = bOldStylePen ? BR_IS_OLDSTYLEPEN : BR_IS_PEN; // If dwPenStyle is PS_COSMETIC, the width must be set to 1. if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) ) goto ExitCleanup; switch (dwPenStyle & PS_STYLE_MASK) { case PS_NULL: pbrushPen->flAttrs |= BR_IS_NULL; break; case PS_SOLID: pbrushPen->flAttrs |= BR_IS_SOLID; break; case PS_ALTERNATE: pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate); break; case PS_DOT: pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDot); break; case PS_DASH: pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDash); break; case PS_DASHDOT: pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDot); break; case PS_DASHDOTDOT: pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDotDot);//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:101,
示例9: NtGdiExtCreatePenHPENAPIENTRYNtGdiExtCreatePen( DWORD dwPenStyle, DWORD ulWidth, IN ULONG ulBrushStyle, IN ULONG ulColor, IN ULONG_PTR ulClientHatch, IN ULONG_PTR ulHatch, DWORD dwStyleCount, PULONG pUnsafeStyle, IN ULONG cjDIB, IN BOOL bOldStylePen, IN OPTIONAL HBRUSH hBrush){ NTSTATUS Status = STATUS_SUCCESS; DWORD* pSafeStyle = NULL; HPEN hPen; if ((int)dwStyleCount < 0) return 0; if (dwStyleCount > 16) { EngSetLastError(ERROR_INVALID_PARAMETER); return 0; } if (dwStyleCount > 0) { if (pUnsafeStyle == NULL) { EngSetLastError(ERROR_INVALID_PARAMETER); return 0; } pSafeStyle = ExAllocatePoolWithTag(NonPagedPool, dwStyleCount * sizeof(DWORD), GDITAG_PENSTYLE); if (!pSafeStyle) { SetLastNtError(ERROR_NOT_ENOUGH_MEMORY); return 0; } _SEH2_TRY { ProbeForRead(pUnsafeStyle, dwStyleCount * sizeof(DWORD), 1); RtlCopyMemory(pSafeStyle, pUnsafeStyle, dwStyleCount * sizeof(DWORD)); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { Status = _SEH2_GetExceptionCode(); } _SEH2_END if(!NT_SUCCESS(Status)) { SetLastNtError(Status); ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); return 0; } } if (ulBrushStyle == BS_PATTERN) { _SEH2_TRY { ProbeForRead((PVOID)ulHatch, cjDIB, 1); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { Status = _SEH2_GetExceptionCode(); } _SEH2_END if(!NT_SUCCESS(Status)) { SetLastNtError(Status); if (pSafeStyle) ExFreePoolWithTag(pSafeStyle, GDITAG_PENSTYLE); return 0; } }
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:80,
示例10: NtUserGetClipboardDataHANDLE APIENTRYNtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd){ HANDLE hRet = NULL; PCLIP pElement; PWINSTATION_OBJECT pWinStaObj = NULL; TRACE("NtUserGetClipboardData(%x, %p)/n", fmt, pgcd); UserEnterShared(); pWinStaObj = IntGetWinStaForCbAccess(); if (!pWinStaObj) goto cleanup; if (!IntIsClipboardOpenByMe(pWinStaObj)) { EngSetLastError(ERROR_CLIPBOARD_NOT_OPEN); goto cleanup; } pElement = IntIsFormatAvailable(pWinStaObj, fmt); if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner) { /* Send WM_RENDERFORMAT message */ pWinStaObj->fInDelayedRendering = TRUE; co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)fmt, 0); pWinStaObj->fInDelayedRendering = FALSE; /* Data should be in clipboard now */ pElement = IntIsFormatAvailable(pWinStaObj, fmt); } if (!pElement || IS_DATA_DELAYED(pElement)) goto cleanup; if (IS_DATA_SYNTHESIZED(pElement)) { /* Note: Data is synthesized in usermode */ /* TODO: Add more formats */ switch (fmt) { case CF_UNICODETEXT: case CF_TEXT: case CF_OEMTEXT: pElement = IntIsFormatAvailable(pWinStaObj, CF_UNICODETEXT); if (IS_DATA_SYNTHESIZED(pElement)) pElement = IntIsFormatAvailable(pWinStaObj, CF_TEXT); if (IS_DATA_SYNTHESIZED(pElement)) pElement = IntIsFormatAvailable(pWinStaObj, CF_OEMTEXT); break; case CF_BITMAP: IntSynthesizeBitmap(pWinStaObj, pElement); break; default: ASSERT(FALSE); } } _SEH2_TRY { ProbeForWrite(pgcd, sizeof(*pgcd), 1); pgcd->uFmtRet = pElement->fmt; pgcd->fGlobalHandle = pElement->fGlobalHandle; /* Text and bitmap needs more data */ if (fmt == CF_TEXT) { PCLIP pLocaleEl; pLocaleEl = IntIsFormatAvailable(pWinStaObj, CF_LOCALE); if (pLocaleEl && !IS_DATA_DELAYED(pLocaleEl)) pgcd->hLocale = pLocaleEl->hData; } else if (fmt == CF_BITMAP) { PCLIP pPaletteEl; pPaletteEl = IntIsFormatAvailable(pWinStaObj, CF_PALETTE); if (pPaletteEl && !IS_DATA_DELAYED(pPaletteEl)) pgcd->hPalette = pPaletteEl->hData; } hRet = pElement->hData; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { SetLastNtError(_SEH2_GetExceptionCode()); } _SEH2_END;cleanup: if(pWinStaObj) ObDereferenceObject(pWinStaObj); UserLeave(); TRACE("NtUserGetClipboardData returns %p/n", hRet);//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:101,
示例11: NtGdiDescribePixelFormatINTAPIENTRYNtGdiDescribePixelFormat(HDC hDC, INT PixelFormat, UINT BufSize, LPPIXELFORMATDESCRIPTOR pfd){ PDC pdc; PPDEVOBJ ppdev; INT Ret = 0; PIXELFORMATDESCRIPTOR pfdSafe; NTSTATUS Status = STATUS_SUCCESS; if (!BufSize) return 0; pdc = DC_LockDc(hDC); if (!pdc) { EngSetLastError(ERROR_INVALID_HANDLE); return 0; } if (!pdc->ipfdDevMax) IntGetipfdDevMax(pdc); if ( BufSize < sizeof(PIXELFORMATDESCRIPTOR) || PixelFormat < 1 || PixelFormat > pdc->ipfdDevMax ) { EngSetLastError(ERROR_INVALID_PARAMETER); goto Exit; } ppdev = pdc->ppdev; if (ppdev->flFlags & PDEV_META_DEVICE) { UNIMPLEMENTED; goto Exit; } if (ppdev->DriverFunctions.DescribePixelFormat) { Ret = ppdev->DriverFunctions.DescribePixelFormat( ppdev->dhpdev, PixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfdSafe); } _SEH2_TRY { ProbeForWrite( pfd, sizeof(PIXELFORMATDESCRIPTOR), 1); RtlCopyMemory(&pfdSafe, pfd, sizeof(PIXELFORMATDESCRIPTOR)); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { Status = _SEH2_GetExceptionCode(); } _SEH2_END; if (!NT_SUCCESS(Status)) SetLastNtError(Status);Exit: DC_UnlockDc(pdc); return Ret;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:68,
示例12: NtGdiExtFloodFillBOOL APIENTRYNtGdiExtFloodFill( HDC hDC, INT XStart, INT YStart, COLORREF Color, UINT FillType){ PDC dc;#if 0 PDC_ATTR pdcattr;#endif SURFACE *psurf; EXLATEOBJ exlo; BOOL Ret = FALSE; RECTL DestRect; POINTL Pt; ULONG ConvColor; dc = DC_LockDc(hDC); if (!dc) { EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } if (dc->dctype == DC_TYPE_INFO) { DC_UnlockDc(dc); /* Yes, Windows really returns TRUE in this case */ return TRUE; } if (!dc->dclevel.pSurface) { Ret = FALSE; goto cleanup; }#if 0 pdcattr = dc->pdcattr;#endif Pt.x = XStart; Pt.y = YStart; IntLPtoDP(dc, (LPPOINT)&Pt, 1); DC_vPrepareDCsForBlit(dc, &DestRect, NULL, NULL); /// FIXME: what about prgnVIS? And what about REAL clipping? psurf = dc->dclevel.pSurface; if (dc->prgnRao) { Ret = REGION_PtInRegion(dc->prgnRao, Pt.x, Pt.y); if (Ret) REGION_GetRgnBox(dc->prgnRao, (LPRECT)&DestRect); else { DC_vFinishBlit(dc, NULL); goto cleanup; } } else { RECTL_vSetRect(&DestRect, 0, 0, psurf->SurfObj.sizlBitmap.cx, psurf->SurfObj.sizlBitmap.cy); } EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0xffffff, 0); /* Only solid fills supported for now * How to support pattern brushes and non standard surfaces (not offering dib functions): * Version a (most likely slow): call DrvPatBlt for every pixel * Version b: create a flood mask and let MaskBlt blit a masked brush */ ConvColor = XLATEOBJ_iXlate(&exlo.xlo, Color); Ret = DIB_XXBPP_FloodFillSolid(&psurf->SurfObj, &dc->eboFill.BrushObject, &DestRect, &Pt, ConvColor, FillType); DC_vFinishBlit(dc, NULL); EXLATEOBJ_vCleanup(&exlo);cleanup: DC_UnlockDc(dc); return Ret;}
开发者ID:reactos,项目名称:reactos,代码行数:83,
示例13: NtGdiAlphaBlendBOOL APIENTRYNtGdiAlphaBlend( HDC hDCDest, LONG XOriginDest, LONG YOriginDest, LONG WidthDest, LONG HeightDest, HDC hDCSrc, LONG XOriginSrc, LONG YOriginSrc, LONG WidthSrc, LONG HeightSrc, BLENDFUNCTION BlendFunc, HANDLE hcmXform){ PDC DCDest; PDC DCSrc; HDC ahDC[2]; PGDIOBJ apObj[2]; SURFACE *BitmapDest, *BitmapSrc; RECTL DestRect, SourceRect; BOOL bResult; EXLATEOBJ exlo; BLENDOBJ BlendObj; BlendObj.BlendFunction = BlendFunc; if (WidthDest < 0 || HeightDest < 0 || WidthSrc < 0 || HeightSrc < 0) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } if ((hDCDest == NULL) || (hDCSrc == NULL)) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } TRACE("Locking DCs/n"); ahDC[0] = hDCDest; ahDC[1] = hDCSrc ; if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE)) { WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend/n", hDCDest, hDCSrc); EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } DCDest = apObj[0]; DCSrc = apObj[1]; if (DCDest->dctype == DC_TYPE_INFO || DCDest->dctype == DCTYPE_INFO) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); /* Yes, Windows really returns TRUE in this case */ return TRUE; } DestRect.left = XOriginDest; DestRect.top = YOriginDest; DestRect.right = XOriginDest + WidthDest; DestRect.bottom = YOriginDest + HeightDest; IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2); DestRect.left += DCDest->ptlDCOrig.x; DestRect.top += DCDest->ptlDCOrig.y; DestRect.right += DCDest->ptlDCOrig.x; DestRect.bottom += DCDest->ptlDCOrig.y; SourceRect.left = XOriginSrc; SourceRect.top = YOriginSrc; SourceRect.right = XOriginSrc + WidthSrc; SourceRect.bottom = YOriginSrc + HeightSrc; IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2); SourceRect.left += DCSrc->ptlDCOrig.x; SourceRect.top += DCSrc->ptlDCOrig.y; SourceRect.right += DCSrc->ptlDCOrig.x; SourceRect.bottom += DCSrc->ptlDCOrig.y; if (!DestRect.right || !DestRect.bottom || !SourceRect.right || !SourceRect.bottom) { GDIOBJ_vUnlockObject(&DCSrc->BaseObject); GDIOBJ_vUnlockObject(&DCDest->BaseObject); return TRUE; } /* Prepare DCs for blit */ TRACE("Preparing DCs for blit/n"); DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect); /* Determine surfaces to be used in the bitblt */ BitmapDest = DCDest->dclevel.pSurface; if (!BitmapDest) { bResult = FALSE ; goto leave ;//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:101,
示例14: NtUserCallNoParam/* * @unimplemented */DWORD_PTRAPIENTRYNtUserCallNoParam(DWORD Routine){ DWORD_PTR Result = 0; DECLARE_RETURN(DWORD_PTR); TRACE("Enter NtUserCallNoParam/n"); UserEnterExclusive(); switch(Routine) { case NOPARAM_ROUTINE_CREATEMENU: Result = (DWORD_PTR)UserCreateMenu(FALSE); break; case NOPARAM_ROUTINE_CREATEMENUPOPUP: Result = (DWORD_PTR)UserCreateMenu(TRUE); break; case NOPARAM_ROUTINE_DESTROY_CARET: Result = (DWORD_PTR)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread); break; case NOPARAM_ROUTINE_INIT_MESSAGE_PUMP: Result = (DWORD_PTR)IntInitMessagePumpHook(); break; case NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP: Result = (DWORD_PTR)IntUninitMessagePumpHook(); break; case NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO: Result = (DWORD_PTR)MsqGetMessageExtraInfo(); break; case NOPARAM_ROUTINE_MSQCLEARWAKEMASK: RETURN( (DWORD_PTR)IntMsqClearWakeMask()); case NOPARAM_ROUTINE_GETMSESSAGEPOS: { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); RETURN( (DWORD_PTR)MAKELONG(pti->ptLast.x, pti->ptLast.y)); } case NOPARAM_ROUTINE_RELEASECAPTURE: RETURN( (DWORD_PTR)IntReleaseCapture()); case NOPARAM_ROUTINE_LOADUSERAPIHOOK: RETURN(UserLoadApiHook()); case NOPARAM_ROUTINE_ZAPACTIVEANDFOUS: { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); TRACE("Zapping the Active and Focus window out of the Queue!/n"); pti->MessageQueue->spwndFocus = NULL; pti->MessageQueue->spwndActive = NULL; RETURN(0); } /* this is a Reactos only case and is needed for gui-on-demand */ case NOPARAM_ROUTINE_ISCONSOLEMODE: RETURN( ScreenDeviceContext == NULL ); default: ERR("Calling invalid routine number 0x%x in NtUserCallNoParam/n", Routine); EngSetLastError(ERROR_INVALID_PARAMETER); break; } RETURN(Result);CLEANUP: TRACE("Leave NtUserCallNoParam, ret=%p/n",(PVOID)_ret_); UserLeave(); END_CLEANUP;}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:79,
示例15: NtGdiMaskBltBOOL APIENTRYNtGdiMaskBlt( HDC hdcDest, INT nXDest, INT nYDest, INT nWidth, INT nHeight, HDC hdcSrc, INT nXSrc, INT nYSrc, HBITMAP hbmMask, INT xMask, INT yMask, DWORD dwRop, IN DWORD crBackColor){ PDC DCDest; PDC DCSrc = NULL; HDC ahDC[2]; PGDIOBJ apObj[2]; PDC_ATTR pdcattr = NULL; SURFACE *BitmapDest, *BitmapSrc = NULL, *psurfMask = NULL; RECTL DestRect, SourceRect; POINTL SourcePoint, MaskPoint; BOOL Status = FALSE; EXLATEOBJ exlo; XLATEOBJ *XlateObj = NULL; BOOL UsesSource; FIXUP_ROP(dwRop); // FIXME: why do we need this??? //DPRINT1("dwRop : 0x%08x/n", dwRop); UsesSource = ROP_USES_SOURCE(dwRop); if (!hdcDest || (UsesSource && !hdcSrc)) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } /* Check if we need a mask and have a mask bitmap */ if (ROP_USES_MASK(dwRop) && (hbmMask != NULL)) { /* Reference the mask bitmap */ psurfMask = SURFACE_ShareLockSurface(hbmMask); if (psurfMask == NULL) { EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } /* Make sure the mask bitmap is 1 BPP */ if (gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1) { EngSetLastError(ERROR_INVALID_PARAMETER); SURFACE_ShareUnlockSurface(psurfMask); return FALSE; } } else { /* We use NULL, if we need a mask, the Eng function will take care of that and use the brushobject to get a mask */ psurfMask = NULL; } MaskPoint.x = xMask; MaskPoint.y = yMask; /* Take care of source and destination bitmap */ TRACE("Locking DCs/n"); ahDC[0] = hdcDest; ahDC[1] = UsesSource ? hdcSrc : NULL; if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE)) { WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend/n", hdcDest, hdcSrc); EngSetLastError(ERROR_INVALID_HANDLE); return FALSE; } DCDest = apObj[0]; DCSrc = apObj[1]; ASSERT(DCDest); if (NULL == DCDest) { if(DCSrc) DC_UnlockDc(DCSrc); WARN("Invalid destination dc handle (0x%p) passed to NtGdiBitBlt/n", hdcDest); return FALSE; } if (DCDest->dctype == DC_TYPE_INFO) { if(DCSrc) DC_UnlockDc(DCSrc); DC_UnlockDc(DCDest); /* Yes, Windows really returns TRUE in this case */ return TRUE; } if (UsesSource) { ASSERT(DCSrc);//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:101,
示例16: NtGdiCreateBitmapHBITMAPAPIENTRYNtGdiCreateBitmap( IN INT nWidth, IN INT nHeight, IN UINT cPlanes, IN UINT cBitsPixel, IN OPTIONAL LPBYTE pUnsafeBits){ HBITMAP hbmp; ULONG cRealBpp, cjWidthBytes, iFormat; ULONGLONG cjSize; PSURFACE psurf; /* Calculate bitmap format and real bits per pixel. */ iFormat = BitmapFormat(cBitsPixel * cPlanes, BI_RGB); cRealBpp = gajBitsPerFormat[iFormat]; /* Calculate width and image size in bytes */ cjWidthBytes = WIDTH_BYTES_ALIGN16(nWidth, cRealBpp); cjSize = (ULONGLONG)cjWidthBytes * nHeight; /* Check parameters (possible overflow of cjSize!) */ if ((iFormat == 0) || (nWidth <= 0) || (nWidth >= 0x8000000) || (nHeight <= 0) || (cBitsPixel > 32) || (cPlanes > 32) || (cjSize >= 0x100000000ULL)) { DPRINT1("Invalid bitmap format! Width=%d, Height=%d, Bpp=%u, Planes=%u/n", nWidth, nHeight, cBitsPixel, cPlanes); EngSetLastError(ERROR_INVALID_PARAMETER); return NULL; } /* Allocate the surface (but don't set the bits) */ psurf = SURFACE_AllocSurface(STYPE_BITMAP, nWidth, nHeight, iFormat, 0, 0, NULL); if (!psurf) { DPRINT1("SURFACE_AllocSurface failed./n"); return NULL; } /* Mark as API and DDB bitmap */ psurf->flags |= (API_BITMAP | DDB_SURFACE); /* Check if we have bits to set */ if (pUnsafeBits) { /* Protect with SEH and copy the bits */ _SEH2_TRY { ProbeForRead(pUnsafeBits, (SIZE_T)cjSize, 1); UnsafeSetBitmapBits(psurf, 0, pUnsafeBits); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { GDIOBJ_vDeleteObject(&psurf->BaseObject); _SEH2_YIELD(return NULL;) } _SEH2_END } else {
开发者ID:hoangduit,项目名称:reactos,代码行数:67,
示例17: NtUserChangeDisplaySettingsLONGAPIENTRYNtUserChangeDisplaySettings( PUNICODE_STRING pustrDevice, LPDEVMODEW lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam){ WCHAR awcDevice[CCHDEVICENAME]; UNICODE_STRING ustrDevice; DEVMODEW dmLocal; LONG lRet; /* Check arguments */ if ((dwflags != CDS_VIDEOPARAMETERS && lParam != NULL) || (hwnd != NULL)) { EngSetLastError(ERROR_INVALID_PARAMETER); return DISP_CHANGE_BADPARAM; } /* Check flags */ if ((dwflags & (CDS_GLOBAL|CDS_NORESET)) && !(dwflags & CDS_UPDATEREGISTRY)) { return DISP_CHANGE_BADFLAGS; } /* Copy the device name */ if (pustrDevice) { /* Initialize destination string */ RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice)); _SEH2_TRY { /* Probe the UNICODE_STRING and the buffer */ ProbeForRead(pustrDevice, sizeof(UNICODE_STRING), 1); ProbeForRead(pustrDevice->Buffer, pustrDevice->Length, 1); /* Copy the string */ RtlCopyUnicodeString(&ustrDevice, pustrDevice); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Set and return error */ SetLastNtError(_SEH2_GetExceptionCode()); _SEH2_YIELD(return DISP_CHANGE_BADPARAM); } _SEH2_END pustrDevice = &ustrDevice; } /* Copy devmode */ if (lpDevMode) { _SEH2_TRY { /* Probe the size field of the structure */ ProbeForRead(lpDevMode, sizeof(dmLocal.dmSize), 1); /* Calculate usable size */ dmLocal.dmSize = min(sizeof(dmLocal), lpDevMode->dmSize); /* Probe and copy the full DEVMODE */ ProbeForRead(lpDevMode, dmLocal.dmSize, 1); RtlCopyMemory(&dmLocal, lpDevMode, dmLocal.dmSize); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Set and return error */ SetLastNtError(_SEH2_GetExceptionCode()); _SEH2_YIELD(return DISP_CHANGE_BADPARAM); } _SEH2_END /* Check for extra parameters */ if (dmLocal.dmDriverExtra > 0) { /* FIXME: TODO */ ERR("lpDevMode->dmDriverExtra is IGNORED!/n"); dmLocal.dmDriverExtra = 0; } /* Use the local structure */ lpDevMode = &dmLocal; } // FIXME: Copy videoparameters /* Acquire global USER lock */ UserEnterExclusive(); /* Call internal function */ lRet = UserChangeDisplaySettings(pustrDevice, lpDevMode, hwnd, dwflags, NULL); /* Release lock */ UserLeave();//.........这里部分代码省略.........
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:101,
示例18: NtUserCreateCaretBOOLAPIENTRYNtUserCreateCaret( HWND hWnd, HBITMAP hBitmap, int nWidth, int nHeight){ PWND Window; PTHREADINFO pti; PUSER_MESSAGE_QUEUE ThreadQueue; DECLARE_RETURN(BOOL); TRACE("Enter NtUserCreateCaret/n"); UserEnterExclusive(); if(!(Window = UserGetWindowObject(hWnd))) { RETURN(FALSE); } if(Window->head.pti->pEThread != PsGetCurrentThread()) { EngSetLastError(ERROR_ACCESS_DENIED); RETURN(FALSE); } pti = PsGetCurrentThreadWin32Thread(); ThreadQueue = pti->MessageQueue; if (ThreadQueue->CaretInfo->Visible) { IntKillTimer(Window, IDCARETTIMER, TRUE); co_IntHideCaret(ThreadQueue->CaretInfo); } ThreadQueue->CaretInfo->hWnd = hWnd; if(hBitmap) { ThreadQueue->CaretInfo->Bitmap = hBitmap; ThreadQueue->CaretInfo->Size.cx = ThreadQueue->CaretInfo->Size.cy = 0; } else { if (nWidth == 0) { nWidth = UserGetSystemMetrics(SM_CXBORDER); } if (nHeight == 0) { nHeight = UserGetSystemMetrics(SM_CYBORDER); } ThreadQueue->CaretInfo->Bitmap = (HBITMAP)0; ThreadQueue->CaretInfo->Size.cx = nWidth; ThreadQueue->CaretInfo->Size.cy = nHeight; } ThreadQueue->CaretInfo->Visible = 0; ThreadQueue->CaretInfo->Showing = 0; IntSetTimer( Window, IDCARETTIMER, gpsi->dtCaretBlink, CaretSystemTimerProc, TMRF_SYSTEM ); IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_CARET, CHILDID_SELF, 0); RETURN(TRUE);CLEANUP: TRACE("Leave NtUserCreateCaret, ret=%i/n",_ret_); UserLeave(); END_CLEANUP;}
开发者ID:CSRedRat,项目名称:reactos-playground,代码行数:70,
示例19: NtUserCallOneParam/* * @implemented */DWORD_PTRAPIENTRYNtUserCallOneParam( DWORD_PTR Param, DWORD Routine){ DECLARE_RETURN(DWORD_PTR); TRACE("Enter NtUserCallOneParam/n"); UserEnterExclusive(); switch(Routine) { case ONEPARAM_ROUTINE_POSTQUITMESSAGE: { PTHREADINFO pti; pti = PsGetCurrentThreadWin32Thread(); MsqPostQuitMessage(pti->MessageQueue, Param); RETURN(TRUE); } case ONEPARAM_ROUTINE_BEGINDEFERWNDPOS: { PSMWP psmwp; HDWP hDwp = NULL; INT count = (INT)Param; if (count < 0) { EngSetLastError(ERROR_INVALID_PARAMETER); RETURN(0); } /* Windows allows zero count, in which case it allocates context for 8 moves */ if (count == 0) count = 8; psmwp = (PSMWP) UserCreateObject( gHandleTable, NULL, (PHANDLE)&hDwp, otSMWP, sizeof(SMWP)); if (!psmwp) RETURN(0); psmwp->acvr = ExAllocatePoolWithTag(PagedPool, count * sizeof(CVR), USERTAG_SWP); if (!psmwp->acvr) { UserDeleteObject(hDwp, otSMWP); RETURN(0); } RtlZeroMemory(psmwp->acvr, count * sizeof(CVR)); psmwp->bHandle = TRUE; psmwp->ccvr = 0; // actualCount psmwp->ccvrAlloc = count; // suggestedCount RETURN((DWORD_PTR)hDwp); } case ONEPARAM_ROUTINE_SHOWCURSOR: RETURN( (DWORD_PTR)UserShowCursor((BOOL)Param) ); case ONEPARAM_ROUTINE_GETDESKTOPMAPPING: { PTHREADINFO ti; ti = GetW32ThreadInfo(); if (ti != NULL) { /* Try convert the pointer to a user mode pointer if the desktop is mapped into the process */ RETURN((DWORD_PTR)DesktopHeapAddressToUser((PVOID)Param)); } else { RETURN(0); } } case ONEPARAM_ROUTINE_WINDOWFROMDC: RETURN( (DWORD_PTR)IntWindowFromDC((HDC)Param)); case ONEPARAM_ROUTINE_SWAPMOUSEBUTTON: { DWORD_PTR Result; Result = gspv.bMouseBtnSwap; gspv.bMouseBtnSwap = Param ? TRUE : FALSE; gpsi->aiSysMet[SM_SWAPBUTTON] = gspv.bMouseBtnSwap; RETURN(Result); } case ONEPARAM_ROUTINE_SWITCHCARETSHOWING: RETURN( (DWORD_PTR)IntSwitchCaretShowing((PVOID)Param)); case ONEPARAM_ROUTINE_SETCARETBLINKTIME: RETURN( (DWORD_PTR)IntSetCaretBlinkTime((UINT)Param)); case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO: RETURN( (DWORD_PTR)MsqSetMessageExtraInfo((LPARAM)Param)); case ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT://.........这里部分代码省略.........
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:101,
示例20: NtUserCallTwoParam/* * @implemented */DWORD_PTRAPIENTRYNtUserCallTwoParam( DWORD_PTR Param1, DWORD_PTR Param2, DWORD Routine){ PWND Window; DECLARE_RETURN(DWORD_PTR); TRACE("Enter NtUserCallTwoParam/n"); UserEnterExclusive(); switch(Routine) { case TWOPARAM_ROUTINE_SETMENUBARHEIGHT: { DWORD_PTR Ret; PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1); if(!MenuObject) RETURN( 0); if(Param2 > 0) { Ret = (MenuObject->MenuInfo.Height == (int)Param2); MenuObject->MenuInfo.Height = (int)Param2; } else Ret = (DWORD_PTR)MenuObject->MenuInfo.Height; IntReleaseMenuObject(MenuObject); RETURN( Ret); } case TWOPARAM_ROUTINE_SETGUITHRDHANDLE: { PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue; ASSERT(MsgQueue); RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2)); } case TWOPARAM_ROUTINE_ENABLEWINDOW: RETURN( IntEnableWindow((HWND)Param1, (BOOL)Param2)); case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS: { Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(0); RETURN( (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL) Param2)); } case TWOPARAM_ROUTINE_ROS_UPDATEUISTATE: { WPARAM wParam; Window = UserGetWindowObject((HWND)Param1); if (!Window) RETURN(0); /* Unpack wParam */ wParam = MAKEWPARAM((Param2 >> 3) & 0x3, Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE)); RETURN( UserUpdateUiState(Window, wParam) ); } case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW: STUB RETURN( 0); case TWOPARAM_ROUTINE_SETCARETPOS: RETURN( (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2)); case TWOPARAM_ROUTINE_REGISTERLOGONPROCESS: RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2)); case TWOPARAM_ROUTINE_SETCURSORPOS: RETURN( (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0, FALSE)); case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK: RETURN( IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2)); } ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x/n", Routine, Param1, Param2); EngSetLastError(ERROR_INVALID_PARAMETER); RETURN( 0);CLEANUP: TRACE("Leave NtUserCallTwoParam, ret=%i/n",_ret_); UserLeave(); END_CLEANUP;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:95,
示例21: NtUserGetGuiResourcesDWORDAPIENTRYNtUserGetGuiResources( HANDLE hProcess, DWORD uiFlags){ PEPROCESS Process; PPROCESSINFO W32Process; NTSTATUS Status; DWORD Ret = 0; DECLARE_RETURN(DWORD); TRACE("Enter NtUserGetGuiResources/n"); UserEnterShared(); Status = ObReferenceObjectByHandle(hProcess, PROCESS_QUERY_INFORMATION, *PsProcessType, ExGetPreviousMode(), (PVOID*)&Process, NULL); if(!NT_SUCCESS(Status)) { SetLastNtError(Status); RETURN( 0); } W32Process = (PPROCESSINFO)Process->Win32Process; if(!W32Process) { ObDereferenceObject(Process); EngSetLastError(ERROR_INVALID_PARAMETER); RETURN( 0); } switch(uiFlags) { case GR_GDIOBJECTS: { Ret = (DWORD)W32Process->GDIHandleCount; break; } case GR_USEROBJECTS: { Ret = (DWORD)W32Process->UserHandleCount; break; } default: { EngSetLastError(ERROR_INVALID_PARAMETER); break; } } ObDereferenceObject(Process); RETURN( Ret);CLEANUP: TRACE("Leave NtUserGetGuiResources, ret=%lu/n",_ret_); UserLeave(); END_CLEANUP;}
开发者ID:Moteesh,项目名称:reactos,代码行数:64,
示例22: EngAlphaBlend/* * @implemented */BOOLAPIENTRYEngAlphaBlend(IN SURFOBJ *psoDest, IN SURFOBJ *psoSource, IN CLIPOBJ *ClipRegion, IN XLATEOBJ *ColorTranslation, IN PRECTL DestRect, IN PRECTL SourceRect, IN BLENDOBJ *BlendObj){ RECTL InputRect; RECTL OutputRect; RECTL ClipRect; RECTL CombinedRect; RECTL Rect; POINTL Translate; INTENG_ENTER_LEAVE EnterLeaveSource; INTENG_ENTER_LEAVE EnterLeaveDest; SURFOBJ* InputObj; SURFOBJ* OutputObj; LONG ClippingType; RECT_ENUM RectEnum; BOOL EnumMore; INT i; BOOLEAN Ret; DPRINT("EngAlphaBlend(psoDest:0x%p, psoSource:0x%p, ClipRegion:0x%p, ColorTranslation:0x%p,/n", psoDest, psoSource, ClipRegion, ColorTranslation); DPRINT(" DestRect:{0x%x, 0x%x, 0x%x, 0x%x}, SourceRect:{0x%x, 0x%x, 0x%x, 0x%x},/n", DestRect->left, DestRect->top, DestRect->right, DestRect->bottom, SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom); DPRINT(" BlendObj:{0x%x, 0x%x, 0x%x, 0x%x}/n", BlendObj->BlendFunction.BlendOp, BlendObj->BlendFunction.BlendFlags, BlendObj->BlendFunction.SourceConstantAlpha, BlendObj->BlendFunction.AlphaFormat); /* Validate output */ OutputRect = *DestRect; if (OutputRect.right < OutputRect.left) { OutputRect.left = DestRect->right; OutputRect.right = DestRect->left; } if (OutputRect.bottom < OutputRect.top) { OutputRect.left = DestRect->right; OutputRect.right = DestRect->left; } /* Validate input */ InputRect = *SourceRect; if ( (InputRect.top < 0) || (InputRect.bottom < 0) || (InputRect.left < 0) || (InputRect.right < 0) || InputRect.right > psoSource->sizlBitmap.cx || InputRect.bottom > psoSource->sizlBitmap.cy ) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } if (psoDest == psoSource && !(OutputRect.left >= SourceRect->right || InputRect.left >= OutputRect.right || OutputRect.top >= SourceRect->bottom || InputRect.top >= OutputRect.bottom)) { DPRINT1("Source and destination rectangles overlap!/n"); return FALSE; } if (BlendObj->BlendFunction.BlendOp != AC_SRC_OVER) { DPRINT1("BlendOp != AC_SRC_OVER (0x%x)/n", BlendObj->BlendFunction.BlendOp); return FALSE; } if (BlendObj->BlendFunction.BlendFlags != 0) { DPRINT1("BlendFlags != 0 (0x%x)/n", BlendObj->BlendFunction.BlendFlags); return FALSE; } if ((BlendObj->BlendFunction.AlphaFormat & ~AC_SRC_ALPHA) != 0) { DPRINT1("Unsupported AlphaFormat (0x%x)/n", BlendObj->BlendFunction.AlphaFormat); return FALSE; } /* Check if there is anything to draw */ if (ClipRegion != NULL && (ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right || ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom)) { /* Nothing to do */ return TRUE; } /* Now call the DIB function */ if (!IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE, &Translate, &InputObj)) { return FALSE; } InputRect.left += Translate.x;//.........这里部分代码省略.........
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:101,
注:本文中的EngSetLastError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ EngineData函数代码示例 C++ EngFreeMem函数代码示例 |