The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: shankle on January 03, 2017, 08:46:03 AM

Title: WIN32_FIND_DATA
Post by: shankle on January 03, 2017, 08:46:03 AM
Thanks for any help.
I'm getting an error on DD telling me it's not defined.
Not sure if this struct is causing the problem.
Is this structure defined correctly?
The only field I need is cFileName.
I am assuming this will work on a 64-bit puter.
This is exactly the way it is defined in "winbase.h".

WIN32_FIND_DATA STRUCT
   dwFileAttributes DD
   ftCreationTime FILETIME
   ftLastAccessTime FILETIME
   ftLastWriteTime FILETIME
   nFileSizeHigh DD
   nFileSizeLow  DD
   dwReserved0   DD
   dwReserved1   DD
   cFileName TCHAR MAX_PATH DUP
   cAlternateFileName TCHAR 14 DUP
WIN32_FIND_DATA ENDS
Title: Re: WIN32_FIND_DATA
Post by: ragdog on January 03, 2017, 08:58:45 AM
Hello

https://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx

Quote
If you are writing a 32-bit application to list all the files in a directory and the application may be run on a 64-bit computer, you should call the Wow64DisableWow64FsRedirectionfunction before calling FindFirstFile and call Wow64RevertWow64FsRedirection after the last call to FindNextFile. For more information, see File System Redirector.
Title: Re: WIN32_FIND_DATA
Post by: jj2007 on January 03, 2017, 09:03:35 AM
dwFileAttributes DD

Check Windows.inc for correct syntax.
Title: Re: WIN32_FIND_DATA
Post by: shankle on January 03, 2017, 11:58:34 PM
Thanks for your responses.
This is what I found in Windows.inc
I'm still getting a "DD" not defined error in GoAsm

WIN32_FIND_DATAA STRUCT
   dwFileAttributes       DWORD ?
   ftCreationTime         FILETIME <>
   ftLastAccessTime       FILETIME <>
   ftLastWriteTime        FILETIME <>
   nFileSizeHigh          DWORD ?
   nFileSizeLow           DWORD ?
   dwReserved0            DWORD ?
   dwReserved1            DWORD ?
   cFileName              BYTE MAX_PATH dup (?)
   cAlternateFileName     BYTE 14 dup (?)
WIN32_FIND_DATAA ENDS

I no longer think it is the struct.
So it must be some dumb error elsewhere in the program.
Will keep looking.
Title: Re: WIN32_FIND_DATA
Post by: wjr on January 04, 2017, 01:18:41 AM
If a line number wasn't given for the error, check the listing file to see how far assembly progressed.
Title: Re: WIN32_FIND_DATA
Post by: shankle on January 04, 2017, 02:08:19 AM

                  01-03-2017

#define LINKFILES    ; these are from the program
#define codejps
#define WIN64
#INCLUDE windows.h

#ifndef LPSTR
  #if !x64
   #define LPSTR dd
  #else
   #define LPSTR dq
  #endif
#endif

GoAsm.exe version 0.61.0.0 - copyright Jeremy Gordon 2001-2016 - JG@JGnet.co.uk

error!
Line line 198 of assembler source file (blabla.asm)
line 198 in the program    LOCAL  cc:WIN32_FIND_DATA

Could not get size of structure/union in local data declaration
Local cc:WIN32_FIND_DATA
  In the struct at line 4922 of the include file Winuser.h
I got the structure from "windows.inc"
I have not referenced "Winuser.h" anywhere in the program

OJB file not found
G:/codejp >GoLink /unused blabla.obj
GoLink.exe Version 1.0.2.3

Error
The following symbol was not defined in the object file
DD
output file not made
Title: Re: WIN32_FIND_DATA
Post by: Yuri on January 04, 2017, 06:13:30 PM
Winuser.h is referenced from within Windows.h, which you include. So you don't need a separate definition of the structure, it's already defined in Winuser.h.
Title: Re: WIN32_FIND_DATA
Post by: shankle on January 04, 2017, 11:40:35 PM

                  01-04-2017

Thanks for your help.

There are two winuser.h files in GoAsm. One in windows.h
and one named winuser.h. Neither one contains a structure
called "WIN32_FIND_DATA". The only "WIN32_FIND_DATA" structure
is in windows.h named WIN32_FIND_DATAA and WIN32_FIND_DATAW.
Neither of these contain a field to give the size of the structure.
I can not compile the program because of the errors generated in a
previous post. The error at line 4922 in winuser.h is about a
messagebox that is totally irrevalent.
Title: Re: WIN32_FIND_DATA
Post by: Yuri on January 05, 2017, 01:50:17 AM
It looks like your set of .h files is different from mine. My Winuser.h doesn't have line 4922, it only has 4677 lines. The structure WIN32_FIND_DATA is in Winbase.h (as you correctly wrote in your first post), which is also referenced from within Windows.h. Here is its definition:

WIN32_FIND_DATA STRUCT
    dwFileAttributes DD
    ftCreationTime FILETIME
    ftLastAccessTime FILETIME
    ftLastWriteTime FILETIME
    nFileSizeHigh DD
    nFileSizeLow DD
    dwReserved0 DD
    dwReserved1 DD
    cFileName TCHAR MAX_PATH DUP
    cAlternateFileName TCHAR 14 DUP
ENDS

I can use it without errors.
Title: Re: WIN32_FIND_DATA
Post by: shankle on January 05, 2017, 04:01:37 AM
Thanks for responding.
I copied the structure from "winbase.h" in GoAsm and the program compiled correctly.
All though I found WinBase.h in Windows.h there was no WIN32_FIND_DATA structure
there.
Guess I don't understand why winbase.h and winuser.h are in two different places
and they are not identical to each other
Title: Re: WIN32_FIND_DATA
Post by: Yuri on January 05, 2017, 04:26:16 AM
In my headers there is only one Winbase.h. It's referenced in Windows.h with an #Include directive, not pasted in there.