Dokan 3.0.0
User mode file system library for windows with FUSE Wrapper
Loading...
Searching...
No Matches
dokan_pool.h
1/*
2 Dokan : user-mode file system library for Windows
3
4 Copyright (C) 2016 Keith Newton
5 Copyright (C) 2022 - 2025 Google, Inc.
6
7 http://dokan-dev.github.io
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU Lesser General Public License as published by the Free
11Software Foundation; either version 3 of the License, or (at your option) any
12later version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License along
19with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef DOKAN_POOL_H_
23#define DOKAN_POOL_H_
24
25#include "dokani.h"
26
27#define DOKAN_PULL_EVENT_TIMEOUT_MS 100
28#define DOKAN_MAIN_PULL_THREAD_COUNT_MAX 16
29#define DOKAN_MAIN_PULL_THREAD_COUNT_MIN 2
30#define BATCH_EVENT_CONTEXT_SIZE (EVENT_CONTEXT_MAX_SIZE * 4)
31#define DOKAN_IO_BATCH_SIZE \
32 ((SIZE_T)(FIELD_OFFSET(DOKAN_IO_BATCH, EventContext)) + \
33 BATCH_EVENT_CONTEXT_SIZE)
34
35#define DOKAN_EVENT_INFO_16K_SIZE \
36 (FIELD_OFFSET(EVENT_INFORMATION, Buffer) + (16 * 1024))
37#define DOKAN_EVENT_INFO_32K_SIZE \
38 (FIELD_OFFSET(EVENT_INFORMATION, Buffer) + (32 * 1024))
39#define DOKAN_EVENT_INFO_64K_SIZE \
40 (FIELD_OFFSET(EVENT_INFORMATION, Buffer) + (64 * 1024))
41#define DOKAN_EVENT_INFO_128K_SIZE \
42 (FIELD_OFFSET(EVENT_INFORMATION, Buffer) + (128 * 1024))
43
44PTP_POOL GetThreadPool();
45int InitializePool();
46VOID CleanupPool();
47
48PDOKAN_IO_BATCH PopIoBatchBuffer();
49VOID PushIoBatchBuffer(PDOKAN_IO_BATCH IoBatch);
50VOID FreeIoBatchBuffer(PDOKAN_IO_BATCH IoBatch);
51
52PDOKAN_IO_EVENT PopIoEventBuffer();
53VOID PushIoEventBuffer(PDOKAN_IO_EVENT IoEvent);
54
55// Default Event size.
56PEVENT_INFORMATION PopEventResult();
57VOID PushEventResult(PEVENT_INFORMATION EventResult);
58VOID FreeEventResult(PEVENT_INFORMATION EventResult);
59
60// Event with extra memory allocated for events holding additional data.
61PEVENT_INFORMATION Pop16KEventResult();
62VOID Push16KEventResult(PEVENT_INFORMATION EventResult);
63PEVENT_INFORMATION Pop32KEventResult();
64VOID Push32KEventResult(PEVENT_INFORMATION EventResult);
65PEVENT_INFORMATION Pop64KEventResult();
66VOID Push64KEventResult(PEVENT_INFORMATION EventResult);
67PEVENT_INFORMATION Pop128KEventResult();
68VOID Push128KEventResult(PEVENT_INFORMATION EventResult);
69
70PDOKAN_OPEN_INFO PopFileOpenInfo();
71VOID PushFileOpenInfo(PDOKAN_OPEN_INFO FileInfo);
72VOID FreeFileOpenInfo(PDOKAN_OPEN_INFO FileInfo);
73
74PDOKAN_VECTOR PopDirectoryList();
75VOID PushDirectoryList(PDOKAN_VECTOR DirectoryList);
76
77#endif