网站首页  词典首页

请输入您要查询的函数:

 

术语 wvsprintf
释义 wvsprintf
语法:
int wvsprintf( LPTSTR lpOutput,
LPCTSTR lpFmt,
va_list arglist
);
wvsprintf功能
该wvsprintf函数的格式和存储的字符和价值观念在缓冲系列。该项目所指向的参数列表转换和复制到输出缓冲区根据在格式控制串相应的格式规范。函数附加一个终止空字符的字符写入,但是返回值不包括在其终止空字符的字符数。
参数
lpOutput
[out]指向接收缓冲区格式化输出。缓冲区的最大大小为1024字节。
lpFmt
[in]指向一个空结束的字符串,其中包含格式控制规范。除了普通的ASCII字符,每个参数格式规范出现在此字符串。如需有关格式规范信息,请参见wsprintf。
arglist
[in]可变参数列表,列表的每个元素指定一个格式控制字符串参数。的数量,类型,以及参数的解释取决于相应的格式在lpFmt参数控制规格。
返回值
如果函数成功,返回值是存储在缓冲区中TCHARs人数,不包括终止空字符。这是指对函数或Unicode版本WCHARs ANSI版本字节。
如果函数失败,返回值小于预期产出的长度。为了获得更多错误信息,调用GetLastError。
备注
安全警告:使用这个函数不当,可能会损害您的应用程序的安全。在lpOutput返回的字符串是不能保证NULL结尾。另外,避免使用%s格式,它可以导致缓冲区溢出。这可能导致拒绝服务,如果在一个访问冲突,或攻击的结果可能注入可执行代码。考虑使用下列其中一个选择:StringCbPrintf,StringCbPrintfEx,StringCbVPrintf,StringCbVPrintfEx,StringCchPrintf,StringCchPrintfEx,StringCchVPrintf,或StringCchVPrintfEx。您应该检讨的安全注意事项:在继续之前的Windows用户界面。
函数拷贝格式控制字符串的字符到输出缓冲区的字符,与字符串中的第一个字符开始。当它遇到了一个在字符串格式规范,功能检索下一个可用的参数值(与列表中的第一个参数开始),转换成指定格式的价值,并复制结果到输出缓冲区。该函数继续复制字符和扩大这种方式格式规范,直到达到最终的格式控制字符串。如果有比格式规范的论点,额外的参数将被忽略。如果没有对所有的格式规范足够的论据,结果是不确定的。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
Strings 概述 ,StringCbPrintf,StringCbPrintfEx,StringCbVPrintf,StringCbVPrintfEx,StringCchPrintf,StringCchPrintfEx,StringCchVPrintf,StringCchVPrintfEx,wsprintf
==英文原文==wvsprintf Function
The wvsprintf function formats and stores a series of characters and values in a buffer. The items pointed to by the argument list are converted and copied to an output buffer according to the corresponding format specification in the format-control string. The function appends a terminating null character to the characters it writes, but the return value does not include the terminating null character in its character count.
Syntax
int wvsprintf( LPTSTR lpOutput,
LPCTSTR lpFmt,
va_list arglist
);
Parameters
lpOutput
[out] Pointer to a buffer to receive the formatted output. The maximum size of the buffer is 1024 bytes.
lpFmt
[in] Pointer to a null-terminated string that contains the format-control specifications. In addition to ordinary ASCII characters, a format specification for each argument appears in this string. For more information about the format specification, see wsprintf .
arglist
[in] A variable argument list; each element of the list specifies an argument for the format-control string. The number, type, and interpretation of the arguments depend on the corresponding format-control specifications in the lpFmt parameter.
Return Value
If the function succeeds, the return value is the number of TCHARs stored in the buffer, not counting the terminating null character. This refers to bytes for ANSI versions of the function or WCHARs for Unicode versions.
If the function fails, the return value is less than the length of the expected output. To get extended error information, call GetLastError .
Remarks
Security Alert Using this function incorrectly can compromise the security of your application. The string returned in lpOutput is not guaranteed to be NULL-terminated. Also, avoid the use of the %s format, which can lead to a buffer overrun. This can lead to a denial of service if it results in an access violation, or an attacker may inject executable code. Consider using one of the following alternatives: StringCbPrintf , StringCbPrintfEx , StringCbVPrintf , StringCbVPrintfEx , StringCchPrintf , StringCchPrintfEx , StringCchVPrintf , or StringCchVPrintfEx . You should review Security Considerations: Windows User Interface before continuing.
The function copies the format-control string into the output buffer character by character, starting with the first character in the string. When it encounters a format specification in the string, the function retrieves the value of the next available argument (starting with the first argument in the list), converts that value into the specified format, and copies the result to the output buffer. The function continues to copy characters and expand format specifications in this way until it reaches the end of the format-control string. If there are more arguments than format specifications, the extra arguments are ignored. If there are not enough arguments for all of the format specifications, the results are undefined.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Strings Overview , StringCbPrintf , StringCbPrintfEx , StringCbVPrintf , StringCbVPrintfEx , StringCchPrintf , StringCchPrintfEx , StringCchVPrintf , StringCchVPrintfEx , wsprintf
==原始网址==http://msdn.microsoft.com/en-us/library/ms647551(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:31:10