Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
e28d5417
Commit
e28d5417
authored
19 years ago
by
James Hawkins
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
advpack: Forward DelNodeA to its Unicode counterpart.
parent
478712a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/advpack/advpack.spec
+1
-1
1 addition, 1 deletion
dlls/advpack/advpack.spec
dlls/advpack/files.c
+47
-21
47 additions, 21 deletions
dlls/advpack/files.c
with
48 additions
and
22 deletions
dlls/advpack/advpack.spec
+
1
−
1
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)
...
...
This diff is collapsed.
Click to expand it.
dlls/advpack/files.c
+
47
−
21
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
(
CharPrev
A
(
fname
,
fname
+
fname_len
)
!=
"
\\
"
)
if
(
lstrcmpW
(
CharPrev
W
(
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
)
&&
RemoveDirectory
A
(
fname
))
TRACE
(
"%s: directory
\n
"
,
debugstr_w
(
fname
)
)
;
if
(
SetFileAttributes
W
(
fname
,
FILE_ATTRIBUTE_NORMAL
)
&&
RemoveDirectory
W
(
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
)
&&
DeleteFile
A
(
fname
))
TRACE
(
"%s: file
\n
"
,
debugstr_w
(
fname
)
)
;
if
(
SetFileAttributes
W
(
fname
,
FILE_ATTRIBUTE_NORMAL
)
&&
DeleteFile
W
(
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
(
LPCSTR
pszFileOrDirName
,
DWORD
dwFlags
)
HRESULT
WINAPI
DelNode
W
(
LPC
W
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 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment