BOOL WINAPI SetICMProfileW(HDC hdc, LPWSTR pszFileName) { USE(hdc); USE(pszFileName); GdiSetLastError(ERROR_CALL_NOT_IMPLEMENTED); return(FALSE); }
BOOL WINAPI GetICMProfileW(HDC hdc, DWORD szBuffer, LPWSTR pBuffer) { USE(hdc); USE(pBuffer); USE(szBuffer); GdiSetLastError(ERROR_CALL_NOT_IMPLEMENTED); return(FALSE); }
BOOL WINAPI UpdateICMRegKeyW(DWORD Reserved,PWSTR szICMMatcher,PWSTR szFileName,DWORD Command) { USE(Reserved); USE(szICMMatcher); USE(szFileName); USE(Command); GdiSetLastError(ERROR_CALL_NOT_IMPLEMENTED); return(FALSE); }
int WINAPI GetPath(HDC hdc,LPPOINT apt,LPBYTE aj,int cpt) { FIXUP_HANDLE(hdc); // Check to make sure we don't have an unreasonable number of points or bad handle if (IS_METADC16_TYPE(hdc)) { GdiSetLastError(ERROR_INVALID_PARAMETER); return(-1); } return(NtGdiGetPath(hdc, apt, aj, cpt)); }
INT WINAPI GetDIBits( HDC hDC, HBITMAP hbmp, UINT uStartScan, UINT cScanLines, LPVOID lpvBits, LPBITMAPINFO lpbmi, UINT uUsage) { UINT cjBmpScanSize; UINT cjInfoSize; if (!hDC || !GdiIsHandleValid((HGDIOBJ) hDC) || !lpbmi) { GdiSetLastError(ERROR_INVALID_PARAMETER); return 0; } cjBmpScanSize = DIB_BitmapMaxBitsSize(lpbmi, cScanLines); /* Caller must provide maximum size possible */ cjInfoSize = DIB_BitmapInfoSize(lpbmi, uUsage, TRUE); if (lpvBits) { if (lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) { if (lpbmi->bmiHeader.biCompression == BI_JPEG || lpbmi->bmiHeader.biCompression == BI_PNG) { SetLastError(ERROR_INVALID_PARAMETER); return 0; } } } return NtGdiGetDIBitsInternal(hDC, hbmp, uStartScan, cScanLines, lpvBits, lpbmi, uUsage, cjBmpScanSize, cjInfoSize); }
/* * @implemented */ HBITMAP WINAPI CreateDIBitmap( HDC hDC, const BITMAPINFOHEADER *Header, DWORD Init, LPCVOID Bits, const BITMAPINFO *Data, UINT ColorUse) { LONG width, height, compr, dibsize; WORD planes, bpp; // PDC_ATTR pDc_Attr; UINT InfoSize = 0; UINT cjBmpScanSize = 0; HBITMAP hBmp; NTSTATUS Status = STATUS_SUCCESS; /* Check for CBM_CREATDIB */ if (Init & CBM_CREATDIB) { /* CBM_CREATDIB needs Data. */ if (!Data) { return 0; } /* It only works with PAL or RGB */ if (ColorUse > DIB_PAL_COLORS) { GdiSetLastError(ERROR_INVALID_PARAMETER); return 0; } /* Use the header from the data */ Header = &Data->bmiHeader; } /* Header is required */ if (!Header) { GdiSetLastError(ERROR_INVALID_PARAMETER); return 0; } /* Get the bitmap format and dimensions */ if (DIB_GetBitmapInfo(Header, &width, &height, &planes, &bpp, &compr, &dibsize) == -1) { GdiSetLastError(ERROR_INVALID_PARAMETER); return NULL; } /* Check if the Compr is incompatible */ if ((compr == BI_JPEG) || (compr == BI_PNG) || (compr == BI_BITFIELDS)) return 0; /* Only DIB_RGB_COLORS (0), DIB_PAL_COLORS (1) and 2 are valid. */ if (ColorUse > DIB_PAL_COLORS + 1) { GdiSetLastError(ERROR_INVALID_PARAMETER); return 0; } /* If some Bits are given, only DIB_PAL_COLORS and DIB_RGB_COLORS are valid */ if (Bits && (ColorUse > DIB_PAL_COLORS)) { GdiSetLastError(ERROR_INVALID_PARAMETER); return 0; } /* Negative width is not allowed */ if (width < 0) return 0; /* Top-down DIBs have a negative height. */ height = abs(height); // For Icm support. // GdiGetHandleUserData(hdc, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) if (Data) { _SEH2_TRY { cjBmpScanSize = GdiGetBitmapBitsSize((BITMAPINFO *) Data); CalculateColorTableSize(&Data->bmiHeader, &ColorUse, &InfoSize); InfoSize += Data->bmiHeader.biSize; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { Status = _SEH2_GetExceptionCode(); } _SEH2_END } if (!NT_SUCCESS(Status)) { GdiSetLastError(ERROR_INVALID_PARAMETER); return NULL; } DPRINT("pBMI %p, Size bpp %u, dibsize %d, Conv %u, BSS %u\n", Data, bpp, dibsize, InfoSize, cjBmpScanSize); if (!width || !height) hBmp = GetStockObject(DEFAULT_BITMAP); else { hBmp = NtGdiCreateDIBitmapInternal(hDC, width, height, Init, (LPBYTE) Bits, (LPBITMAPINFO) Data, ColorUse, InfoSize, cjBmpScanSize, 0, 0); } return hBmp; }
/* * @unimplemented */ INT WINAPI Escape( _In_ HDC hdc, _In_ INT nEscape, _In_ INT cbInput, _In_ LPCSTR lpvInData, _Out_ LPVOID lpvOutData) { INT retValue = SP_ERROR; ULONG ulObjType; ulObjType = GDI_HANDLE_GET_TYPE(hdc); if (ulObjType == GDILoObjType_LO_METADC16_TYPE) { return METADC16_Escape(hdc, nEscape, cbInput, lpvInData, lpvOutData); } switch (nEscape) { case ABORTDOC: /* Note: Windows checks if the handle has any user data for the ABORTDOC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } else { retValue = AbortDoc(hdc); } break; case DRAFTMODE: case FLUSHOUTPUT: case SETCOLORTABLE: /* Note 1: DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE are outdated */ /* Note 2: Windows checks if the handle has any user data for the DRAFTMODE, FLUSHOUTPUT, SETCOLORTABLE commands * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); } retValue = FALSE; break; case SETABORTPROC: /* Note: Windows checks if the handle has any user data for the SETABORTPROC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } retValue = SetAbortProc(hdc, (ABORTPROC)lpvInData); break; case GETCOLORTABLE: retValue = GetSystemPaletteEntries(hdc, (UINT)*lpvInData, 1, (LPPALETTEENTRY)lpvOutData); if (!retValue) { retValue = SP_ERROR; } break; case ENDDOC: /* Note: Windows checks if the handle has any user data for the ENDDOC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } retValue = EndDoc(hdc); break; case GETSCALINGFACTOR: /* Note GETSCALINGFACTOR is outdated have been replace by GetDeviceCaps */ if (ulObjType == GDI_OBJECT_TYPE_DC) { if (lpvOutData) { PPOINT ptr = (PPOINT)lpvOutData; ptr->x = 0; ptr->y = 0; } } retValue = FALSE; break; case GETEXTENDEDTEXTMETRICS: retValue = GetETM(hdc, (EXTTEXTMETRIC *)lpvOutData) != 0; break; case STARTDOC: { DOCINFOA di; /* Note: Windows checks if the handle has any user data for the STARTDOC command * ReactOS copies this behavior to be compatible with windows 2003 */ if (GdiGetDcAttr(hdc) == NULL) { GdiSetLastError(ERROR_INVALID_HANDLE); retValue = FALSE; } di.cbSize = sizeof(DOCINFOA); di.lpszOutput = 0; di.lpszDatatype = 0; di.fwType = 0; di.lpszDocName = lpvInData; /* NOTE : doc for StartDocA/W at msdn http://msdn2.microsoft.com/en-us/library/ms535793(VS.85).aspx */ retValue = StartDocA(hdc, &di); /* Check if StartDocA failed */ if (retValue < 0) { { retValue = GetLastError(); /* Translate StartDocA error code to STARTDOC error code * see msdn http://msdn2.microsoft.com/en-us/library/ms535472.aspx */ switch(retValue) { case ERROR_NOT_ENOUGH_MEMORY: retValue = SP_OUTOFMEMORY; break; case ERROR_PRINT_CANCELLED: retValue = SP_USERABORT; break; case ERROR_DISK_FULL: retValue = SP_OUTOFDISK; break; default: retValue = SP_ERROR; break; } } } } break; default: UNIMPLEMENTED; SetLastError(ERROR_CALL_NOT_IMPLEMENTED); } return retValue; }