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
e28d5417
Commit
e28d5417
authored
Mar 23, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Mar 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Forward DelNodeA to its Unicode counterpart.
parent
478712a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
22 deletions
+48
-22
advpack.spec
dlls/advpack/advpack.spec
+1
-1
files.c
dlls/advpack/files.c
+47
-21
No files found.
dlls/advpack/advpack.spec
View file @
e28d5417
...
...
@@ -6,7 +6,7 @@
@ stdcall AdvInstallFile(long str str str str long long) AdvInstallFileA
@ stdcall CloseINFEngine(long)
@ stdcall DelNodeA(str long)
#
stdcall DelNodeW(wstr long)
@
stdcall DelNodeW(wstr long)
@ stdcall DelNode(str long) DelNodeA
@ stdcall DelNodeRunDLL32A(ptr ptr str long)
# stdcall DelNodeRunDLL32W(ptr ptr wstr long)
...
...
dlls/advpack/files.c
View file @
e28d5417
...
...
@@ -323,36 +323,41 @@ done:
return
HRESULT_FROM_WIN32
(
dwLastError
);
}
static
HRESULT
DELNODE_recurse_dirtree
(
LPSTR
fname
,
DWORD
flags
)
static
HRESULT
DELNODE_recurse_dirtree
(
LP
W
STR
fname
,
DWORD
flags
)
{
DWORD
fattrs
=
GetFileAttributes
A
(
fname
);
DWORD
fattrs
=
GetFileAttributes
W
(
fname
);
HRESULT
ret
=
E_FAIL
;
static
const
WCHAR
backslash
[]
=
{
'\\'
,
0
};
static
const
WCHAR
asterisk
[]
=
{
'*'
,
0
};
static
const
WCHAR
dot
[]
=
{
'.'
,
0
};
static
const
WCHAR
dotdot
[]
=
{
'.'
,
'.'
,
0
};
if
(
fattrs
&
FILE_ATTRIBUTE_DIRECTORY
)
{
HANDLE
hFindFile
;
WIN32_FIND_DATA
A
w32fd
;
WIN32_FIND_DATA
W
w32fd
;
BOOL
done
=
TRUE
;
int
fname_len
=
lstrlen
A
(
fname
);
int
fname_len
=
lstrlen
W
(
fname
);
/* Generate a path with wildcard suitable for iterating */
if
(
CharPrevA
(
fname
,
fname
+
fname_len
)
!=
"
\\
"
)
if
(
lstrcmpW
(
CharPrevW
(
fname
,
fname
+
fname_len
),
backslash
)
)
{
lstrcpy
A
(
fname
+
fname_len
,
"
\\
"
);
lstrcpy
W
(
fname
+
fname_len
,
backslash
);
++
fname_len
;
}
lstrcpy
A
(
fname
+
fname_len
,
"*"
);
lstrcpy
W
(
fname
+
fname_len
,
asterisk
);
if
((
hFindFile
=
FindFirstFile
A
(
fname
,
&
w32fd
))
!=
INVALID_HANDLE_VALUE
)
if
((
hFindFile
=
FindFirstFile
W
(
fname
,
&
w32fd
))
!=
INVALID_HANDLE_VALUE
)
{
/* Iterate through the files in the directory */
for
(
done
=
FALSE
;
!
done
;
done
=
!
FindNextFile
A
(
hFindFile
,
&
w32fd
))
for
(
done
=
FALSE
;
!
done
;
done
=
!
FindNextFile
W
(
hFindFile
,
&
w32fd
))
{
TRACE
(
"%s
\n
"
,
w32fd
.
cFileName
);
if
(
lstrcmp
A
(
"."
,
w32fd
.
cFileName
)
!=
0
&&
lstrcmp
A
(
".."
,
w32fd
.
cFileName
)
!=
0
)
TRACE
(
"%s
\n
"
,
debugstr_w
(
w32fd
.
cFileName
)
);
if
(
lstrcmp
W
(
dot
,
w32fd
.
cFileName
)
!=
0
&&
lstrcmp
W
(
dotdot
,
w32fd
.
cFileName
)
!=
0
)
{
lstrcpy
A
(
fname
+
fname_len
,
w32fd
.
cFileName
);
lstrcpy
W
(
fname
+
fname_len
,
w32fd
.
cFileName
);
if
(
DELNODE_recurse_dirtree
(
fname
,
flags
)
!=
S_OK
)
{
break
;
/* Failure */
...
...
@@ -367,8 +372,8 @@ static HRESULT DELNODE_recurse_dirtree(LPSTR fname, DWORD flags)
if
(
done
)
{
TRACE
(
"%s: directory
\n
"
,
fname
);
if
(
SetFileAttributes
A
(
fname
,
FILE_ATTRIBUTE_NORMAL
)
&&
RemoveDirectoryA
(
fname
))
TRACE
(
"%s: directory
\n
"
,
debugstr_w
(
fname
)
);
if
(
SetFileAttributes
W
(
fname
,
FILE_ATTRIBUTE_NORMAL
)
&&
RemoveDirectoryW
(
fname
))
{
ret
=
S_OK
;
}
...
...
@@ -376,8 +381,8 @@ static HRESULT DELNODE_recurse_dirtree(LPSTR fname, DWORD flags)
}
else
{
TRACE
(
"%s: file
\n
"
,
fname
);
if
(
SetFileAttributes
A
(
fname
,
FILE_ATTRIBUTE_NORMAL
)
&&
DeleteFileA
(
fname
))
TRACE
(
"%s: file
\n
"
,
debugstr_w
(
fname
)
);
if
(
SetFileAttributes
W
(
fname
,
FILE_ATTRIBUTE_NORMAL
)
&&
DeleteFileW
(
fname
))
{
ret
=
S_OK
;
}
...
...
@@ -389,6 +394,27 @@ static HRESULT DELNODE_recurse_dirtree(LPSTR fname, DWORD flags)
/***********************************************************************
* DelNodeA (ADVPACK.@)
*
* See DelNodeW.
*/
HRESULT
WINAPI
DelNodeA
(
LPCSTR
pszFileOrDirName
,
DWORD
dwFlags
)
{
UNICODE_STRING
fileordirname
;
HRESULT
res
;
TRACE
(
"(%s, 0x%08lx)
\n
"
,
debugstr_a
(
pszFileOrDirName
),
dwFlags
);
RtlCreateUnicodeStringFromAsciiz
(
&
fileordirname
,
pszFileOrDirName
);
res
=
DelNodeW
(
fileordirname
.
Buffer
,
dwFlags
);
RtlFreeUnicodeString
(
&
fileordirname
);
return
res
;
}
/***********************************************************************
* DelNodeW (ADVPACK.@)
*
* Deletes a file or directory
*
* PARAMS
...
...
@@ -404,19 +430,19 @@ static HRESULT DELNODE_recurse_dirtree(LPSTR fname, DWORD flags)
* - Native version apparently does a lot of checking to make sure
* we're not trying to delete a system directory etc.
*/
HRESULT
WINAPI
DelNode
A
(
LPC
STR
pszFileOrDirName
,
DWORD
dwFlags
)
HRESULT
WINAPI
DelNode
W
(
LPCW
STR
pszFileOrDirName
,
DWORD
dwFlags
)
{
CHAR
fname
[
MAX_PATH
];
W
CHAR
fname
[
MAX_PATH
];
HRESULT
ret
=
E_FAIL
;
TRACE
(
"(%s, 0x%08lx)
\n
"
,
debugstr_
a
(
pszFileOrDirName
),
dwFlags
);
TRACE
(
"(%s, 0x%08lx)
\n
"
,
debugstr_
w
(
pszFileOrDirName
),
dwFlags
);
if
(
dwFlags
)
FIXME
(
"Flags ignored!
\n
"
);
if
(
pszFileOrDirName
&&
*
pszFileOrDirName
)
{
lstrcpy
A
(
fname
,
pszFileOrDirName
);
lstrcpy
W
(
fname
,
pszFileOrDirName
);
/* TODO: Should check for system directory deletion etc. here */
...
...
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