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
107f54ef
Commit
107f54ef
authored
Jun 20, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43b7995a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
44 deletions
+40
-44
Makefile.in
dlls/scrrun/Makefile.in
+2
-0
dictionary.c
dlls/scrrun/dictionary.c
+3
-6
filesystem.c
dlls/scrrun/filesystem.c
+35
-37
scrrun.c
dlls/scrrun/scrrun.c
+0
-1
No files found.
dlls/scrrun/Makefile.in
View file @
107f54ef
MODULE
=
scrrun.dll
IMPORTS
=
uuid oleaut32 version advapi32
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
dictionary.c
\
filesystem.c
\
...
...
dlls/scrrun/dictionary.c
View file @
107f54ef
...
...
@@ -18,10 +18,8 @@
*/
#define COBJMACROS
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -32,7 +30,6 @@
#include "scrrun_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/heap.h"
#include "wine/list.h"
...
...
@@ -125,7 +122,7 @@ static inline int strcmp_key(const dictionary *dict, const VARIANT *key1, const
str1
=
get_key_strptr
(
key1
);
str2
=
get_key_strptr
(
key2
);
return
dict
->
method
==
BinaryCompare
?
strcmpW
(
str1
,
str2
)
:
strcmpiW
(
str1
,
str2
);
return
dict
->
method
==
BinaryCompare
?
wcscmp
(
str1
,
str2
)
:
wcsicmp
(
str1
,
str2
);
}
static
BOOL
is_matching_key
(
const
dictionary
*
dict
,
const
struct
keyitem_pair
*
pair
,
const
VARIANT
*
key
,
DWORD
hash
)
...
...
@@ -754,7 +751,7 @@ static DWORD get_str_hash(const WCHAR *str, CompareMethod method)
while
(
*
str
)
{
WCHAR
ch
;
ch
=
(
method
==
TextCompare
||
method
==
DatabaseCompare
)
?
to
lowerW
(
*
str
)
:
*
str
;
ch
=
(
method
==
TextCompare
||
method
==
DatabaseCompare
)
?
to
wlower
(
*
str
)
:
*
str
;
hash
+=
(
hash
<<
4
)
+
ch
;
str
++
;
...
...
dlls/scrrun/filesystem.c
View file @
107f54ef
...
...
@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include <limits.h>
...
...
@@ -32,7 +31,6 @@
#include "scrrun_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
scrrun
);
...
...
@@ -205,8 +203,8 @@ static inline BOOL is_dir_data(const WIN32_FIND_DATAW *data)
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
return
(
data
->
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
&&
strcmpW
(
data
->
cFileName
,
dotdotW
)
&&
strcmpW
(
data
->
cFileName
,
dotW
);
wcscmp
(
data
->
cFileName
,
dotdotW
)
&&
wcscmp
(
data
->
cFileName
,
dotW
);
}
static
inline
BOOL
is_file_data
(
const
WIN32_FIND_DATAW
*
data
)
...
...
@@ -219,10 +217,10 @@ static BSTR get_full_path(BSTR path, const WIN32_FIND_DATAW *data)
int
len
=
SysStringLen
(
path
);
WCHAR
buffW
[
MAX_PATH
];
strcpyW
(
buffW
,
path
);
l
strcpyW
(
buffW
,
path
);
if
(
path
[
len
-
1
]
!=
'\\'
)
strcatW
(
buffW
,
bsW
);
strcatW
(
buffW
,
data
->
cFileName
);
l
strcatW
(
buffW
,
bsW
);
l
strcatW
(
buffW
,
data
->
cFileName
);
return
SysAllocString
(
buffW
);
}
...
...
@@ -1165,11 +1163,11 @@ static HANDLE start_enumeration(const WCHAR *path, WIN32_FIND_DATAW *data, BOOL
int
len
;
HANDLE
handle
;
strcpyW
(
pathW
,
path
);
len
=
strlenW
(
pathW
);
l
strcpyW
(
pathW
,
path
);
len
=
l
strlenW
(
pathW
);
if
(
len
&&
pathW
[
len
-
1
]
!=
'\\'
)
strcatW
(
pathW
,
bsW
);
strcatW
(
pathW
,
allW
);
l
strcatW
(
pathW
,
bsW
);
l
strcatW
(
pathW
,
allW
);
handle
=
FindFirstFileW
(
pathW
,
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
0
;
...
...
@@ -1738,8 +1736,8 @@ static HRESULT WINAPI foldercoll_get_Count(IFolderCollection *iface, LONG *count
*
count
=
0
;
strcpyW
(
pathW
,
This
->
path
);
strcatW
(
pathW
,
allW
);
l
strcpyW
(
pathW
,
This
->
path
);
l
strcatW
(
pathW
,
allW
);
handle
=
FindFirstFileW
(
pathW
,
&
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
...
...
@@ -1933,8 +1931,8 @@ static HRESULT WINAPI filecoll_get_Count(IFileCollection *iface, LONG *count)
*
count
=
0
;
strcpyW
(
pathW
,
This
->
path
);
strcatW
(
pathW
,
allW
);
l
strcpyW
(
pathW
,
This
->
path
);
l
strcatW
(
pathW
,
allW
);
handle
=
FindFirstFileW
(
pathW
,
&
data
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
...
...
@@ -2287,7 +2285,7 @@ static HRESULT WINAPI folder_get_Name(IFolder *iface, BSTR *name)
*
name
=
NULL
;
ptr
=
strrchrW
(
This
->
path
,
'\\'
);
ptr
=
wcsrchr
(
This
->
path
,
'\\'
);
if
(
ptr
)
{
*
name
=
SysAllocString
(
ptr
+
1
);
...
...
@@ -2637,7 +2635,7 @@ static HRESULT WINAPI file_get_Name(IFile *iface, BSTR *name)
*
name
=
NULL
;
ptr
=
strrchrW
(
This
->
path
,
'\\'
);
ptr
=
wcsrchr
(
This
->
path
,
'\\'
);
if
(
ptr
)
{
*
name
=
SysAllocString
(
ptr
+
1
);
...
...
@@ -3031,9 +3029,9 @@ static HRESULT WINAPI filesys_BuildPath(IFileSystem3 *iface, BSTR Path,
ret
=
SysAllocStringLen
(
NULL
,
path_len
+
name_len
);
if
(
ret
)
{
strcpyW
(
ret
,
Path
);
l
strcpyW
(
ret
,
Path
);
ret
[
path_len
]
=
0
;
strcatW
(
ret
,
Name
);
l
strcatW
(
ret
,
Name
);
}
}
else
if
(
Path
[
path_len
-
1
]
!=
'\\'
&&
Name
[
0
]
!=
'\\'
)
...
...
@@ -3041,10 +3039,10 @@ static HRESULT WINAPI filesys_BuildPath(IFileSystem3 *iface, BSTR Path,
ret
=
SysAllocStringLen
(
NULL
,
path_len
+
name_len
+
1
);
if
(
ret
)
{
strcpyW
(
ret
,
Path
);
l
strcpyW
(
ret
,
Path
);
if
(
Path
[
path_len
-
1
]
!=
':'
)
strcatW
(
ret
,
bsW
);
strcatW
(
ret
,
Name
);
l
strcatW
(
ret
,
bsW
);
l
strcatW
(
ret
,
Name
);
}
}
else
...
...
@@ -3052,8 +3050,8 @@ static HRESULT WINAPI filesys_BuildPath(IFileSystem3 *iface, BSTR Path,
ret
=
SysAllocStringLen
(
NULL
,
path_len
+
name_len
);
if
(
ret
)
{
strcpyW
(
ret
,
Path
);
strcatW
(
ret
,
Name
);
l
strcpyW
(
ret
,
Path
);
l
strcatW
(
ret
,
Name
);
}
}
}
...
...
@@ -3077,7 +3075,7 @@ static HRESULT WINAPI filesys_GetDriveName(IFileSystem3 *iface, BSTR path, BSTR
*
drive
=
NULL
;
if
(
path
&&
strlenW
(
path
)
>
1
&&
path
[
1
]
==
':'
)
if
(
path
&&
l
strlenW
(
path
)
>
1
&&
path
[
1
]
==
':'
)
*
drive
=
SysAllocStringLen
(
path
,
2
);
return
S_OK
;
...
...
@@ -3147,7 +3145,7 @@ static HRESULT WINAPI filesys_GetFileName(IFileSystem3 *iface, BSTR Path,
return
S_OK
;
}
for
(
end
=
strlenW
(
Path
)
-
1
;
end
>=
0
;
end
--
)
for
(
end
=
l
strlenW
(
Path
)
-
1
;
end
>=
0
;
end
--
)
if
(
Path
[
end
]
!=
'/'
&&
Path
[
end
]
!=
'\\'
)
break
;
...
...
@@ -3182,7 +3180,7 @@ static HRESULT WINAPI filesys_GetBaseName(IFileSystem3 *iface, BSTR Path,
return
S_OK
;
}
for
(
end
=
strlenW
(
Path
)
-
1
;
end
>=
0
;
end
--
)
for
(
end
=
l
strlenW
(
Path
)
-
1
;
end
>=
0
;
end
--
)
if
(
Path
[
end
]
!=
'/'
&&
Path
[
end
]
!=
'\\'
)
break
;
...
...
@@ -3252,7 +3250,7 @@ static HRESULT WINAPI filesys_GetAbsolutePathName(IFileSystem3 *iface, BSTR Path
if
(
!
len
)
return
E_FAIL
;
buf
[
0
]
=
to
upperW
(
buf
[
0
]);
buf
[
0
]
=
to
wupper
(
buf
[
0
]);
if
(
len
>
3
&&
buf
[
len
-
1
]
==
'\\'
)
buf
[
--
len
]
=
0
;
...
...
@@ -3266,7 +3264,7 @@ static HRESULT WINAPI filesys_GetAbsolutePathName(IFileSystem3 *iface, BSTR Path
if
(
fh
==
INVALID_HANDLE_VALUE
)
break
;
exp_len
=
strlenW
(
fdata
.
cFileName
);
exp_len
=
l
strlenW
(
fdata
.
cFileName
);
if
(
exp_len
==
i
-
beg
)
memcpy
(
buf
+
beg
,
fdata
.
cFileName
,
exp_len
*
sizeof
(
WCHAR
));
FindClose
(
fh
);
...
...
@@ -3297,7 +3295,7 @@ static HRESULT WINAPI filesys_GetTempName(IFileSystem3 *iface, BSTR *pbstrResult
if
(
!
RtlGenRandom
(
&
random
,
sizeof
(
random
)))
return
E_FAIL
;
s
printfW
(
*
pbstrResult
,
fmt
,
random
&
0xfffff
);
s
wprintf
(
*
pbstrResult
,
12
,
fmt
,
random
&
0xfffff
);
return
S_OK
;
}
...
...
@@ -3314,7 +3312,7 @@ static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec,
len
=
SysStringLen
(
DriveSpec
);
if
(
len
>=
1
)
{
driveletter
=
to
upperW
(
DriveSpec
[
0
]);
driveletter
=
to
wupper
(
DriveSpec
[
0
]);
if
(
driveletter
>=
'A'
&&
driveletter
<=
'Z'
&&
(
len
<
2
||
DriveSpec
[
1
]
==
':'
)
&&
(
len
<
3
||
DriveSpec
[
2
]
==
'\\'
))
{
...
...
@@ -3372,7 +3370,7 @@ static HRESULT WINAPI filesys_GetDrive(IFileSystem3 *iface, BSTR DriveSpec,
if
(
!
len
)
return
E_INVALIDARG
;
else
if
(
len
<=
3
)
{
driveletter
=
to
upperW
(
DriveSpec
[
0
]);
driveletter
=
to
wupper
(
DriveSpec
[
0
]);
if
(
driveletter
<
'A'
||
driveletter
>
'Z'
||
(
len
>=
2
&&
DriveSpec
[
1
]
!=
':'
)
||
(
len
==
3
&&
DriveSpec
[
2
]
!=
'\\'
))
...
...
@@ -3489,7 +3487,7 @@ static inline HRESULT delete_file(const WCHAR *file, DWORD file_len, VARIANT_BOO
if
(
ffd
.
dwFileAttributes
&
(
FILE_ATTRIBUTE_DIRECTORY
|
FILE_ATTRIBUTE_DEVICE
))
continue
;
name_len
=
strlenW
(
ffd
.
cFileName
);
name_len
=
l
strlenW
(
ffd
.
cFileName
);
if
(
len
+
name_len
+
1
>=
MAX_PATH
)
{
FindClose
(
f
);
return
E_FAIL
;
...
...
@@ -3551,7 +3549,7 @@ static HRESULT delete_folder(const WCHAR *folder, DWORD folder_len, VARIANT_BOOL
(
ffd
.
cFileName
[
1
]
==
'.'
&&
ffd
.
cFileName
[
2
]
==
0
)))
continue
;
name_len
=
strlenW
(
ffd
.
cFileName
);
name_len
=
l
strlenW
(
ffd
.
cFileName
);
if
(
len
+
name_len
+
3
>=
MAX_PATH
)
{
FindClose
(
f
);
return
E_FAIL
;
...
...
@@ -3667,7 +3665,7 @@ static inline HRESULT copy_file(const WCHAR *source, DWORD source_len,
if
(
ffd
.
dwFileAttributes
&
(
FILE_ATTRIBUTE_DIRECTORY
|
FILE_ATTRIBUTE_DEVICE
))
continue
;
name_len
=
strlenW
(
ffd
.
cFileName
);
name_len
=
l
strlenW
(
ffd
.
cFileName
);
if
(
src_len
+
name_len
+
1
>=
MAX_PATH
||
dst_len
+
name_len
+
1
>=
MAX_PATH
)
{
FindClose
(
f
);
return
E_FAIL
;
...
...
@@ -3769,7 +3767,7 @@ static HRESULT copy_folder(const WCHAR *source, DWORD source_len, const WCHAR *d
(
ffd
.
cFileName
[
1
]
==
'.'
&&
ffd
.
cFileName
[
2
]
==
0
)))
continue
;
name_len
=
strlenW
(
ffd
.
cFileName
);
name_len
=
l
strlenW
(
ffd
.
cFileName
);
if
(
dst_len
+
name_len
>=
MAX_PATH
||
src_len
+
name_len
+
2
>=
MAX_PATH
)
{
FindClose
(
f
);
return
E_FAIL
;
...
...
@@ -3895,7 +3893,7 @@ static void get_versionstring(VS_FIXEDFILEINFO *info, WCHAR *ver)
c
=
(
WORD
)((
version
>>
16
)
&
0xffff
);
d
=
(
WORD
)(
version
&
0xffff
);
s
printfW
(
ver
,
fmtW
,
a
,
b
,
c
,
d
);
s
wprintf
(
ver
,
30
,
fmtW
,
a
,
b
,
c
,
d
);
}
static
HRESULT
WINAPI
filesys_GetFileVersion
(
IFileSystem3
*
iface
,
BSTR
name
,
BSTR
*
version
)
...
...
dlls/scrrun/scrrun.c
View file @
107f54ef
...
...
@@ -17,7 +17,6 @@
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
...
...
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