Author: dchapyshev
Date: Sat Jul 25 11:41:17 2009
New Revision: 42198
URL:
http://svn.reactos.org/svn/reactos?rev=42198&view=rev
Log:
- Implement capCreateCaptureWindowA and capGetDriverDescriptionA (based on Wine code)
Modified:
trunk/reactos/dll/win32/avicap32/avicap32.c
Modified: trunk/reactos/dll/win32/avicap32/avicap32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/avicap32/avicap3…
==============================================================================
--- trunk/reactos/dll/win32/avicap32/avicap32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/avicap32/avicap32.c [iso-8859-1] Sat Jul 25 11:41:17 2009
@@ -6,29 +6,14 @@
*/
#include <windows.h>
+#include <winternl.h>
#include <vfw.h>
#include "wine/debug.h"
+#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 @@
return NULL;
}
+/*
+ * implemented
+ */
+HWND
+VFWAPI
+capCreateCaptureWindowA(LPCSTR lpszWindowName,
+ DWORD dwStyle,
+ INT x,
+ INT y,
+ INT nWidth,
+ INT nHeight,
+ HWND hWnd,
+ INT nID)
+{
+ UNICODE_STRING Name;
+ HWND Wnd;
-/*
- * unimplemented
- */
-BOOL
-VFWAPI
-capGetDriverDescriptionA(WORD wDriverIndex,
- LPSTR lpszName,
- INT cbName,
- LPSTR lpszVer,
- INT cbVer)
-{
- UNIMPLEMENTED;
- return FALSE;
+ 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 @@
}
+/*
+ * 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,