[Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using Transactional NTFS.]
Applies to: desktop apps only
Deletes an existing empty directory as a transacted operation.
Syntax
BOOL WINAPI RemoveDirectoryTransacted( __in LPCTSTR lpPathName, __in HANDLE hTransaction );
Parameters
- lpPathName [in]
-
The path of the directory to be removed. The path must specify an empty directory, and the calling process must have delete access to the directory.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.
The directory must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
- hTransaction [in]
-
A handle to the transaction. This handle is returned by the CreateTransaction function.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The RemoveDirectoryTransacted function marks a directory for deletion on close. Therefore, the directory is not removed until the last handle to the directory is closed.
RemoveDirectory removes a directory junction, even if the contents of the target are not empty; the function removes directory junctions regardless of the state of the target object.
Requirements
|
Minimum supported client | Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | RemoveDirectoryTransactedW (Unicode) and RemoveDirectoryTransactedA (ANSI) |
See also
- CreateDirectoryTransacted
- Creating and Deleting Directories
- Directory Management Functions
- Transactional NTFS
Send comments about this topic to Microsoft
Build date: 4/17/2012