lovelyp
驱动牛犊
驱动牛犊
  • 注册日期2001-05-16
  • 最后登录2004-05-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:4060回复:5

关于SetupCopyOEMInf函数

楼主#
更多 发布于:2001-09-29 11:17
谁知道该函数的说明?MSDN和DDK的帮助中找不到
DK-boy
驱动中牛
驱动中牛
  • 注册日期2001-07-22
  • 最后登录2005-09-21
  • 粉丝0
  • 关注0
  • 积分1分
  • 威望1点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2001-09-29 13:31
[QUOTE]原本由 lovelyp 发表
[B]谁知道该函数的说明?MSDN和DDK的帮助中找不到 [/B][/QUOTE]
这是一个自定义函数。
因为在所有的文档中都找不到!
喜欢清静?享受人生
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2001-09-30 09:26
[QUOTE]原本由 DK-boy 发表
[B][QUOTE]原本由 lovelyp 发表
[B]谁知道该函数的说明?MSDN和DDK的帮助中找不到 [/B][/QUOTE]
这是一个自定义函数。
因为在所有的文档中都找不到! [/B][/QUOTE]
谁说的!July, 2000的MSDN中就有。

  
Platform SDK: Installing Applications/Setup
SetupCopyOEMInf
The SetupCopyOEMInf function copies a specified INF file to the %windir%/Inf directory.

BOOL WINAPI SetupCopyOEMInf(
  PCTSTR SourceInfFileName,
  PCTSTR OEMSourceMediaLocation,
  DWORD OEMSourceMediaType,
  DWORD CopyStyle,
  PTSTR DestinationInfFileName,
  DWORD DestinationInfFileNameSize,
  PDWORD RequiredSize,
  PTSTR *DestinationInfFileNameComponent
);
Parameters
SourceInfFileName
Specifies the full path to the source INF file.
OEMSourceMediaLocation
Specifies source location information to be stored in the precompiled INF (.PNF). This location information is specific to the source media type specified.
OEMSourceMediaType
Specifies the source media type referenced by the location information. May be one of the following values: Value Meaning
SPOST_NONE No source media information is stored in the PNF file. The value of OEMSourceMediaLocation is ignored in this case.
SPOST_PATH OEMSourceMediaLocation contains a path to the source media. For example, if the media is on a floppy, this path might be "A:\". If OEMSourceMediaLocation is NULL, the path is assumed to be the path where the INF is located. If the INF has a corresponding PNF in that location, the PNF file's source media information will be transferred to the destination PNF file.
SPOST_URL OEMSourceMediaLocation contains a universal resource locator (URL) specifying the internet location from where the INF/driver files were retrieved. If OEMSourceMediaLocation is NULL, it is assumed that the default Code Download Manager location was used.


CopyStyle
Specifies how the INF file is copied into the INF directory. The following flags can be combined: Value Meaning
SP_COPY_DELETESOURCE Delete source file on successful copy.
SP_COPY_REPLACEONLY Copy only if this file already exists in the INF directory. This flag could be used to update the source location information for an existing INF.
SP_COPY_NOOVERWRITE Copy only if the specfied files don't currently exist in the INF directory. If the INF does currently exist, this API will fail and GetLastError returns ERROR_FILE_EXISTS. In this case, the existing INF file's filename will be placed into the appropriate field in the destination INF file's information output buffers.
SP_COPY_OEMINF_CATALOG_ONLY The specified INF file's corresponding catalog files is copied to %windir%\Inf. If this flag is specified, the destination filename information is entered upon successful return if the specified INF file already exists in the Inf directory.


