From d86c7f9de690f2ca7abcf5c75b6d07b1a428a213 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Sat, 25 Jul 2009 09:41:17 +0000 Subject: [PATCH] - Implement capCreateCaptureWindowA and capGetDriverDescriptionA (based on Wine code) svn path=/trunk/; revision=42198 --- reactos/dll/win32/avicap32/avicap32.c | 84 ++++++++++++++++++--------- 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/reactos/dll/win32/avicap32/avicap32.c b/reactos/dll/win32/avicap32/avicap32.c index 7b212e87151..816a46d2e27 100644 --- a/reactos/dll/win32/avicap32/avicap32.c +++ b/reactos/dll/win32/avicap32/avicap32.c @@ -6,29 +6,14 @@ */ #include +#include #include #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(avicap32); +#define CAP_DESC_MAX 32 -/* - * unimplemented - */ -HWND -VFWAPI -capCreateCaptureWindowA(LPCSTR lpszWindowName, - DWORD dwStyle, - INT x, - INT y, - INT nWidth, - INT nHeight, - HWND hWnd, - INT nID) -{ - UNIMPLEMENTED; - return NULL; -} +WINE_DEFAULT_DEBUG_CHANNEL(avicap32); /* @@ -49,20 +34,38 @@ capCreateCaptureWindowW(LPCWSTR lpszWindowName, return NULL; } - /* - * unimplemented + * implemented */ -BOOL +HWND VFWAPI -capGetDriverDescriptionA(WORD wDriverIndex, - LPSTR lpszName, - INT cbName, - LPSTR lpszVer, - INT cbVer) +capCreateCaptureWindowA(LPCSTR lpszWindowName, + DWORD dwStyle, + INT x, + INT y, + INT nWidth, + INT nHeight, + HWND hWnd, + INT nID) { - UNIMPLEMENTED; - return FALSE; + UNICODE_STRING Name; + HWND Wnd; + + if (lpszWindowName) + RtlCreateUnicodeStringFromAsciiz(&Name, lpszWindowName); + else + Name.Buffer = NULL; + + Wnd = capCreateCaptureWindowW(Name.Buffer, + dwStyle, + x, y, + nWidth, + nHeight, + hWnd, + nID); + + RtlFreeUnicodeString(&Name); + return Wnd; } @@ -82,6 +85,31 @@ capGetDriverDescriptionW(WORD wDriverIndex, } +/* + * implemented + */ +BOOL +VFWAPI +capGetDriverDescriptionA(WORD wDriverIndex, + LPSTR lpszName, + INT cbName, + LPSTR lpszVer, + INT cbVer) +{ + WCHAR DevName[CAP_DESC_MAX], DevVer[CAP_DESC_MAX]; + BOOL Result; + + Result = capGetDriverDescriptionW(wDriverIndex, DevName, CAP_DESC_MAX, DevVer, CAP_DESC_MAX); + if (Result) + { + WideCharToMultiByte(CP_ACP, 0, DevName, -1, lpszName, cbName, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, DevVer, -1, lpszVer, cbVer, NULL, NULL); + } + + return Result; +} + + BOOL WINAPI DllMain(IN HINSTANCE hinstDLL,