Discussion:
help please with GetFileAttributesEx
(too old to reply)
john klosak
2005-07-29 16:45:13 UTC
Permalink
writing in MASM32 for windowsXP

I need to obtain a FileTime for an existing file

code:
invoke GetFileAttributesEx,ADDR <filename>,GetFileExInfoStandard,ADDR WFD

GetFileExInfoStandard does not seem to be defined and I get a compile error.
I'm afraid I dont know where to find the value for this parameter to input.
I looked in winbase.h but unsuccessful. winbase.inc doesnt exist.

any help in defining or clarifying this parameter would be very appreciated


thanks

John Klosak
Gary Chanson
2005-07-29 17:57:24 UTC
Permalink
Post by john klosak
writing in MASM32 for windowsXP
I need to obtain a FileTime for an existing file
invoke GetFileAttributesEx,ADDR <filename>,GetFileExInfoStandard,ADDR WFD
GetFileExInfoStandard does not seem to be defined and I get a compile error.
I'm afraid I dont know where to find the value for this parameter to input.
I looked in winbase.h but unsuccessful. winbase.inc doesnt exist.
any help in defining or clarifying this parameter would be very appreciated
GetFileExInfoStandard is defined as:

typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard,
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;

It's actual value is 0.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-***@mvps.org
john klosak
2005-07-29 22:21:43 UTC
Permalink
Thanks for the below but it doesnt help me with MASM32 programming
where do I declare this typedef??
how do you know the value of GetFileExInfoStandard == 0??
if you could let me know the above it would clarify alot.
thanks again
John Klosak
Post by Gary Chanson
Post by john klosak
writing in MASM32 for windowsXP
I need to obtain a FileTime for an existing file
invoke GetFileAttributesEx,ADDR <filename>,GetFileExInfoStandard,ADDR WFD
GetFileExInfoStandard does not seem to be defined and I get a compile error.
I'm afraid I dont know where to find the value for this parameter to input.
I looked in winbase.h but unsuccessful. winbase.inc doesnt exist.
any help in defining or clarifying this parameter would be very appreciated
typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard,
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;
It's actual value is 0.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
David J. Craig
2005-07-30 04:13:43 UTC
Permalink
If you don't know how C works, then you will find using MASM under Windows
almost impossible. There are almost no conversions of .h files to .inc.
There is an old utility, h2inc, that will translate some of them.
Post by john klosak
Thanks for the below but it doesnt help me with MASM32 programming
where do I declare this typedef??
how do you know the value of GetFileExInfoStandard == 0??
if you could let me know the above it would clarify alot.
thanks again
John Klosak
Post by Gary Chanson
Post by john klosak
writing in MASM32 for windowsXP
I need to obtain a FileTime for an existing file
invoke GetFileAttributesEx,ADDR <filename>,GetFileExInfoStandard,ADDR WFD
GetFileExInfoStandard does not seem to be defined and I get a compile error.
I'm afraid I dont know where to find the value for this parameter to input.
I looked in winbase.h but unsuccessful. winbase.inc doesnt exist.
any help in defining or clarifying this parameter would be very appreciated
typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard,
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;
It's actual value is 0.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
john klosak
2005-07-30 15:11:03 UTC
Permalink
Actually I have programmed in Windows with MASM32 for quite few years now
and am doing well selling a billing program for medical offices. I know a
modest amount of C++ as for some scanning capability I could not do that in
MASM but for most everything else its very functional.

thanks again

John Klosak
Post by David J. Craig
If you don't know how C works, then you will find using MASM under Windows
almost impossible. There are almost no conversions of .h files to .inc.
There is an old utility, h2inc, that will translate some of them.
Post by john klosak
Thanks for the below but it doesnt help me with MASM32 programming
where do I declare this typedef??
how do you know the value of GetFileExInfoStandard == 0??
if you could let me know the above it would clarify alot.
thanks again
John Klosak
Post by Gary Chanson
Post by john klosak
writing in MASM32 for windowsXP
I need to obtain a FileTime for an existing file
invoke GetFileAttributesEx,ADDR <filename>,GetFileExInfoStandard,ADDR WFD
GetFileExInfoStandard does not seem to be defined and I get a compile error.
I'm afraid I dont know where to find the value for this parameter to input.
I looked in winbase.h but unsuccessful. winbase.inc doesnt exist.
any help in defining or clarifying this parameter would be very appreciated
typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExInfoStandard,
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;
It's actual value is 0.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
Tim Roberts
2005-07-30 04:54:31 UTC
Permalink
Post by john klosak
Thanks for the below but it doesnt help me with MASM32 programming
where do I declare this typedef??
how do you know the value of GetFileExInfoStandard == 0??
if you could let me know the above it would clarify alot.
If no specific values are given, the symbols in a C enumeration type are
assigned starting at 0. GetFileExInfoStandard is 0, GetFileExMaxInfoLevel
is 1.
--
- Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc
john klosak
2005-07-30 15:08:11 UTC
Permalink
Thanks
thats exactly the bit of information i needed.
John Klosak
Post by Tim Roberts
Post by john klosak
Thanks for the below but it doesnt help me with MASM32 programming
where do I declare this typedef??
how do you know the value of GetFileExInfoStandard == 0??
if you could let me know the above it would clarify alot.
If no specific values are given, the symbols in a C enumeration type are
assigned starting at 0. GetFileExInfoStandard is 0, GetFileExMaxInfoLevel
is 1.
--
Providenza & Boekelheide, Inc
#2pencil
2005-08-02 17:58:28 UTC
Permalink
You have like this...

push WFD
push GetFileExInfoStandard
push ADDR <filename>
call GetFileAttributesEX

You need to do like this...

.data
szAttrib db "GetFileExInfoStandard",0
szFile db "C:\yourfilewithpath.txt",0

push WFD
push OFFSET szAttrib ;GetFileExInfoStandard
push OFFSET szFile
call GetFileAttributesEx

HTH
-#2pencil-
http://www.akroncdnr.com
Tim Roberts
2005-08-03 05:06:29 UTC
Permalink
Post by #2pencil
You have like this...
push WFD
push GetFileExInfoStandard
push ADDR <filename>
call GetFileAttributesEX
You need to do like this...
.data
szAttrib db "GetFileExInfoStandard",0
szFile db "C:\yourfilewithpath.txt",0
push WFD
push OFFSET szAttrib ;GetFileExInfoStandard
push OFFSET szFile
call GetFileAttributesEx
This is completely wrong. Please do not offer advice if you are just
guessing. There have already been two correct answers to this. The first
sample is quite right, as long as he adds this:

GetFileExInfoStandard equ 0
--
- Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc
#2pencil
2005-08-03 12:06:37 UTC
Permalink
I didn't mean to miss-lead. When I made my post there was no answer
yet. Maybe since I post through deja there is lag.

Again, I'm sorry.
-#2pencil-

Loading...