11/*
22 Dokan : user-mode file system library for Windows
33
4- Copyright (C) 2020 - 2023 Google, Inc.
4+ Copyright (C) 2020 - 2025 Google, Inc.
55 Copyright (C) 2015 - 2019 Adrien J. <liryna.stark@gmail.com> and Maxime C. <maxime@islog.com>
66 Copyright (C) 2007 - 2011 Hiroki Asakawa <info@dokan-dev.net>
77
@@ -56,7 +56,7 @@ extern "C" {
5656/** @{ */
5757
5858/** The current Dokan version (200 means ver 2.0.0). \ref DOKAN_OPTIONS.Version */
59- #define DOKAN_VERSION 220
59+ #define DOKAN_VERSION 230
6060/** Minimum Dokan version (ver 2.0.0) accepted. */
6161#define DOKAN_MINIMUM_COMPATIBLE_VERSION 200
6262/** Driver file name including the DOKAN_MAJOR_API_VERSION */
@@ -204,8 +204,14 @@ typedef struct _DOKAN_FILE_INFO {
204204 * Must be set in \ref DOKAN_OPERATIONS.ZwCreateFile if the file appears to be a folder.
205205 */
206206 UCHAR IsDirectory ;
207- /** Flag if the file has to be deleted during DOKAN_OPERATIONS. Cleanup event. */
208- UCHAR DeleteOnClose ;
207+ /**
208+ * Flag if the file has to be deleted during \ref DOKAN_OPERATIONS.Cleanup event.
209+ *
210+ * If a prior \ref DOKAN_OPERATIONS.ZwCreateFile call with \c FILE_FLAG_DELETE_ON_CLOSE or \ref DOKAN_OPERATIONS.DeleteFile
211+ * / \ref DOKAN_OPERATIONS.DeleteDirectory with DOKAN_FILE_INFO.DeletePending set to \c TRUE succeed on an object,
212+ * the last handle open on that object will have this variable set to \c TRUE and therefore will have to delete the object.
213+ */
214+ UCHAR DeletePending ;
209215 /** Read or write is paging IO. */
210216 UCHAR PagingIo ;
211217 /** Read or write is synchronous IO. */
@@ -294,7 +300,7 @@ typedef struct _DOKAN_OPERATIONS {
294300 *
295301 * Cleanup request before \ref CloseFile is called.
296302 *
297- * When DOKAN_FILE_INFO.DeleteOnClose is \c TRUE, the file in Cleanup must be deleted.
303+ * When DOKAN_FILE_INFO.DeletePending is \c TRUE, the file in Cleanup must be deleted.
298304 * The function cannot fail therefore the filesystem need to ensure ahead
299305 * that a the delete can safely happen during Cleanup.
300306 * See DeleteFile documentation for explanation.
@@ -480,7 +486,7 @@ typedef struct _DOKAN_OPERATIONS {
480486 *
481487 * Check if it is possible to delete a file.
482488 *
483- * DeleteFile will also be called with DOKAN_FILE_INFO.DeleteOnClose set to \c FALSE
489+ * DeleteFile will also be called with DOKAN_FILE_INFO.DeletePending set to \c FALSE
484490 * to notify the driver when the file is no longer requested to be deleted.
485491 *
486492 * The file in DeleteFile should not be deleted, but instead the file
@@ -489,9 +495,9 @@ typedef struct _DOKAN_OPERATIONS {
489495 * appropriate error codes, such as \c STATUS_ACCESS_DENIED or
490496 * \c STATUS_OBJECT_NAME_NOT_FOUND, should be returned.
491497 *
492- * When \c STATUS_SUCCESS is returned, a Cleanup call is received afterwards with
493- * DOKAN_FILE_INFO.DeleteOnClose set to \c TRUE. Only then must the closing file
494- * be deleted.
498+ * When \c STATUS_SUCCESS is returned, a Cleanup call is received afterwards
499+ * on the last context open on this object with DOKAN_FILE_INFO.DeletePending set to \c TRUE,
500+ * Only then must the closing file be deleted.
495501 *
496502 * \param FileName File path requested by the Kernel on the FileSystem.
497503 * \param DokanFileInfo Information about the file or directory.
@@ -507,7 +513,7 @@ typedef struct _DOKAN_OPERATIONS {
507513 *
508514 * Check if it is possible to delete a directory.
509515 *
510- * DeleteDirectory will also be called with DOKAN_FILE_INFO.DeleteOnClose set to \c FALSE
516+ * DeleteDirectory will also be called with DOKAN_FILE_INFO.DeletePending set to \c FALSE
511517 * to notify the driver when the file is no longer requested to be deleted.
512518 *
513519 * The Directory in DeleteDirectory should not be deleted, but instead
@@ -517,9 +523,9 @@ typedef struct _DOKAN_OPERATIONS {
517523 * \c STATUS_OBJECT_PATH_NOT_FOUND, or \c STATUS_DIRECTORY_NOT_EMPTY, should
518524 * be returned.
519525 *
520- * When \c STATUS_SUCCESS is returned, a Cleanup call is received afterwards with
521- * DOKAN_FILE_INFO.DeleteOnClose set to \c TRUE. Only then must the closing file
522- * be deleted.
526+ * When \c STATUS_SUCCESS is returned, a Cleanup call is received afterwards
527+ * on the last context open on this object with DOKAN_FILE_INFO.DeletePending set to \c TRUE,
528+ * Only then must the closing file be deleted.
523529 *
524530 * \param FileName File path requested by the Kernel on the FileSystem.
525531 * \param DokanFileInfo Information about the file or directory.
0 commit comments