Changeset 16650 in vbox for trunk/src/VBox/Runtime/r3/win
- Timestamp:
- Feb 10, 2009 6:53:32 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 42635
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/fileio-win.cpp
r14064 r16650 209 209 return VERR_INVALID_PARAMETER; 210 210 } 211 /* RTFileSetMode needs following rights as well. */ 212 dwDesiredAccess |= FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE; 211 213 212 214 DWORD dwShareMode; … … 724 726 725 727 728 /* This comes from a source file with a different set of system headers (DDK) 729 * so it can't be declared in a common header, like internal/file.h. 730 */ 731 extern int rtFileNativeSetAttributes(HANDLE FileHandle, ULONG FileAttributes); 732 733 726 734 RTR3DECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode) 727 735 { 728 /** @todo darn. this needs a full path; probably must be done if the file is closed 729 * It's quite possible that there is an NT API for this. NtSetInformationFile() for instance. */ 736 /* 737 * Normalize the mode and call the API. 738 */ 739 fMode = rtFsModeNormalize(fMode, NULL, 0); 740 if (!rtFsModeIsValid(fMode)) 741 return VERR_INVALID_PARAMETER; 742 743 ULONG FileAttributes = (fMode & RTFS_DOS_MASK) >> RTFS_DOS_SHIFT; 744 int Err = rtFileNativeSetAttributes((HANDLE)File, FileAttributes); 745 if (Err != ERROR_SUCCESS) 746 { 747 int rc = RTErrConvertFromWin32(Err); 748 Log(("RTFileSetMode(%RTfile, %RTfmode): rtFileNativeSetAttributes (0x%08X) failed with err %d (%Rrc)\n", 749 File, fMode, FileAttributes, Err, rc)); 750 return rc; 751 } 730 752 return VINF_SUCCESS; 731 753 }
Note:
See TracChangeset
for help on using the changeset viewer.