- /* Invalid */
- default:
- return ERROR_INVALID_PARAMETER;
- }
-
- /*
- * Parse the creation action flags:
- *
- * Bitfields for action:
- * Bit(s) Description
- *
- * 7-4 Action if file does not exist.
- * 0000 Fail
- * 0001 Create
- *
- * 3-0 Action if file exists.
- * 0000 Fail
- * 0001 Open
- * 0010 Replace/open
- */
- switch (CreateActionFlags)
- {
- /* If the file exists, fail, otherwise, fail also */
- case 0x00:
- // A special case is used after the call to CreateFileA if it succeeds,
- // in order to close the opened handle and return an adequate error.
- CreationDisposition = OPEN_EXISTING;
- break;