unit test (C) with WINAPIV function

Medland, Bill Bill.Medland at accpac.com
Tue Apr 23 11:18:45 CDT 2002


Any chance of some help with this?

Yesterday i submitted a unit test for wsprintfA.  I didn't include wsprintfW
because I couldn't get it to work right.  I still can't.  I think it's
something to do with the calling convention (since wsprintf uses cdecl, not
stdcall).  Here's the test code itself;

static BOOL wsprintfWTest (void)
{
    WCHAR buf[25];
	static const WCHAR fmt[] = {'%','0','1','0','l','d','\0'};
	WCHAR target[] = {'-','0','0','0','0','0','0','0','0','1'};

    printf ("%p %p\n", buf, fmt);
    ok ((wsprintfW (buf, fmt -1) == 10), "wsPrintfW length failure");
	ok ((lstrcmpW (buf, target) == 0),
	    "wsprintfW zero padded negative value failure\n");

    return TRUE;
}

but if I print the addresses of buf and fmt from within wsprintfW I get the
same values for buf but for fmt I get a smaller pointer (0x401ecac instead
of 0x401ecae)

(and I can't figure out how to get at it in gdb to see exactly what is going
on).

Am I missing something obvious?

Bill



More information about the wine-devel mailing list