Try GetFileAttributesEx API function.