Jump to content

CreateDirectory in code running on PE is failing mysterously (Solved)


Avin

Recommended Posts

I'm running some code that uses FindFirstFile/FindNext, CreateDirectory, and CopyFile in a recursive function that recursively copies a source directory and all subdirectories to a destination path (which may not exist initially). The code works fine on my XP PC, and generally works on PE as well, however it keeps failing to create the directory Q:\windows. Other directories parallel to that are being created perfectly fine. Thinking that perhaps there might be some sort of protection against creating a windows directory, I had my function create a directory called "xyzzytemp" instead of "windows" if it was supposed to create such a directory and then use MoveFile to rename it to "windows" ... however the CreateDirectory call would still fail. The error I received was 87 (ERROR_INVALID_PARAMETER) but I cannot see how the parameter is invalid for only this directory and not every other directory. Any ideas? Are there hidden differences between standard API functions like those I am using between their implementations on XP and PE?

[Edit: I figured out the problem. The format had not yet completed by the time I copied the Windows directory.]

Edited by Avin
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...