19#define WIN32_LEAN_AND_MEAN
50 DWORD hash_size =
sizeof(hash_buf);
52 static const char *
hex =
"0123456789abcdef";
61 if(hash_size !=
sizeof(hash_buf))
return NULL;
68 for(
i = 0;
i < hash_size;
i++)
71 buf[
i * 2 + 1] =
hex[hash_buf[
i] & 0xf];
80 memset(bmi, 0,
sizeof(*bmi));
100 {
WIDTH,
HEIGHT, 0,
"bc943d5ab024b8b0118d0a80aa283055d39942b8" },
109 {
WIDTH,
HEIGHT/2, 0,
"8b75bf6d54a8645380114fe77505ee0699ffffaa" },
116 DWORD src_dib_size, dst_dib_size;
129 ok(
dib !=
NULL,
"CreateDIBSection failed\n");
135 ok(src_bits !=
NULL,
"Can't allocate memory\n");
136 memset(src_bits, 0x88, src_dib_size);
139 ok(hdd !=
NULL,
"DrawDibOpen failed\n");
143 memset(dst_bits, 0xff, dst_dib_size);
146 0, 0, -1, -1, &src_info.
bmiHeader, src_bits,
149 ok(
r,
"[%u] DrawDibDraw failed, expected success\n",
i);
151 ok(!
r,
"[%u] DrawDibDraw succeeded, expected failed\n",
i);
157 win_skip(
"This platform doesn't support SHA-1 hash\n");
161 "[%u] got %s, expected %s\n",
167 ok(
r,
"DrawDibClose failed\n");
int strcmp(const char *String1, const char *String2)
BOOL WINAPI CryptCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash)
BOOL WINAPI CryptGetHashParam(HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags)
BOOL WINAPI CryptDestroyHash(HCRYPTHASH hHash)
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
BOOL WINAPI CryptHashData(HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
BOOL WINAPI CryptAcquireContextW(HCRYPTPROV *phProv, LPCWSTR pszContainer, LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags)
#define HeapFree(x, y, z)
BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, LPBITMAPINFOHEADER lpbi, LPVOID lpBits, INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags)
BOOL VFWAPI DrawDibClose(HDRAWDIB hdd)
HDRAWDIB VFWAPI DrawDibOpen(void)
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void init_bmi(BITMAPINFO *bmi, LONG width, LONG height, DWORD size)
static DWORD get_stride(const BITMAPINFO *bmi)
static void test_DrawDib_sizeimage(void)
static DWORD get_dib_size(const BITMAPINFO *bmi)
static HCRYPTPROV crypt_prov
static char * hash_dib(const BITMAPINFO *bmi, const void *bits)
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
#define CRYPT_VERIFYCONTEXT
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)