include/msvcrt: Add attribute((format)) to printf and scanf -like APIs.

Fix a bunch of warnings generated by this patch and the migration of
GUID.Data1 to long in ae2693e2c4

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-01-31 14:13:15 +01:00 committed by Alexandre Julliard
parent c47f305295
commit bb1fc33570
20 changed files with 91 additions and 53 deletions

View File

@ -657,7 +657,7 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid)
*/
INT16 WINAPI StringFromGUID216(REFGUID id, char *str, INT16 cmax)
{
static const char format[] = "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}";
static const char format[] = "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}";
if (!id || cmax < CHARS_IN_GUID) return 0;
sprintf( str, format, id->Data1, id->Data2, id->Data3,
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],

View File

@ -40,7 +40,7 @@ static void CRYPT_guid2wstr( const GUID *guid, LPWSTR wstr )
{
char str[40];
sprintf(str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
sprintf(str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );

View File

@ -59,7 +59,7 @@ static const NPI_MODULEID *ip_module_id( USHORT family )
DWORD WINAPI ConvertGuidToStringA( const GUID *guid, char *str, DWORD len )
{
if (len < CHARS_IN_GUID) return ERROR_INSUFFICIENT_BUFFER;
sprintf( str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
sprintf( str, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2],
guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
return ERROR_SUCCESS;

View File

@ -1409,7 +1409,7 @@ static void testGetAdaptersInfo(void)
GetIfEntry( &row );
ConvertInterfaceIndexToLuid( ptr->Index, &luid );
ConvertInterfaceLuidToGuid( &luid, &guid );
sprintf( name, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
sprintf( name, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5],
guid.Data4[6], guid.Data4[7] );
@ -1671,7 +1671,7 @@ static void test_GetAdaptersAddresses(void)
status = ConvertInterfaceLuidToGuid(&aa->Luid, &guid);
ok(!status, "got %u\n", status);
sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
sprintf(buf, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5],
guid.Data4[6], guid.Data4[7]);

View File

@ -31,7 +31,7 @@ static const GUID GUID_wmp1 = {0x13a7995e,0x7d8f,0x45b4,{0x9c,0x77,0x81,0x92,0x6
static const char *guid_to_string(const GUID *guid)
{
static char buffer[50];
sprintf(buffer, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
sprintf(buffer, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);

View File

@ -627,7 +627,7 @@ static HRESULT register_server(BOOL do_register)
for(i=0; i < ARRAY_SIZE(pse); i++) {
pse[i].pszValue = heap_alloc(39);
sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
sprintf(pse[i].pszValue, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);

View File

@ -832,7 +832,7 @@ static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
BOOL is_wow64;
HKEY ikey;
sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
sprintf( interfacekey, "Interface\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib",
iid->Data1, iid->Data2, iid->Data3,
iid->Data4[0], iid->Data4[1], iid->Data4[2], iid->Data4[3],
iid->Data4[4], iid->Data4[5], iid->Data4[6], iid->Data4[7]

View File

@ -3660,7 +3660,7 @@ static BOOL TLB_GUIDFromString(const char *str, GUID *guid)
int i;
short s;
if(sscanf(str, "%x-%hx-%hx-%hx", &guid->Data1, &guid->Data2, &guid->Data3, &s) != 4) {
if(sscanf(str, "%lx-%hx-%hx-%hx", &guid->Data1, &guid->Data2, &guid->Data3, &s) != 4) {
FIXME("Can't parse guid %s\n", debugstr_guid(guid));
return FALSE;
}

View File

@ -543,7 +543,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, RPC_CSTR* StringUuid)
if (!Uuid) Uuid = &uuid_nil;
sprintf( (char*)*StringUuid, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
sprintf( (char*)*StringUuid, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Uuid->Data1, Uuid->Data2, Uuid->Data3,
Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
@ -566,7 +566,7 @@ RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR* StringUuid)
if (!Uuid) Uuid = &uuid_nil;
sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
sprintf(buf, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Uuid->Data1, Uuid->Data2, Uuid->Data3,
Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],

View File

@ -200,7 +200,7 @@ BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LP
static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
{
char xriid[50];
sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );

View File

@ -247,7 +247,7 @@ void _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
else if (( riid = _dbg_ILGetGUIDPointer(pidl) ))
{
if (szOut)
sprintf( szOut, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
sprintf( szOut, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3,
riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );

View File

@ -61,7 +61,7 @@ BOOL trash_file( const WCHAR *path ) DECLSPEC_HIDDEN;
static inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
{
return sprintf(str, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
return sprintf(str, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);

View File

@ -461,7 +461,7 @@ INT WINAPI SHStringFromGUIDA(REFGUID guid, LPSTR lpszDest, INT cchMax)
TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax);
sprintf(xguid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
sprintf(xguid, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);

View File

@ -82,7 +82,7 @@ QueryPathOfRegTypeLib16(
TRACE("\n");
if (HIWORD(guid)) {
sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%x\\win16",
sprintf( typelibkey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%x\\win16",
guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7],

View File

@ -1041,7 +1041,7 @@ static ULONG format_datetime( const WS_DATETIME *ptr, unsigned char *buf )
static ULONG format_guid( const GUID *ptr, unsigned char *buf )
{
static const char fmt[] = "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
static const char fmt[] = "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
return sprintf( (char *)buf, fmt, ptr->Data1, ptr->Data2, ptr->Data3,
ptr->Data4[0], ptr->Data4[1], ptr->Data4[2], ptr->Data4[3],
ptr->Data4[4], ptr->Data4[5], ptr->Data4[6], ptr->Data4[7] );
@ -1049,7 +1049,7 @@ static ULONG format_guid( const GUID *ptr, unsigned char *buf )
static ULONG format_urn( const GUID *ptr, unsigned char *buf )
{
static const char fmt[] = "urn:uuid:%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
static const char fmt[] = "urn:uuid:%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x";
return sprintf( (char *)buf, fmt, ptr->Data1, ptr->Data2, ptr->Data3,
ptr->Data4[0], ptr->Data4[1], ptr->Data4[2], ptr->Data4[3],
ptr->Data4[4], ptr->Data4[5], ptr->Data4[6], ptr->Data4[7] );

View File

@ -417,7 +417,7 @@ static BOOL deliver_next_report(struct device_extension *ext, IRP *irp)
for (i = 0; i < report->length;)
{
char buffer[256], *buf = buffer;
buf += sprintf(buf, "%08x ", i);
buf += sprintf(buf, "%08lx ", i);
do { buf += sprintf(buf, " %02x", report->buffer[i]); }
while (++i % 16 && i < report->length);
TRACE("%s\n", buffer);
@ -1054,7 +1054,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
buf += sprintf(buf, "%08x ", i);
buf += sprintf(buf, "%08lx ", i);
do { buf += sprintf(buf, " %02x", packet->reportBuffer[i]); }
while (++i % 16 && i < packet->reportBufferLen);
TRACE("%s\n", buffer);
@ -1084,7 +1084,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
buf += sprintf(buf, "%08x ", i);
buf += sprintf(buf, "%08lx ", i);
do { buf += sprintf(buf, " %02x", packet->reportBuffer[i]); }
while (++i % 16 && i < packet->reportBufferLen);
TRACE("%s\n", buffer);
@ -1103,7 +1103,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
buf += sprintf(buf, "%08x ", i);
buf += sprintf(buf, "%08lx ", i);
do { buf += sprintf(buf, " %02x", packet->reportBuffer[i]); }
while (++i % 16 && i < packet->reportBufferLen);
TRACE("%s\n", buffer);
@ -1120,7 +1120,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
for (i = 0; i < packet->reportBufferLen;)
{
char buffer[256], *buf = buffer;
buf += sprintf(buf, "%08x ", i);
buf += sprintf(buf, "%08lx ", i);
do { buf += sprintf(buf, " %02x", packet->reportBuffer[i]); }
while (++i % 16 && i < packet->reportBufferLen);
TRACE("%s\n", buffer);

View File

@ -334,4 +334,12 @@ typedef struct threadlocaleinfostruct {
#define _THREADLOCALEINFO
#endif
#if !defined(__WINE_USE_MSVCRT) || defined(__MINGW32__)
#define __WINE_CRT_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
#define __WINE_CRT_SCANF_ATTR(fmt,args) __attribute__((format (scanf,fmt,args)))
#else
#define __WINE_CRT_PRINTF_ATTR(fmt,args)
#define __WINE_CRT_SCANF_ATTR(fmt,args)
#endif
#endif /* __WINE_CORECRT_H */

View File

@ -88,7 +88,7 @@ extern int _crtDbgFlag;
_ACRTIMP int __cdecl _CrtCheckMemory(void);
_ACRTIMP int WINAPIV _CrtDbgReport(int reportType, const char *filename, int linenumber,
const char *moduleName, const char *format, ...);
const char *moduleName, const char *format, ...) __WINE_CRT_PRINTF_ATTR(5, 6);
_ACRTIMP int __cdecl _CrtDumpMemoryLeaks(void);
_ACRTIMP int __cdecl _CrtSetBreakAlloc(int);
_ACRTIMP int __cdecl _CrtSetDbgFlag(int);

View File

@ -161,6 +161,7 @@ _ACRTIMP int __cdecl __stdio_common_vsscanf(unsigned __int64,char const*,size_t,
#if defined(_UCRT) && !defined(_NO_CRT_STDIO_INLINE)
static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
@ -168,6 +169,7 @@ static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *forma
return ret < 0 ? -1 : ret;
}
static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
@ -175,12 +177,14 @@ static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *form
return ret < 0 ? -1 : ret;
}
static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(4, 0);
static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args)
{
int ret = __stdio_common_vsnprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
return ret < 0 ? -1 : ret;
}
static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...) __WINE_CRT_PRINTF_ATTR(4, 5);
static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...)
{
int ret;
@ -192,6 +196,7 @@ static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, c
return ret;
}
static inline int __cdecl _vscprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
static inline int __cdecl _vscprintf(const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
@ -199,6 +204,7 @@ static inline int __cdecl _vscprintf(const char *format, va_list args)
return ret < 0 ? -1 : ret;
}
static inline int WINAPIV _scprintf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
static inline int WINAPIV _scprintf(const char *format, ...)
{
int ret;
@ -211,6 +217,7 @@ static inline int WINAPIV _scprintf(const char *format, ...)
return ret;
}
static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
@ -218,12 +225,14 @@ static inline int __cdecl vsprintf(char *buffer, const char *format, va_list arg
return ret < 0 ? -1 : ret;
}
static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args)
{
int ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
return ret < 0 ? -1 : ret;
}
static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...)
{
int ret;
@ -235,17 +244,20 @@ static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *forma
return ret;
}
static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args)
{
int ret = __stdio_common_vsprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
return ret < 0 ? -1 : ret;
}
static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args)
{
return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
}
static inline int WINAPIV fprintf(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
static inline int WINAPIV fprintf(FILE *file, const char *format, ...)
{
int ret;
@ -257,11 +269,13 @@ static inline int WINAPIV fprintf(FILE *file, const char *format, ...)
return ret;
}
static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args)
{
return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
}
static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...)
{
int ret;
@ -273,11 +287,13 @@ static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...)
return ret;
}
static inline int vprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
static inline int vprintf(const char *format, va_list args)
{
return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
}
static inline int WINAPIV printf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
static inline int WINAPIV printf(const char *format, ...)
{
int ret;
@ -289,11 +305,13 @@ static inline int WINAPIV printf(const char *format, ...)
return ret;
}
static inline int vprintf_s(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
static inline int vprintf_s(const char *format, va_list args)
{
return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
}
static inline int WINAPIV printf_s(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
static inline int WINAPIV printf_s(const char *format, ...)
{
int ret;
@ -305,6 +323,7 @@ static inline int WINAPIV printf_s(const char *format, ...)
return ret;
}
static inline int WINAPIV sscanf(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV sscanf(const char *buffer, const char *format, ...)
{
int ret;
@ -316,6 +335,7 @@ static inline int WINAPIV sscanf(const char *buffer, const char *format, ...)
return ret;
}
static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...)
{
int ret;
@ -327,6 +347,7 @@ static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...)
return ret;
}
static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...) __WINE_CRT_SCANF_ATTR(3, 5);
static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...)
{
int ret;
@ -338,6 +359,7 @@ static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char
return ret;
}
static inline int WINAPIV fscanf(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
{
int ret;
@ -349,6 +371,7 @@ static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
return ret;
}
static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
{
int ret;
@ -360,6 +383,7 @@ static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
return ret;
}
static inline int WINAPIV scanf(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
static inline int WINAPIV scanf(const char *format, ...)
{
int ret;
@ -371,6 +395,7 @@ static inline int WINAPIV scanf(const char *format, ...)
return ret;
}
static inline int WINAPIV scanf_s(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
static inline int WINAPIV scanf_s(const char *format, ...)
{
int ret;
@ -384,33 +409,35 @@ static inline int WINAPIV scanf_s(const char *format, ...)
#else /* _UCRT && !_NO_CRT_STDIO_INLINE */
_ACRTIMP int WINAPIV _scprintf(const char *,...);
_ACRTIMP int WINAPIV _snprintf_s(char*,size_t,size_t,const char*,...);
_ACRTIMP int __cdecl _vscprintf(const char*,va_list);
_ACRTIMP int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,va_list);
_ACRTIMP int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,va_list);
_ACRTIMP int WINAPIV fprintf(FILE*,const char*,...);
_ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...);
_ACRTIMP int WINAPIV printf(const char*,...);
_ACRTIMP int WINAPIV printf_s(const char*,...);
_ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...);
_ACRTIMP int __cdecl vfprintf(FILE*,const char*,va_list);
_ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,va_list);
_ACRTIMP int __cdecl vprintf(const char*,va_list);
_ACRTIMP int __cdecl vprintf_s(const char*,va_list);
_ACRTIMP int __cdecl vsprintf(char*,const char*,va_list);
_ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,va_list);
_ACRTIMP int WINAPIV _scprintf(const char *,...) __WINE_CRT_PRINTF_ATTR(1, 2);
_ACRTIMP int WINAPIV _snprintf_s(char*,size_t,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(4, 5);
_ACRTIMP int __cdecl _vscprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
_ACRTIMP int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(4, 0);
_ACRTIMP int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
_ACRTIMP int WINAPIV fprintf(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
_ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
_ACRTIMP int WINAPIV printf(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
_ACRTIMP int WINAPIV printf_s(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
_ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
_ACRTIMP int __cdecl vfprintf(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
_ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
_ACRTIMP int __cdecl vprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
_ACRTIMP int __cdecl vprintf_s(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
_ACRTIMP int __cdecl vsprintf(char*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
_ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
_ACRTIMP int __cdecl _vsnprintf(char*,size_t,const char*,va_list);
static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) { return _vsnprintf(buffer,size,format,args); }
_ACRTIMP int __cdecl _vsnprintf(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args)
{ return _vsnprintf(buffer,size,format,args); }
_ACRTIMP int WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...);
_ACRTIMP int WINAPIV fscanf(FILE*,const char*,...);
_ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...);
_ACRTIMP int WINAPIV scanf(const char*,...);
_ACRTIMP int WINAPIV scanf_s(const char*,...);
_ACRTIMP int WINAPIV sscanf(const char*,const char*,...);
_ACRTIMP int WINAPIV sscanf_s(const char*,const char*,...);
_ACRTIMP int WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...) __WINE_CRT_SCANF_ATTR(3, 5);
_ACRTIMP int WINAPIV fscanf(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
_ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
_ACRTIMP int WINAPIV scanf(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
_ACRTIMP int WINAPIV scanf_s(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
_ACRTIMP int WINAPIV sscanf(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
_ACRTIMP int WINAPIV sscanf_s(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
#endif /* _UCRT && !_NO_CRT_STDIO_INLINE */
@ -435,6 +462,7 @@ static inline int unlink(const char* path) { return _unlink(path); }
#if !defined(_NO_CRT_STDIO_INLINE)
static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...)
{
int ret;
@ -446,6 +474,7 @@ static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format
return ret;
}
static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...)
{
int ret;
@ -457,6 +486,7 @@ static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *forma
return ret;
}
static inline int WINAPIV sprintf(char *buffer, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
{
int ret;
@ -470,9 +500,9 @@ static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
#else /* !_NO_CRT_STDIO_INLINE */
_ACRTIMP int WINAPIV snprintf(char*,size_t,const char*,...);
_ACRTIMP int WINAPIV _snprintf(char*,size_t,const char*,...);
_ACRTIMP int WINAPIV sprintf(char*,const char*,...);
_ACRTIMP int WINAPIV snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
_ACRTIMP int WINAPIV _snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
_ACRTIMP int WINAPIV sprintf(char*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
#endif /* !_NO_CRT_STDIO_INLINE */

View File

@ -865,7 +865,7 @@ static HMODULE load_com_dll(const char *name, char **path, char *filename)
if(!get_main_clsid(name, &clsid)) return NULL;
sprintf(keyname, "CLSID\\{%08x-%04x-%04x-%02x%2x-%02x%2x%02x%2x%02x%2x}\\InprocServer32",
sprintf(keyname, "CLSID\\{%08lx-%04x-%04x-%02x%2x-%02x%2x%02x%2x%02x%2x}\\InprocServer32",
clsid.Data1, clsid.Data2, clsid.Data3, clsid.Data4[0], clsid.Data4[1],
clsid.Data4[2], clsid.Data4[3], clsid.Data4[4], clsid.Data4[5],
clsid.Data4[6], clsid.Data4[7]);