Announcement

Collapse
No announcement yet.

Missing declare's in WIN32API.INC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing declare's in WIN32API.INC

    I was trying to use this one API Call, then discovered that it's
    not in the Win32api.inc file. The DECLARE itself I could figure out
    from the Win32.hlp description. However, the FUNCTION uses an
    equate that is also not in the INC file, and I have NO way of
    knowing what it should be.

    The API Function is: GetFileAttributesEx()

    The Equate is: GET_FILEEX_INFO_LEVELS

    The INC is also missing a required TYPE: WIN32_FILE_ATTRIBUTE_DATA

    Any help would be greatly appreciated!

    Thanks in advance.


    ------------------
    Clay C. Clear

    Clay Clear's Software
    mailto:[email protected][email protected]</A>

  • #2
    According to my notes, this is a NT-only API which is probably why it is not int he WIN32API.INC file.

    It should look something like this:

    DECLARE FUNCTION GetFileAttributesEx LIB "KERNEL32.DLL" ALIAS "GetFileAttributesEx" (lpfilename AS ASCIIZ, BYVAL fIndoLevelId AS LONG, lpFileInformation AS ANY) AS LONG

    (It may need an "W" at the end of the ALIAS name.

    More later if I can find the UDT info.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Lance,

      Thanks for your reply. You don't have to find the info, then, as
      I am running a Win98SE machine. I messed up - I thought when the
      Win32.hlp says, "New - Windows NT", that it meant that it were
      new TO NT, but had existed for other OS's. Now I know that it
      means that it's NT-specific. Shows you how multifaceted the
      English language is. <chuckle>

      Thanks, anyway!

      Regards,

      P.S. I'll use GetFileInformationByHandle, instead.


      ------------------
      Clay C. Clear

      Clay Clear's Software
      mailto:[email protected][email protected]</A>

      [This message has been edited by Clay Clear (edited October 21, 2001).]

      Comment


      • #4
        Clay,

        You can use the 'Quick Info' button in Win32.hlp to tell which platform the function in question is supported.

        Regards,

        ------------------
        Kev G Peel
        KGP Software, Bridgwater, UK.
        mailto:[email protected][email protected]</A>
        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

        Comment


        • #5
          That needs to be ALIAS "GetFileAttributesExA". The function is available
          under Windows 98 and later, and NT 4.0 and later. The only documented
          "info level" is 0 (zero), which returns a value of:
          Code:
          TYPE WIN32_FILE_ATTRIBUTE_DATA
            dwFileAttributes AS DWORD
            ftCreationTime AS FILETIME
            ftLastAccessTime AS FILETIME
            ftLastWriteTime AS FILETIME
            dwVolumeSerialNumber AS DWORD
            nFileSizeHigh AS DWORD
            nFileSizeLow AS DWORD
          END TYPE
          Sadly, it's not possible to substitute a QUAD for the file size DWORDs,
          as Microsoft put the DWORDs in the wrong order.

          ------------------
          Tom Hanlin
          PowerBASIC Staff

          Comment


          • #6
            With some of the NT only API calls, maybe they can be included in WIN32API.INC, but have an #IF statement to lock them out if we don't need them.

            ------------------
            George W. Bleck
            Senior System Engineer
            KeySpan Corporation
            <b>George W. Bleck</b>
            <img src='http://www.blecktech.com/myemail.gif'>

            Comment


            • #7
              It's on the longer-term plan...

              ------------------
              Lance
              PowerBASIC Support
              mailto:[email protected][email protected]</A>
              Lance
              mailto:[email protected]

              Comment


              • #8
                There's no harm done in making the NT-only calls available in the
                Win32API files: declarations don't use up resources. Trying to keep
                track of which calls are available under which OSes is somewhat
                futile, in any event-- an API may be tied, not so much to the OS,
                as to the version of (say) Microsoft Internet Explorer or other
                installed tools.

                There are plans to break the include files into more convenient
                modules in the future but, it's a massive job, and may not be soon
                to come.

                ------------------
                Tom Hanlin
                PowerBASIC Staff

                Comment


                • #9
                  Sadly, it's not possible to substitute a QUAD for the file size DWORDs,
                  as Microsoft put the DWORDs in the wrong order.
                  Might be convenient if PB added a new function:

                  MAKQD(lowDword, HiDword) - returns 64-bit integer with specified 32-bit entities as components

                  ..which in this case would make the filesize

                  FileSize&& = MAKQD(X.filesizelow, X.FilesizeHigh)

                  I mean you already have MAKPTR, MAKDWD and MAKLNG...

                  MCM
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    It's on the wish list.

                    ------------------
                    Tom Hanlin
                    PowerBASIC Staff

                    Comment

                    Working...
                    X