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
79b00726
Commit
79b00726
authored
Dec 09, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Use the explicit name for all A/W function.
parent
c09ac7a4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
38 deletions
+36
-38
Makefile.in
programs/cmd/Makefile.in
+1
-1
batch.c
programs/cmd/batch.c
+11
-13
builtins.c
programs/cmd/builtins.c
+0
-0
directory.c
programs/cmd/directory.c
+24
-24
wcmdmain.c
programs/cmd/wcmdmain.c
+0
-0
No files found.
programs/cmd/Makefile.in
View file @
79b00726
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
cmd.exe
APPMODE
=
-mconsole
-municode
EXTRADEFS
=
-D
UNICODE
EXTRADEFS
=
-D
WINE_NO_UNICODE_MACROS
IMPORTS
=
shell32 user32 advapi32 kernel32
C_SRCS
=
\
...
...
programs/cmd/batch.c
View file @
79b00726
...
...
@@ -61,16 +61,16 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
for
(
i
=
0
;
(
i
<
sizeof
(
extension_batch
)
/
(
WCMD_BATCH_EXT_SIZE
*
sizeof
(
WCHAR
)))
&&
(
h
==
INVALID_HANDLE_VALUE
);
i
++
)
{
strcpyW
(
string
,
file
);
CharLower
(
string
);
CharLower
W
(
string
);
if
(
strstrW
(
string
,
extension_batch
[
i
])
==
NULL
)
strcatW
(
string
,
extension_batch
[
i
]);
h
=
CreateFile
(
string
,
GENERIC_READ
,
FILE_SHARE_READ
,
h
=
CreateFile
W
(
string
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
}
if
(
h
==
INVALID_HANDLE_VALUE
)
{
strcpyW
(
string
,
file
);
CharLower
(
string
);
CharLower
W
(
string
);
if
(
strstrW
(
string
,
extension_exe
)
==
NULL
)
strcatW
(
string
,
extension_exe
);
if
(
GetFileAttributes
(
string
)
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
GetFileAttributes
W
(
string
)
!=
INVALID_FILE_ATTRIBUTES
)
{
WCMD_run_program
(
command
,
0
);
}
else
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
...
...
@@ -425,9 +425,8 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
env
[(
end
-
start
)]
=
0x00
;
/* If env var not found, return empty string */
if
((
GetEnvironmentVariable
(
env
,
fullpath
,
MAX_PATH
)
==
0
)
||
(
SearchPath
(
fullpath
,
outputparam
,
NULL
,
MAX_PATH
,
outputparam
,
NULL
)
==
0
))
{
if
((
GetEnvironmentVariableW
(
env
,
fullpath
,
MAX_PATH
)
==
0
)
||
(
SearchPathW
(
fullpath
,
outputparam
,
NULL
,
MAX_PATH
,
outputparam
,
NULL
)
==
0
))
{
finaloutput
[
0
]
=
0x00
;
outputparam
[
0
]
=
0x00
;
skipFileParsing
=
TRUE
;
...
...
@@ -437,7 +436,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
/* After this, we need full information on the file,
which is valid not to exist. */
if
(
!
skipFileParsing
)
{
if
(
GetFullPathName
(
outputparam
,
MAX_PATH
,
fullfilename
,
NULL
)
==
0
)
if
(
GetFullPathName
W
(
outputparam
,
MAX_PATH
,
fullfilename
,
NULL
)
==
0
)
return
;
exists
=
GetFileAttributesExW
(
fullfilename
,
GetFileExInfoStandard
,
...
...
@@ -480,11 +479,11 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
/* Format the time */
FileTimeToSystemTime
(
&
fileInfo
.
ftLastWriteTime
,
&
systime
);
GetDateFormat
(
LOCALE_USER_DEFAULT
,
DATE_SHORTDATE
,
&
systime
,
GetDateFormat
W
(
LOCALE_USER_DEFAULT
,
DATE_SHORTDATE
,
&
systime
,
NULL
,
thisoutput
,
MAX_PATH
);
strcatW
(
thisoutput
,
space
);
datelen
=
strlenW
(
thisoutput
);
GetTimeFormat
(
LOCALE_USER_DEFAULT
,
TIME_NOSECONDS
,
&
systime
,
GetTimeFormat
W
(
LOCALE_USER_DEFAULT
,
TIME_NOSECONDS
,
&
systime
,
NULL
,
(
thisoutput
+
datelen
),
MAX_PATH
-
datelen
);
strcatW
(
finaloutput
,
thisoutput
);
}
...
...
@@ -499,7 +498,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
doneModifier
=
TRUE
;
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
wsprintf
(
thisoutput
,
fmt
,
fullsize
);
wsprintf
W
(
thisoutput
,
fmt
,
fullsize
);
strcatW
(
finaloutput
,
thisoutput
);
}
...
...
@@ -507,8 +506,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
if
(
memchrW
(
firstModifier
,
's'
,
modifierLen
)
!=
NULL
)
{
if
(
finaloutput
[
0
]
!=
0x00
)
strcatW
(
finaloutput
,
space
);
/* Don't flag as doneModifier - %~s on its own is processed later */
GetShortPathName
(
outputparam
,
outputparam
,
sizeof
(
outputparam
)
/
sizeof
(
outputparam
[
0
]));
GetShortPathNameW
(
outputparam
,
outputparam
,
sizeof
(
outputparam
)
/
sizeof
(
outputparam
[
0
]));
}
/* 5. Handle 'f' : Fully qualified path (File doesn't have to exist) */
...
...
programs/cmd/builtins.c
View file @
79b00726
This diff is collapsed.
Click to expand it.
programs/cmd/directory.c
View file @
79b00726
...
...
@@ -123,8 +123,8 @@ static WCHAR * WCMD_filesize64 (ULONGLONG n) {
*/
static
int
WCMD_dir_sort
(
const
void
*
a
,
const
void
*
b
)
{
WIN32_FIND_DATA
*
filea
=
(
WIN32_FIND_DATA
*
)
a
;
WIN32_FIND_DATA
*
fileb
=
(
WIN32_FIND_DATA
*
)
b
;
WIN32_FIND_DATA
W
*
filea
=
(
WIN32_FIND_DATAW
*
)
a
;
WIN32_FIND_DATA
W
*
fileb
=
(
WIN32_FIND_DATAW
*
)
b
;
int
result
=
0
;
/* If /OG or /O-G supplied, dirs go at the top or bottom, ignoring the
...
...
@@ -211,7 +211,7 @@ static void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) {
*
owner
=
0x00
;
/* Find out how much space we need for the owner security descriptor */
GetFileSecurity
(
filename
,
OWNER_SECURITY_INFORMATION
,
0
,
0
,
&
sizeNeeded
);
GetFileSecurity
W
(
filename
,
OWNER_SECURITY_INFORMATION
,
0
,
0
,
&
sizeNeeded
);
rc
=
GetLastError
();
if
(
rc
==
ERROR_INSUFFICIENT_BUFFER
&&
sizeNeeded
>
0
)
{
...
...
@@ -227,7 +227,7 @@ static void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) {
if
(
!
secBuffer
)
return
;
/* Get the owners security descriptor */
if
(
!
GetFileSecurity
(
filename
,
OWNER_SECURITY_INFORMATION
,
secBuffer
,
if
(
!
GetFileSecurity
W
(
filename
,
OWNER_SECURITY_INFORMATION
,
secBuffer
,
sizeNeeded
,
&
sizeNeeded
))
{
HeapFree
(
GetProcessHeap
(),
0
,
secBuffer
);
return
;
...
...
@@ -240,7 +240,7 @@ static void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) {
}
/* Convert to a username */
if
(
LookupAccountSid
(
NULL
,
pSID
,
name
,
&
nameLen
,
domain
,
&
domainLen
,
&
nameuse
))
{
if
(
LookupAccountSid
W
(
NULL
,
pSID
,
name
,
&
nameLen
,
domain
,
&
domainLen
,
&
nameuse
))
{
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'%'
,
'c'
,
'%'
,
's'
,
'\0'
};
snprintfW
(
owner
,
ownerlen
,
fmt
,
domain
,
'\\'
,
name
);
}
...
...
@@ -262,7 +262,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
WCHAR
string
[
1024
],
datestring
[
32
],
timestring
[
32
];
WCHAR
real_path
[
MAX_PATH
];
WIN32_FIND_DATA
*
fd
;
WIN32_FIND_DATA
W
*
fd
;
FILETIME
ft
;
SYSTEMTIME
st
;
HANDLE
hff
;
...
...
@@ -294,7 +294,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
same directory. Note issuing a directory header with no contents
mirrors what windows does */
parms
=
inputparms
;
fd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WIN32_FIND_DATA
));
fd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WIN32_FIND_DATA
W
));
while
(
parms
&&
strcmpW
(
inputparms
->
dirName
,
parms
->
dirName
)
==
0
)
{
concurrentDirs
++
;
...
...
@@ -304,7 +304,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
/* Load all files into an in memory structure */
WINE_TRACE
(
"Looking for matches to '%s'
\n
"
,
wine_dbgstr_w
(
real_path
));
hff
=
FindFirstFile
(
real_path
,
(
fd
+
entry_count
));
hff
=
FindFirstFile
W
(
real_path
,
(
fd
+
entry_count
));
if
(
hff
!=
INVALID_HANDLE_VALUE
)
{
do
{
/* Skip any which are filtered out by attribute */
...
...
@@ -319,14 +319,14 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
if
(
tmpLen
>
widest
)
widest
=
tmpLen
;
}
fd
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
fd
,(
entry_count
+
1
)
*
sizeof
(
WIN32_FIND_DATA
));
fd
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
fd
,(
entry_count
+
1
)
*
sizeof
(
WIN32_FIND_DATA
W
));
if
(
fd
==
NULL
)
{
FindClose
(
hff
);
WINE_ERR
(
"Out of memory
\n
"
);
errorlevel
=
1
;
return
parms
->
next
;
}
}
while
(
FindNextFile
(
hff
,
(
fd
+
entry_count
))
!=
0
);
}
while
(
FindNextFile
W
(
hff
,
(
fd
+
entry_count
))
!=
0
);
FindClose
(
hff
);
}
...
...
@@ -353,7 +353,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
if
(
entry_count
>
0
)
{
/* Sort the list of files */
qsort
(
fd
,
entry_count
,
sizeof
(
WIN32_FIND_DATA
),
WCMD_dir_sort
);
qsort
(
fd
,
entry_count
,
sizeof
(
WIN32_FIND_DATA
W
),
WCMD_dir_sort
);
/* Work out the number of columns */
WINE_TRACE
(
"%d entries, maxwidth=%d, widest=%d
\n
"
,
entry_count
,
max_width
,
widest
);
...
...
@@ -402,9 +402,9 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
FileTimeToLocalFileTime
(
&
(
fd
+
i
)
->
ftCreationTime
,
&
ft
);
}
FileTimeToSystemTime
(
&
ft
,
&
st
);
GetDateFormat
(
0
,
DATE_SHORTDATE
,
&
st
,
NULL
,
datestring
,
GetDateFormat
W
(
0
,
DATE_SHORTDATE
,
&
st
,
NULL
,
datestring
,
sizeof
(
datestring
)
/
sizeof
(
WCHAR
));
GetTimeFormat
(
0
,
TIME_NOSECONDS
,
&
st
,
GetTimeFormat
W
(
0
,
TIME_NOSECONDS
,
&
st
,
NULL
,
timestring
,
sizeof
(
timestring
)
/
sizeof
(
WCHAR
));
if
(
wide
)
{
...
...
@@ -520,14 +520,14 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
if
(
recurse
)
{
DIRECTORY_STACK
*
dirStack
=
NULL
;
DIRECTORY_STACK
*
lastEntry
=
NULL
;
WIN32_FIND_DATA
finddata
;
WIN32_FIND_DATA
W
finddata
;
/* Build path to search */
strcpyW
(
string
,
inputparms
->
dirName
);
strcatW
(
string
,
starW
);
WINE_TRACE
(
"Recursive, looking for '%s'
\n
"
,
wine_dbgstr_w
(
string
));
hff
=
FindFirstFile
(
string
,
&
finddata
);
hff
=
FindFirstFile
W
(
string
,
&
finddata
);
if
(
hff
!=
INVALID_HANDLE_VALUE
)
{
do
{
if
((
finddata
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
&&
...
...
@@ -563,7 +563,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
parms
=
parms
->
next
;
}
}
}
while
(
FindNextFile
(
hff
,
&
finddata
)
!=
0
);
}
while
(
FindNextFile
W
(
hff
,
&
finddata
)
!=
0
);
FindClose
(
hff
);
while
(
dirStack
!=
NULL
)
{
...
...
@@ -601,7 +601,7 @@ static void WCMD_dir_trailer(WCHAR drive) {
WCHAR
driveName
[
4
]
=
{
'c'
,
':'
,
'\\'
,
'\0'
};
driveName
[
0
]
=
drive
;
status
=
GetDiskFreeSpaceEx
(
driveName
,
&
avail
,
&
total
,
&
freebytes
);
status
=
GetDiskFreeSpaceEx
W
(
driveName
,
&
avail
,
&
total
,
&
freebytes
);
WINE_TRACE
(
"Writing trailer for '%s' gave %d(%d)
\n
"
,
wine_dbgstr_w
(
driveName
),
status
,
GetLastError
());
...
...
@@ -654,7 +654,7 @@ void WCMD_directory (WCHAR *cmd) {
errorlevel
=
0
;
/* Prefill quals with (uppercased) DIRCMD env var */
if
(
GetEnvironmentVariable
(
dircmdW
,
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
)))
{
if
(
GetEnvironmentVariable
W
(
dircmdW
,
string
,
sizeof
(
string
)
/
sizeof
(
WCHAR
)))
{
p
=
string
;
while
(
(
*
p
=
toupper
(
*
p
))
)
++
p
;
strcatW
(
string
,
quals
);
...
...
@@ -833,7 +833,7 @@ void WCMD_directory (WCHAR *cmd) {
argno
=
0
;
argsProcessed
=
0
;
argN
=
cmd
;
GetCurrentDirectory
(
MAX_PATH
,
cwd
);
GetCurrentDirectory
W
(
MAX_PATH
,
cwd
);
strcatW
(
cwd
,
slashW
);
/* Loop through all args, calculating full effective directory */
...
...
@@ -850,10 +850,10 @@ void WCMD_directory (WCHAR *cmd) {
}
else
if
(
thisArg
[
1
]
==
':'
&&
thisArg
[
2
]
!=
'\\'
)
{
WCHAR
envvar
[
4
];
static
const
WCHAR
envFmt
[]
=
{
'='
,
'%'
,
'c'
,
':'
,
'\0'
};
wsprintf
(
envvar
,
envFmt
,
thisArg
[
0
]);
if
(
!
GetEnvironmentVariable
(
envvar
,
fullname
,
MAX_PATH
))
{
wsprintf
W
(
envvar
,
envFmt
,
thisArg
[
0
]);
if
(
!
GetEnvironmentVariable
W
(
envvar
,
fullname
,
MAX_PATH
))
{
static
const
WCHAR
noEnvFmt
[]
=
{
'%'
,
'c'
,
':'
,
'\0'
};
wsprintf
(
fullname
,
noEnvFmt
,
thisArg
[
0
]);
wsprintf
W
(
fullname
,
noEnvFmt
,
thisArg
[
0
]);
}
strcatW
(
fullname
,
slashW
);
strcatW
(
fullname
,
&
thisArg
[
2
]);
...
...
@@ -866,7 +866,7 @@ void WCMD_directory (WCHAR *cmd) {
}
WINE_TRACE
(
"Using location '%s'
\n
"
,
wine_dbgstr_w
(
fullname
));
status
=
GetFullPathName
(
fullname
,
sizeof
(
path
)
/
sizeof
(
WCHAR
),
path
,
NULL
);
status
=
GetFullPathName
W
(
fullname
,
sizeof
(
path
)
/
sizeof
(
WCHAR
),
path
,
NULL
);
/*
* If the path supplied does not include a wildcard, and the endpoint of the
...
...
@@ -874,7 +874,7 @@ void WCMD_directory (WCHAR *cmd) {
* directory not the directory file itself.
*/
if
((
strchrW
(
path
,
'*'
)
==
NULL
)
&&
(
strchrW
(
path
,
'%'
)
==
NULL
))
{
status
=
GetFileAttributes
(
path
);
status
=
GetFileAttributes
W
(
path
);
if
((
status
!=
INVALID_FILE_ATTRIBUTES
)
&&
(
status
&
FILE_ATTRIBUTE_DIRECTORY
))
{
if
(
path
[
strlenW
(
path
)
-
1
]
==
'\\'
)
{
strcatW
(
path
,
starW
);
...
...
programs/cmd/wcmdmain.c
View file @
79b00726
This diff is collapsed.
Click to expand it.
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