Author: hpoussin
Date: Wed Apr 5 15:13:47 2006
New Revision: 21464
URL:
http://svn.reactos.ru/svn/reactos?rev=21464&view=rev
Log:
Implement SetupCopyOEMInfA (not tested)
Modified:
trunk/reactos/dll/win32/setupapi/install.c
trunk/reactos/dll/win32/setupapi/stubs.c
Modified: trunk/reactos/dll/win32/setupapi/install.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/install.…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/install.c (original)
+++ trunk/reactos/dll/win32/setupapi/install.c Wed Apr 5 15:13:47 2006
@@ -2,7 +2,7 @@
* Setupapi install routines
*
* Copyright 2002 Alexandre Julliard for CodeWeavers
- * 2005 Hervé Poussineau (hpoussin(a)reactos.org)
+ * 2005-2006 Hervé Poussineau (hpoussin(a)reactos.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -1485,3 +1485,86 @@
TRACE("Returning %d\n", ret);
return ret;
}
+
+
+/***********************************************************************
+ * SetupCopyOEMInfA (SETUPAPI.@)
+ */
+BOOL WINAPI SetupCopyOEMInfA(
+ IN PCSTR SourceInfFileName,
+ IN PCSTR OEMSourceMediaLocation,
+ IN DWORD OEMSourceMediaType,
+ IN DWORD CopyStyle,
+ OUT PSTR DestinationInfFileName OPTIONAL,
+ IN DWORD DestinationInfFileNameSize,
+ OUT PDWORD RequiredSize OPTIONAL,
+ OUT PSTR* DestinationInfFileNameComponent OPTIONAL)
+{
+ PWSTR SourceInfFileNameW = NULL;
+ PWSTR OEMSourceMediaLocationW = NULL;
+ PWSTR DestinationInfFileNameW = NULL;
+ PWSTR DestinationInfFileNameComponentW = NULL;
+ BOOL ret = FALSE;
+
+ TRACE("%s %s 0x%lx 0x%lx %p 0%lu %p %p\n",
+ SourceInfFileName, OEMSourceMediaLocation, OEMSourceMediaType,
+ CopyStyle, DestinationInfFileName, DestinationInfFileNameSize,
+ RequiredSize, DestinationInfFileNameComponent);
+
+ if (!DestinationInfFileName && DestinationInfFileNameSize > 0)
+ SetLastError(ERROR_INVALID_PARAMETER);
+ else if (!(SourceInfFileNameW = MultiByteToUnicode(SourceInfFileName, CP_ACP)))
+ SetLastError(ERROR_INVALID_PARAMETER);
+ else if (!(OEMSourceMediaLocationW = MultiByteToUnicode(OEMSourceMediaLocation,
CP_ACP)))
+ SetLastError(ERROR_INVALID_PARAMETER);
+ else
+ {
+ if (DestinationInfFileNameSize != 0)
+ {
+ DestinationInfFileNameW = MyMalloc(DestinationInfFileNameSize *
sizeof(WCHAR));
+ if (!DestinationInfFileNameW)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ goto cleanup;
+ }
+ }
+
+ ret = SetupCopyOEMInfW(
+ SourceInfFileNameW,
+ OEMSourceMediaLocationW,
+ OEMSourceMediaType,
+ CopyStyle,
+ DestinationInfFileNameW,
+ DestinationInfFileNameSize,
+ RequiredSize,
+ DestinationInfFileNameComponent ? &DestinationInfFileNameComponentW :
NULL);
+ if (!ret)
+ goto cleanup;
+
+ if (DestinationInfFileNameSize != 0)
+ {
+ if (WideCharToMultiByte(CP_ACP, 0, DestinationInfFileNameW, -1,
+ DestinationInfFileName, DestinationInfFileNameSize, NULL, NULL) == 0)
+ {
+ DestinationInfFileName[0] = '\0';
+ goto cleanup;
+ }
+ }
+ if (DestinationInfFileNameComponent)
+ {
+ if (DestinationInfFileNameComponentW)
+ *DestinationInfFileNameComponent =
&DestinationInfFileName[DestinationInfFileNameComponentW - DestinationInfFileNameW];
+ else
+ *DestinationInfFileNameComponent = NULL;
+ }
+ ret = TRUE;
+ }
+
+cleanup:
+ MyFree(SourceInfFileNameW);
+ MyFree(OEMSourceMediaLocationW);
+ MyFree(DestinationInfFileNameW);
+
+ TRACE("Returning %d\n", ret);
+ return ret;
+}
Modified: trunk/reactos/dll/win32/setupapi/stubs.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/stubs.c?…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/stubs.c (original)
+++ trunk/reactos/dll/win32/setupapi/stubs.c Wed Apr 5 15:13:47 2006
@@ -47,19 +47,6 @@
BOOL WINAPI SetupDiGetDeviceInfoListDetailA(HDEVINFO devinfo,
PSP_DEVINFO_LIST_DETAIL_DATA_A devinfo_data )
{
FIXME("\n");
- return FALSE;
-}
-
-/***********************************************************************
- * SetupCopyOEMInfA (SETUPAPI.@)
- */
-BOOL WINAPI SetupCopyOEMInfA(PCSTR sourceinffile, PCSTR sourcemedialoc,
- DWORD mediatype, DWORD copystyle, PSTR destinfname,
- DWORD destnamesize, PDWORD required,
- PSTR *destinfnamecomponent)
-{
- FIXME("stub: source %s location %s ...\n", debugstr_a(sourceinffile),
- debugstr_a(sourcemedialoc));
return FALSE;
}