Click to See Complete Forum and Search --> : GetFileAttributesEx FAILS with pagefile.sys
Woidl
August 11th, 2004, 08:37 AM
Hi all,
maybe someone can help me...
I try to get attribute-infos from pagefile.sys using GetFileAttributesEx.
But it FAILS with GetLastError = 0x20 = ERROR_SHARING_VIOLATION.
I know pagefile.sys is accessed via file-mapping, but CreateFile also fails trying to access via:
HANDLE hFile = CreateFile("C://pagefile.sys", FILE_READ_ATTRIBUTES, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, NULL);
what can i do?
thnx for any help...
Marc G
August 11th, 2004, 02:12 PM
Weird, GetFileAttributes works for me (Windows XP) on pagefile.sys.
Which OS?
Woidl
August 12th, 2004, 03:16 AM
Yup... strange... I use Windows XP SP 1.
Andreas Masur
August 12th, 2004, 07:17 AM
Weird, GetFileAttributes works for me (Windows XP) on pagefile.sys.
Which OS?
Just out of curiosity...did you tried "'GetFileAtrributes()' or 'GetFileAttributesEx()'...
Woidl
August 12th, 2004, 07:23 AM
I used GetFileAttributesEx()...
Andreas Masur
August 12th, 2004, 08:25 AM
I used GetFileAttributesEx()...
Yes....but Marc was talking about 'GetFileAttributes()', thus, there might be differences...never test it though on my own... :eek:
Woidl
August 12th, 2004, 08:36 AM
yes, but with GetFileAttributes i cannot get the FILETIME values...
opening the file with CreateFile (SHARE_READ and so on) also failed, wanted to get a handle for GetFileTime()... there also GetLastErr receives 0x20...
sbubis
August 12th, 2004, 10:01 AM
Try FindFirstFile/FindNextFile. This way you don't need to CreateFile and get all necessary attributes.
Marc G
August 12th, 2004, 02:23 PM
Just out of curiosity...did you tried "'GetFileAtrributes()' or 'GetFileAttributesEx()'...
I used GetFileAtrributes()...
Marc G
August 12th, 2004, 02:26 PM
I used GetFileAttributes to query attributes of files and _tstat64 to query filetime.
Woidl
August 13th, 2004, 10:32 AM
Thnx for your help, i'll try it soon as possible...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.