The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => WINDOWS.INC Project => Topic started by: xandaz on November 07, 2009, 09:52:51 PM

Title: UNICODE wide structs include?
Post by: xandaz on November 07, 2009, 09:52:51 PM
   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
Title: Re: UNICODE wide structs include?
Post by: MichaelW on November 07, 2009, 11:22:38 PM
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.
Title: Re: UNICODE wide structs include?
Post by: xandaz on November 10, 2009, 11:31:40 PM
   Thanks Michael. I'm going to check it out.
   Bests.... xandaz
Title: Re: UNICODE wide structs include?
Post by: Larry Hammick on December 03, 2009, 04:33:36 PM
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
Title: Re: UNICODE wide structs include?
Post by: UtillMasm on December 03, 2009, 04:46:31 PM
 :U
My windows.incMAX_PATH_WIDECHAR equ 32767*2
Title: Re: UNICODE wide structs include?
Post by: xandaz on December 03, 2009, 09:05:40 PM
   Thanks guys.
   bests xandaz