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
d11efe88
Commit
d11efe88
authored
Feb 01, 2003
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Feb 01, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change SHCreateDirectory and Win32DeleteFile to be Unicode or ANSI depending
on OS version. Add ShCreateDirectoryEx API.
parent
c306f351
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
19 deletions
+72
-19
shell32.spec
dlls/shell32/shell32.spec
+4
-2
shlfileop.c
dlls/shell32/shlfileop.c
+61
-17
shlobj.h
include/shlobj.h
+7
-0
No files found.
dlls/shell32/shell32.spec
View file @
d11efe88
...
...
@@ -151,8 +151,8 @@
161 stdcall SHRunControlPanel (long long) SHRunControlPanel
162 stdcall SHSimpleIDListFromPath (ptr) SHSimpleIDListFromPathAW
163 stdcall StrToOleStr (wstr str) StrToOleStrAW
164 stdcall Win32DeleteFile(str) Win32DeleteFile
165 stdcall SHCreateDirectory(long
long
) SHCreateDirectory
164 stdcall Win32DeleteFile(str) Win32DeleteFile
AW
165 stdcall SHCreateDirectory(long
ptr
) SHCreateDirectory
166 stdcall CallCPLEntry16(long long long long long long) CallCPLEntry16
167 stdcall SHAddFromPropSheetExtArray(long long long) SHAddFromPropSheetExtArray
168 stdcall SHCreatePropSheetExtArray(long str long) SHCreatePropSheetExtArray
...
...
@@ -355,6 +355,8 @@
@ stdcall SHBrowseForFolderA(ptr) SHBrowseForFolderA
@ stdcall SHBrowseForFolderW(ptr) SHBrowseForFolderW
@ stdcall SHChangeNotify (long long ptr ptr) SHChangeNotify
@ stdcall SHCreateDirectoryExA(long str ptr) SHCreateDirectoryExA
@ stdcall SHCreateDirectoryExW(long wstr ptr) SHCreateDirectoryExW
@ stub ShellHookProc
@ stub SHEmptyRecycleBinA@12
@ stub SHEmptyRecycleBinW@12
...
...
dlls/shell32/shlfileop.c
View file @
d11efe88
...
...
@@ -129,33 +129,61 @@ BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI)
}
/*************************************************************************
* SHCreateDirectory
[SHELL32.165]
* SHCreateDirectory
[SHELL32.165]
*
* NOTES
* exported by ordinal
*
not sure about LPSECURITY_ATTRIBUTES
*
WinNT/2000 exports Unicode
*/
DWORD
WINAPI
SHCreateDirectory
(
LPSECURITY_ATTRIBUTES
sec
,
LPCSTR
path
)
DWORD
WINAPI
SHCreateDirectory
(
HWND
hWnd
,
LPCVOID
path
)
{
if
(
SHELL_OsIsUnicode
())
return
SHCreateDirectoryExW
(
hWnd
,
path
,
NULL
);
return
SHCreateDirectoryExA
(
hWnd
,
path
,
NULL
);
}
/*************************************************************************
* SHCreateDirectoryExA [SHELL32.@]
*/
DWORD
WINAPI
SHCreateDirectoryExA
(
HWND
hWnd
,
LPCSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
{
DWORD
ret
;
TRACE
(
"(%p,
%s)
\n
"
,
sec
,
path
);
if
((
ret
=
CreateDirectoryA
(
path
,
sec
)))
TRACE
(
"(%p,
%s, %p)
\n
"
,
hWnd
,
path
,
sec
);
if
((
ret
=
CreateDirectoryA
(
path
,
sec
)))
{
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHA
,
path
,
NULL
);
}
else
if
(
hWnd
)
FIXME
(
"Semi-stub, non zero hWnd should be used as parent for error dialog!"
);
return
ret
;
}
/*************************************************************************
* SHCreateDirectoryExW [SHELL32.@]
*/
DWORD
WINAPI
SHCreateDirectoryExW
(
HWND
hWnd
,
LPCWSTR
path
,
LPSECURITY_ATTRIBUTES
sec
)
{
DWORD
ret
;
TRACE
(
"(%p, %s, %p)
\n
"
,
hWnd
,
debugstr_w
(
path
),
sec
);
if
((
ret
=
CreateDirectoryW
(
path
,
sec
)))
{
SHChangeNotify
(
SHCNE_MKDIR
,
SHCNF_PATHW
,
path
,
NULL
);
}
else
if
(
hWnd
)
FIXME
(
"Semi-stub, non zero hWnd should be used as parent for error dialog!"
);
return
ret
;
}
/************************************************************************
*
Win32DeleteFile [SHELL32.164]
* Win32DeleteFile [SHELL32.164]
*
* Deletes a file.
Also triggers a change notify if one exists.
* Deletes a file. Also triggers a change notify if one exists.
*
*
FIXME
:
* Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be ANSI.
* This is Unicode on NT/2000
*
NOTES
:
*
Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be ANSI.
*
This is Unicode on NT/2000
*/
BOOL
WINAPI
Win32DeleteFile
(
LP
STR
fName
)
static
BOOL
Win32DeleteFileA
(
LPC
STR
fName
)
{
TRACE
(
"%p(%s)
\n
"
,
fName
,
fName
);
...
...
@@ -164,6 +192,22 @@ BOOL WINAPI Win32DeleteFile(LPSTR fName)
return
TRUE
;
}
static
BOOL
Win32DeleteFileW
(
LPCWSTR
fName
)
{
TRACE
(
"%p(%s)
\n
"
,
fName
,
debugstr_w
(
fName
));
DeleteFileW
(
fName
);
SHChangeNotify
(
SHCNE_DELETE
,
SHCNF_PATHW
,
fName
,
NULL
);
return
TRUE
;
}
DWORD
WINAPI
Win32DeleteFileAW
(
LPCVOID
fName
)
{
if
(
SHELL_OsIsUnicode
())
return
Win32DeleteFileW
(
fName
);
return
Win32DeleteFileA
(
fName
);
}
/**************************************************************************
* SHELL_FileNamesMatch()
*
...
...
@@ -269,8 +313,8 @@ DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp)
char
*
fromfile
;
int
lenPTo
;
if
(
!
destisdir
)
{
TRACE
(
" creating directory %s
\n
"
,
pTo
);
SHCreateDirectory
(
NULL
,
pTo
);
TRACE
(
" creating directory %s
\n
"
,
pTo
);
SHCreateDirectoryExA
(
NULL
,
pTo
,
NULL
);
}
lenPTo
=
strlen
(
pTo
);
while
(
1
)
{
...
...
@@ -308,7 +352,7 @@ DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp)
{
SHFILEOPSTRUCTA
shfo
;
SHCreateDirectory
(
NULL
,
pTempTo
);
SHCreateDirectory
ExA
(
NULL
,
pTempTo
,
NULL
);
PathAddBackslashA
(
szTempFrom
);
strcat
(
szTempFrom
,
"*.*"
);
szTempFrom
[
strlen
(
szTempFrom
)
+
1
]
=
'\0'
;
...
...
@@ -343,7 +387,7 @@ DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp)
pFrom
+=
strlen
(
pFrom
)
+
1
;
}
}
else
{
while
(
1
)
{
while
(
1
)
{
if
(
!
pFrom
[
0
])
break
;
if
(
!
pTo
[
0
])
break
;
TRACE
(
" From='%s' To='%s'
\n
"
,
pFrom
,
pTo
);
...
...
@@ -354,7 +398,7 @@ DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp)
strcpy
(
pTempTo
,
pTo
);
PathRemoveFileSpecA
(
pTempTo
);
TRACE
(
" Creating Directory '%s'
\n
"
,
pTempTo
);
SHCreateDirectory
(
NULL
,
pTempTo
);
SHCreateDirectory
ExA
(
NULL
,
pTempTo
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
pTempTo
);
}
if
(
lpFileOp
->
wFunc
==
FO_COPY
)
...
...
@@ -480,6 +524,6 @@ BOOL WINAPI IsNetDrive(DWORD drive)
{
char
root
[
4
];
strcpy
(
root
,
"A:
\\
"
);
root
[
0
]
+=
drive
;
root
[
0
]
+=
(
char
)
drive
;
return
(
GetDriveTypeA
(
root
)
==
DRIVE_REMOTE
);
}
include/shlobj.h
View file @
d11efe88
...
...
@@ -498,6 +498,13 @@ VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
void
WINAPI
SHChangeNotify
(
LONG
wEventId
,
UINT
uFlags
,
LPCVOID
dwItem1
,
LPCVOID
dwItem2
);
/****************************************************************************
* SHCreateDirectory API
*/
DWORD
WINAPI
SHCreateDirectory
(
HWND
,
LPCVOID
);
DWORD
WINAPI
SHCreateDirectoryExA
(
HWND
,
LPCSTR
,
LPSECURITY_ATTRIBUTES
);
DWORD
WINAPI
SHCreateDirectoryExW
(
HWND
,
LPCWSTR
,
LPSECURITY_ATTRIBUTES
);
/****************************************************************************
* SHGetSpecialFolderLocation API
*/
HRESULT
WINAPI
SHGetSpecialFolderLocation
(
HWND
,
INT
,
LPITEMIDLIST
*
);
...
...
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