DestinationInfFileName
This parameter is optional. This parameter specifies a character buffer to receive the INF's filename assigned to it at the time it was copied to the INF directory. If the SP_COPY_NOOVERWRITE flag is specified and the SetupCopyOEMInf function fails with a return code of ERROR_FILE_EXISTS, this buffer will contain the name of the existing INF file. If the SP_COPY_OEMINF_CATALOG_ONLY flag is specified, this buffer will contain the destination INF filename if the INF file is already present in the INF directory. Otherwise, this buffer will be set to the empty string.
DestinationInfFileNameSize
Specifies the size, in characters, of the DestinationInfFileName buffer, or zero if the buffer is not specified. If DestinationInfFileName is specified and this buffer size is less than the size required to return the destination INF filename (including full path), this API will fail. In this case GetLastError will return ERROR_INSUFFICIENT_BUFFER.
RequiredSize
This parameter is optional. This parameter specifies the address of a variable that receives the size (in characters) required to store the destination INF file name including terminating NULL. If the SP_COPY_OEMINF_CATALOG_ONLY flag is specified, this variable will receive a string length only if the INF file already exists in the INF directory. Otherwise, this variable will be set to zero.
DestinationInfFileNameComponent
This parameter is optional. This parameter specifies the address of a character pointer that is set upon successful return (or ERROR_FILE_EXISTS) to point to the beginning of the filename component of the path stored in the DestinationInfFileName parameter. If the SP_COPY_OEMINF_CATALOG_ONLY flag is specified, the DestinationInfFileName parameter may be an empty string. In this case, the character pointer will be set to NULL upon successful return.
Return Values
TRUE
The SetupCopyOEMInf function succeeded.
FALSE
The SetupCopyOEMInf function failed. For extended error information, call GetLastError.
Remarks
The SetupCopyOEMInf function copies a specified INF file into the %windir%\Inf directory. A unique name is provided if the specified INF file exists in the Inf directory.. The following procedure is followed to determine if the INF exists in the INF directory:

All INF files of the form "OEM*.INF" are enumerated and any files that have the same file size as that of the specified INF file are binary compared.

The Inf directory is searched for the source filename of the INF file. If an INF file of the same name exists and is the same size as that of the specified INF file, the two files are binary compared to determine if they are identical.

If the specified INF file already exists a further check is performed to determine if the specified INF file contains a CatalogFile= entry in its [Version] section. If it does, the INF files's %windir%\Inf primary filename with a ".CAT" extension is used to determine if the catalog is already installed. If there is a catalog installed, but it isn't the same as the catalog associated with the source INF, this is not considered to be a match and and enumerations continue. It is possible to have multiple identical INF files with unique catalogs contained in %windir%\Inf directory. If an existing match is not found, the INF and CAT files are installed under a new and unique name.

OEM INFs that don't specify a CatalogFile= entry are considered invalid with respect to digital signature verification.

In cases where the INF file must be copied to the %windir%\Inf directory, any digital signature verification failures are reported

If the INF and CAT files already exist, these existing filenames are used and the file replacement behavior is based on the specified CopyStyle flags. Replacement behavior refers only to the source media information stored in the PNF. Existing INF, PNF, and CAT files are not modified.

Built on Thursday, May 11, 2000
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
DK-boy
驱动中牛
驱动中牛
  • 注册日期2001-07-22
  • 最后登录2005-09-21
  • 粉丝0
  • 关注0
  • 积分1分
  • 威望1点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2001-09-30 09:29
为什么新版的MSDN就没有了?
喜欢清静?享受人生
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2001-09-30 10:35
[QUOTE]原本由 DK-boy 发表
[B]为什么新版的MSDN就没有了? [/B][/QUOTE]
大概是M$偷懒了吧?
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
acx
acx
驱动小牛
驱动小牛
  • 注册日期2001-04-28
  • 最后登录2012-05-07
  • 粉丝0
  • 关注0
  • 积分61分
  • 威望57点
  • 贡献值0点
  • 好评度4点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2002-11-15 16:26
拷贝过去后怎样可以让系统认这个INF而不是系统自带的INF。也就是说我用SETUPCOPYOENMINF把我的INF文件拷到INF目录下后,插上硬件他还是用以来系统自带的驱动如USB HID不管事先有没有插上过(WINXP下,2000好象没问题)
很想你,身不由己……
游客

返回顶部