Thread: GetFileAttributes And VirtualBox

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    18

    GetFileAttributes And VirtualBox

    I have an application which creates a local directory. Later on, elsewhere in the code this path is checked by using GetFileAttributes and checking that the FILE_ATTRIBUTE_DIRECTORY flag was present.

    This works fine on my PC but when I run the same code on a virtual machine using VirtualBox it fails. It's the same OS (Windows XP Professional 32-bit) and same setup. But this time it says the flag is not present.

    This is a bit of an odd one but does anyone have any ideas what might be causing this?

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    My blind guess is that you're using == instead of & to check the attributes' presence.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    18
    Quote Originally Posted by adeyblue View Post
    My blind guess is that you're using == instead of & to check the attributes' presence.
    No I'm not and as stated in the original post, it works fine on a non-virtual machine. It is only on a virtual machine that this happens. Your blind guess wouldn't work on either

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Does that happen for all directories?
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > I have an application which creates a local directory.
    I have many apps running on my XP in Vbox, and they seem to work just fine.

    Point is, we need to see your actual code (not a description).
    The fact that it "seems to work native" has more than a passing chance of being pure dumb luck on your part.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed