- Implement capCreateCaptureWindowA and capGetDriverDescriptionA (based on Wine code)

svn path=/trunk/; revision=42198
This commit is contained in:
Dmitry Chapyshev 2009-07-25 09:41:17 +00:00
parent 3b72642a0a
commit d86c7f9de6

View file

@ -6,29 +6,14 @@
*/ */
#include <windows.h> #include <windows.h>
#include <winternl.h>
#include <vfw.h> #include <vfw.h>
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(avicap32); #define CAP_DESC_MAX 32
/* WINE_DEFAULT_DEBUG_CHANNEL(avicap32);
* unimplemented
*/
HWND
VFWAPI
capCreateCaptureWindowA(LPCSTR lpszWindowName,
DWORD dwStyle,
INT x,
INT y,
INT nWidth,
INT nHeight,
HWND hWnd,
INT nID)
{
UNIMPLEMENTED;
return NULL;
}
/* /*
@ -49,20 +34,38 @@ capCreateCaptureWindowW(LPCWSTR lpszWindowName,
return NULL; return NULL;
} }
/* /*
* unimplemented * implemented
*/ */
BOOL HWND
VFWAPI VFWAPI
capGetDriverDescriptionA(WORD wDriverIndex, capCreateCaptureWindowA(LPCSTR lpszWindowName,
LPSTR lpszName, DWORD dwStyle,
INT cbName, INT x,
LPSTR lpszVer, INT y,
INT cbVer) INT nWidth,
INT nHeight,
HWND hWnd,
INT nID)
{ {
UNIMPLEMENTED; UNICODE_STRING Name;
return FALSE; 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 BOOL
WINAPI WINAPI
DllMain(IN HINSTANCE hinstDLL, DllMain(IN HINSTANCE hinstDLL,