Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6d0712a3
Commit
6d0712a3
authored
Nov 21, 2004
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved kernel32.DeleteFileW core implementation to ntdll.NtDeleteFile.
parent
40556880
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
8 deletions
+33
-8
file.c
dlls/kernel/file.c
+22
-6
file.c
dlls/ntdll/file.c
+11
-2
No files found.
dlls/kernel/file.c
View file @
6d0712a3
...
...
@@ -1362,16 +1362,32 @@ HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing,
*/
BOOL
WINAPI
DeleteFileW
(
LPCWSTR
path
)
{
HANDLE
hFile
;
UNICODE_STRING
nameW
;
OBJECT_ATTRIBUTES
attr
;
NTSTATUS
status
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
path
)
);
hFile
=
CreateFileW
(
path
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_DELETE_ON_CLOSE
,
0
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
if
(
!
RtlDosPathNameToNtPathName_U
(
path
,
&
nameW
,
NULL
,
NULL
))
{
SetLastError
(
ERROR_PATH_NOT_FOUND
);
return
FALSE
;
}
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
ObjectName
=
&
nameW
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
CloseHandle
(
hFile
);
/* last close will delete the file */
status
=
NtDeleteFile
(
&
attr
);
RtlFreeUnicodeString
(
&
nameW
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
return
TRUE
;
}
...
...
dlls/ntdll/file.c
View file @
6d0712a3
...
...
@@ -1647,8 +1647,17 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE FileHandle, ULONG DesiredAccess,
*/
NTSTATUS
WINAPI
NtDeleteFile
(
POBJECT_ATTRIBUTES
ObjectAttributes
)
{
FIXME
(
"%p
\n
"
,
ObjectAttributes
);
return
STATUS_NOT_IMPLEMENTED
;
NTSTATUS
status
;
HANDLE
hFile
;
IO_STATUS_BLOCK
io
;
TRACE
(
"%p
\n
"
,
ObjectAttributes
);
status
=
NtCreateFile
(
&
hFile
,
GENERIC_READ
|
GENERIC_WRITE
,
ObjectAttributes
,
&
io
,
NULL
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
FILE_OPEN
,
FILE_DELETE_ON_CLOSE
,
NULL
,
0
);
if
(
status
==
STATUS_SUCCESS
)
status
=
NtClose
(
hFile
);
return
status
;
}
/******************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment