News:

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

UNICODE wide structs include?

Started by xandaz, November 07, 2009, 09:52:51 PM

Previous topic - Next topic

xandaz

   Hi there. Is there any wide version windows.inc file or an updated windows.inc with wide version of structures? i heard you need to use those (fe: W32_FIND_DATAW) when using unicode. Also can't find SendMessageW and alikes in the libraries includes.
   Help me out if you have time.
   Best regards and thanks guys :thumbu

MichaelW

Searching the PDSK include directory I cannot find any reference to W32_FIND_DATAW, but I do find WIN32_FIND_DATAW in winbase.h:

typedef struct _WIN32_FIND_DATAW {
    DWORD dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD nFileSizeHigh;
    DWORD nFileSizeLow;
    DWORD dwReserved0;
    DWORD dwReserved1;
    WCHAR  cFileName[ MAX_PATH ];
    WCHAR  cAlternateFileName[ 14 ];
#ifdef _MAC
    DWORD dwFileType;
    DWORD dwCreatorType;
    WORD  wFinderFlags;
#endif
} WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;


I cannot find WIN32_FIND_DATAW, or any Unicode structure, anywhere in the MASM32 include files.

SendMessageW is prototyped in user32.inc, as are many Unicode functions.
eschew obfuscation

xandaz

   Thanks Michael. I'm going to check it out.
   Bests.... xandaz

Larry Hammick

typedef struct _WIN32_FIND_DATA {
  DWORD    dwFileAttributes;
  FILETIME ftCreationTime;
  FILETIME ftLastAccessTime;
  FILETIME ftLastWriteTime;
  DWORD    nFileSizeHigh;
  DWORD    nFileSizeLow;
  DWORD    dwReserved0;
  DWORD    dwReserved1;
  TCHAR    cFileName[MAX_PATH];
  TCHAR    cAlternateFileName[14];
}WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;


Since "tchar" means a byte in ANSI but a word in Unicode, we get

WIN32_FIND_DATAW STRUCT
  dwFileAttributes      DWORD      ?
  ftCreationTime        FILETIME <>
  ftLastAccessTime      FILETIME <>
  ftLastWriteTime       FILETIME <>
  nFileSizeHigh         DWORD      ?
  nFileSizeLow          DWORD      ?
  dwReserved0           DWORD      ?
  dwReserved1           DWORD      ?
  cFileName             WORD MAX_PATH dup(?)
  cAlternate            WORD 14 dup(?)
WIN32_FIND_DATAW ENDS

UtillMasm


xandaz

   Thanks guys.
   bests xandaz