Add mod: Unlock Office Files for Upload#4284
Conversation
Submission reviewNote: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. For item 2, perhaps at least exclude the indexer service and other system processes such as explorer.exe. Also consider excluding processes running in session 0 and non-GUI processes. Clever idea, and the core flow (let the open fail, copy on 1. The global HANDLE hTemp = CreateFileW_Original(
tempPath.c_str(), dwDesiredAccess,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
lpSecurityAttributes, dwCreationDisposition,
dwFlagsAndAttributes | FILE_FLAG_DELETE_ON_CLOSE,
hTemplateFile);2. Temp files leak on process crash / abnormal exit. 3. Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations about the feature behavior itself.
|
…, towlower, GetTempFileNameW, session 0 skip, widen write guard
|
All required and optional points addressed in v0.2. Summary of changes: 1. Dropped the The 2. Narrowed scope
3. Fixed
4. Fixed Both 5. Fixed temp-name uniqueness — switched to
6. Removed redundant
7. Widened write-bits guard The access check now covers |
Adds a new mod that transparently unlocks Office files that are locked by Word/Excel/PowerPoint when another process tries to read them for upload or attachment.
What it does
When a
.docx,.xlsx,.pptx(or legacy variants) is open in Word/Excel/PowerPoint, attempting to upload or attach it in Chrome, Edge, Outlook, Teams, Discord, etc. fails with:This mod hooks
CreateFileWin every process. When a read-only open on a tracked extension fails withERROR_SHARING_VIOLATION, it:%TEMP%CloseHandleto delete the temp copy automatically when doneNo user-visible prompts. No need to close Word first.
Details
CreateFileW,CloseHandle(viakernel32.dll)@include *(all processes — needed since the uploader can be any app).docx/.docm/.doc,.xlsx/.xlsm/.xls,.pptx/.pptm/.ppt