2002-06-13 21:38:52 +00:00
|
|
|
/*
|
2003-09-08 19:38:45 +00:00
|
|
|
* Copyright 2002 Dmitry Timoshkov for CodeWeavers
|
2005-04-27 09:46:25 +00:00
|
|
|
* Copyright 2005 Maarten Lankhorst
|
2002-06-13 21:38:52 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-06-13 21:38:52 +00:00
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
2003-09-09 19:39:31 +00:00
|
|
|
#include "winuser.h"
|
2002-06-13 21:38:52 +00:00
|
|
|
#include "vfw.h"
|
2002-10-07 21:43:13 +00:00
|
|
|
#include "winternl.h"
|
2002-06-13 21:38:52 +00:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2021-09-01 20:56:46 +00:00
|
|
|
#include "unixlib.h"
|
2005-04-27 09:46:25 +00:00
|
|
|
|
2002-06-13 21:38:52 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(avicap);
|
|
|
|
|
2021-09-01 20:56:46 +00:00
|
|
|
static unixlib_handle_t unix_handle;
|
2002-10-07 21:43:13 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* capCreateCaptureWindowW (AVICAP32.@)
|
|
|
|
*/
|
|
|
|
HWND VFWAPI capCreateCaptureWindowW(LPCWSTR lpszWindowName, DWORD dwStyle, INT x,
|
|
|
|
INT y, INT nWidth, INT nHeight, HWND hWnd,
|
|
|
|
INT nID)
|
|
|
|
{
|
2012-02-23 14:14:06 +00:00
|
|
|
FIXME("(%s, %08x, %08x, %08x, %08x, %08x, %p, %08x): stub\n",
|
|
|
|
debugstr_w(lpszWindowName), dwStyle, x, y, nWidth, nHeight, hWnd, nID);
|
2002-10-07 21:43:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* capCreateCaptureWindowA (AVICAP32.@)
|
|
|
|
*/
|
|
|
|
HWND VFWAPI capCreateCaptureWindowA(LPCSTR lpszWindowName, DWORD dwStyle, INT x,
|
|
|
|
INT y, INT nWidth, INT nHeight, HWND hWnd,
|
|
|
|
INT nID)
|
|
|
|
{ UNICODE_STRING nameW;
|
|
|
|
HWND retW;
|
|
|
|
|
|
|
|
if (lpszWindowName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszWindowName);
|
|
|
|
else nameW.Buffer = NULL;
|
|
|
|
|
|
|
|
retW = capCreateCaptureWindowW(nameW.Buffer, dwStyle, x, y, nWidth, nHeight,
|
|
|
|
hWnd, nID);
|
|
|
|
RtlFreeUnicodeString(&nameW);
|
|
|
|
|
|
|
|
return retW;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* capGetDriverDescriptionA (AVICAP32.@)
|
|
|
|
*/
|
2002-06-13 21:38:52 +00:00
|
|
|
BOOL VFWAPI capGetDriverDescriptionA(WORD wDriverIndex, LPSTR lpszName,
|
2005-04-27 09:46:25 +00:00
|
|
|
INT cbName, LPSTR lpszVer, INT cbVer)
|
2002-06-13 21:38:52 +00:00
|
|
|
{
|
2008-02-25 08:59:38 +00:00
|
|
|
BOOL retval;
|
2005-04-27 09:46:25 +00:00
|
|
|
WCHAR devname[CAP_DESC_MAX], devver[CAP_DESC_MAX];
|
|
|
|
TRACE("--> capGetDriverDescriptionW\n");
|
|
|
|
retval = capGetDriverDescriptionW(wDriverIndex, devname, CAP_DESC_MAX, devver, CAP_DESC_MAX);
|
|
|
|
if (retval) {
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, devname, -1, lpszName, cbName, NULL, NULL);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, devver, -1, lpszVer, cbVer, NULL, NULL);
|
|
|
|
}
|
|
|
|
return retval;
|
2002-06-13 21:38:52 +00:00
|
|
|
}
|
|
|
|
|
2002-10-07 21:43:13 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* capGetDriverDescriptionW (AVICAP32.@)
|
|
|
|
*/
|
2021-09-01 20:56:46 +00:00
|
|
|
BOOL VFWAPI capGetDriverDescriptionW(WORD index, WCHAR *name, int name_len, WCHAR *version, int version_len)
|
2002-06-13 21:38:52 +00:00
|
|
|
{
|
2021-09-01 20:56:46 +00:00
|
|
|
struct get_device_desc_params params;
|
2005-04-27 09:46:25 +00:00
|
|
|
|
2021-09-01 20:56:46 +00:00
|
|
|
params.index = index;
|
|
|
|
if (__wine_unix_call(unix_handle, unix_get_device_desc, ¶ms))
|
|
|
|
return FALSE;
|
2005-04-27 09:46:25 +00:00
|
|
|
|
2021-09-01 20:56:46 +00:00
|
|
|
TRACE("Found device name %s, version %s.\n", debugstr_w(params.name), debugstr_w(params.version));
|
|
|
|
lstrcpynW(name, params.name, name_len);
|
|
|
|
lstrcpynW(version, params.version, version_len);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
|
|
|
{
|
|
|
|
switch (reason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
NtQueryVirtualMemory(GetCurrentProcess(), instance,
|
|
|
|
MemoryWineUnixFuncs, &unix_handle, sizeof(unix_handle), NULL);
|
|
|
|
DisableThreadLibraryCalls(instance);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2002-06-13 21:38:52 +00:00
|
|
|
}
|