News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Windows x64 structures?

Started by Igor, April 09, 2008, 09:37:51 AM

Previous topic - Next topic

Igor

I'm experimenting with x64 in masm, but i have some trouble with windows structures.
I cant find new structure information and sizes for x64, i found some in fasm package but its not complete, for example i cant find TEXTMETRIC struct.

Do you guys know where i could find x64 api and structure info? :)

Igor

Does anyone know prototype for StringCbPrintfW?
http://msdn2.microsoft.com/en-us/library/ms647510(VS.85).aspx

I tried like this:
StringCbPrintfW PROTO C  :qword, :dword, :qword, :VARARG
StringCbPrintf equ <StringCbPrintfW>


But, i still get error: "error LNK2019: unresolved external symbol StringCbPrintfW referenced in..."

asmfan

isn't size_t 64bit under x64?
I think problem is in absent strsafe.lib Try not using invoke and just "call" it then you wont need the proto  :dance:.
Russia is a weird place

Igor

Quote from: asmfan on April 15, 2008, 11:57:26 AM
isn't size_t 64bit under x64?
I tried qword but no luck.

Quote from: asmfan on April 15, 2008, 11:57:26 AM
I think problem is in absent strsafe.lib Try not using invoke and just "call" it then you wont need the proto  :dance:.
I have strsafe.lib from amd64 dir that i found in SDK and i'm not using invoke since it's not available in masm64, but i still get that error...

If i write "extern StringCbPrintfW : proc" it should work right? But it doesn't work, does that mean that my strsafe.lib is somehow corrupted or what?

Igor

LOL, this is what i found in strsafe.h
STRSAFEAPI
StringCbPrintfW(
    __out_bcount(cbDest) STRSAFE_LPWSTR pszDest,
    __in size_t cbDest,
    __in __format_string STRSAFE_LPCWSTR pszFormat,
    ...)
{
    HRESULT hr;
    size_t cchDest = cbDest / sizeof(wchar_t);

    hr = StringValidateDestW(pszDest, cchDest, NULL, STRSAFE_MAX_CCH);
   
    if (SUCCEEDED(hr))
    {
        va_list argList;

        va_start(argList, pszFormat);

        hr = StringVPrintfWorkerW(pszDest,
                                  cchDest,
                                  NULL,
                                  pszFormat,
                                  argList);

        va_end(argList);
    }

    return hr;
}


I'm guessing that its not included in strsafe.lib  :lol