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
f8699c0a
Commit
f8699c0a
authored
Jul 08, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move RemoveDirectoryA/W() implementation to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
518decf1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
67 deletions
+50
-67
kernel32.spec
dlls/kernel32/kernel32.spec
+2
-2
path.c
dlls/kernel32/path.c
+0
-62
file.c
dlls/kernelbase/file.c
+44
-0
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+2
-2
file.c
dlls/ntdll/tests/file.c
+2
-1
No files found.
dlls/kernel32/kernel32.spec
View file @
f8699c0a
...
...
@@ -1268,8 +1268,8 @@
@ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) ntdll.TpCallbackReleaseSemaphoreOnCompletion
@ stdcall ReleaseSRWLockExclusive(ptr) ntdll.RtlReleaseSRWLockExclusive
@ stdcall ReleaseSRWLockShared(ptr) ntdll.RtlReleaseSRWLockShared
@ stdcall RemoveDirectoryA(str)
@ stdcall RemoveDirectoryW(wstr)
@ stdcall
-import
RemoveDirectoryA(str)
@ stdcall
-import
RemoveDirectoryW(wstr)
# @ stub RemoveLocalAlternateComputerNameA
# @ stub RemoveLocalAlternateComputerNameW
@ stdcall RemoveVectoredContinueHandler(ptr) ntdll.RtlRemoveVectoredContinueHandler
...
...
dlls/kernel32/path.c
View file @
f8699c0a
...
...
@@ -229,68 +229,6 @@ BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBU
/***********************************************************************
* RemoveDirectoryW (KERNEL32.@)
*/
BOOL
WINAPI
RemoveDirectoryW
(
LPCWSTR
path
)
{
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nt_name
;
ANSI_STRING
unix_name
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
HANDLE
handle
;
BOOL
ret
=
FALSE
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
path
)
);
if
(
!
RtlDosPathNameToNtPathName_U
(
path
,
&
nt_name
,
NULL
,
NULL
))
{
SetLastError
(
ERROR_PATH_NOT_FOUND
);
return
FALSE
;
}
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
ObjectName
=
&
nt_name
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
!
set_ntstatus
(
NtOpenFile
(
&
handle
,
DELETE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
)))
{
RtlFreeUnicodeString
(
&
nt_name
);
return
FALSE
;
}
status
=
wine_nt_to_unix_file_name
(
&
nt_name
,
&
unix_name
,
FILE_OPEN
);
RtlFreeUnicodeString
(
&
nt_name
);
if
(
!
set_ntstatus
(
status
))
{
NtClose
(
handle
);
return
FALSE
;
}
if
(
!
(
ret
=
(
rmdir
(
unix_name
.
Buffer
)
!=
-
1
)))
FILE_SetDosError
();
RtlFreeAnsiString
(
&
unix_name
);
NtClose
(
handle
);
return
ret
;
}
/***********************************************************************
* RemoveDirectoryA (KERNEL32.@)
*/
BOOL
WINAPI
RemoveDirectoryA
(
LPCSTR
path
)
{
WCHAR
*
pathW
;
if
(
!
(
pathW
=
FILE_name_AtoW
(
path
,
FALSE
)))
return
FALSE
;
return
RemoveDirectoryW
(
pathW
);
}
/***********************************************************************
* GetSystemDirectoryW (KERNEL32.@)
*
* See comment for GetWindowsDirectoryA.
...
...
dlls/kernelbase/file.c
View file @
f8699c0a
...
...
@@ -3448,6 +3448,50 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadFileScatter( HANDLE file, FILE_SEGMENT_ELEMENT
}
/***********************************************************************
* RemoveDirectoryA (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
RemoveDirectoryA
(
LPCSTR
path
)
{
WCHAR
*
pathW
;
if
(
!
(
pathW
=
file_name_AtoW
(
path
,
FALSE
)))
return
FALSE
;
return
RemoveDirectoryW
(
pathW
);
}
/***********************************************************************
* RemoveDirectoryW (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
RemoveDirectoryW
(
LPCWSTR
path
)
{
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nt_name
;
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
HANDLE
handle
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
path
)
);
status
=
RtlDosPathNameToNtPathName_U_WithStatus
(
path
,
&
nt_name
,
NULL
,
NULL
);
if
(
!
set_ntstatus
(
status
))
return
FALSE
;
InitializeObjectAttributes
(
&
attr
,
&
nt_name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
status
=
NtOpenFile
(
&
handle
,
DELETE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
RtlFreeUnicodeString
(
&
nt_name
);
if
(
!
status
)
{
FILE_DISPOSITION_INFORMATION
info
=
{
TRUE
};
status
=
NtSetInformationFile
(
handle
,
&
io
,
&
info
,
sizeof
(
info
),
FileDispositionInformation
);
NtClose
(
handle
);
}
return
set_ntstatus
(
status
);
}
/**************************************************************************
* SetEndOfFile (kernelbase.@)
*/
...
...
dlls/kernelbase/kernelbase.spec
View file @
f8699c0a
...
...
@@ -1331,8 +1331,8 @@
@ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) ntdll.TpCallbackReleaseSemaphoreOnCompletion
# @ stub ReleaseStateLock
@ stdcall RemapPredefinedHandleInternal(long long)
@ stdcall RemoveDirectoryA(str)
kernel32.RemoveDirectoryA
@ stdcall RemoveDirectoryW(wstr)
kernel32.RemoveDirectoryW
@ stdcall RemoveDirectoryA(str)
@ stdcall RemoveDirectoryW(wstr)
@ stdcall RemoveDllDirectory(ptr)
# @ stub RemovePackageStatus
# @ stub RemovePackageStatusForUser
...
...
dlls/ntdll/tests/file.c
View file @
f8699c0a
...
...
@@ -3082,16 +3082,17 @@ todo_wine
fileDeleted
=
RemoveDirectoryA
(
buffer
);
ok
(
fileDeleted
,
"Directory should have been deleted
\n
"
);
fileDeleted
=
GetFileAttributesA
(
buffer
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine
ok
(
!
fileDeleted
,
"Directory shouldn't have been deleted
\n
"
);
res
=
nt_get_file_attrs
(
buffer
,
&
fdi2
);
todo_wine
ok
(
res
==
STATUS_DELETE_PENDING
,
"got %#x
\n
"
,
res
);
/* can't open the deleted directory */
handle2
=
CreateFileA
(
buffer
,
DELETE
,
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
0
);
todo_wine
ok
(
handle2
==
INVALID_HANDLE_VALUE
,
"CreateFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"got %u
\n
"
,
GetLastError
());
if
(
handle2
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
handle2
);
CloseHandle
(
handle
);
fileDeleted
=
GetFileAttributesA
(
buffer
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
fileDeleted
,
"Directory should have been deleted
\n
"
);
...
...
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