Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d9a27e9c
Commit
d9a27e9c
authored
May 12, 2015
by
Andrew Eikum
Committed by
Alexandre Julliard
May 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement CheckNameLegalDOS8Dot3.
parent
5f35f1a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
2 deletions
+126
-2
kernel32.spec
dlls/kernel32/kernel32.spec
+2
-2
path.c
dlls/kernel32/path.c
+49
-0
path.c
dlls/kernel32/tests/path.c
+73
-0
winbase.h
include/winbase.h
+2
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
d9a27e9c
...
...
@@ -218,8 +218,8 @@
# @ stub CheckElevation
# @ stub CheckElevationEnabled
# @ stub CheckForReadOnlyResource
# @ stub CheckNameLegalDOS8Dot3A
# @ stub CheckNameLegalDOS8Dot3W
@ stdcall CheckNameLegalDOS8Dot3A(str ptr long ptr ptr)
@ stdcall CheckNameLegalDOS8Dot3W(wstr ptr long ptr ptr)
@ stdcall CheckRemoteDebuggerPresent(long ptr)
@ stdcall ClearCommBreak(long)
@ stdcall ClearCommError(long ptr ptr)
...
...
dlls/kernel32/path.c
View file @
d9a27e9c
...
...
@@ -2012,3 +2012,52 @@ BOOL WINAPI CreateHardLinkTransactedW(LPCWSTR link, LPCWSTR target, LPSECURITY_A
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
}
/*************************************************************************
* CheckNameLegalDOS8Dot3A (KERNEL32.@)
*/
BOOL
WINAPI
CheckNameLegalDOS8Dot3A
(
const
char
*
name
,
char
*
oemname
,
DWORD
oemname_len
,
BOOL
*
contains_spaces
,
BOOL
*
is_legal
)
{
WCHAR
*
nameW
;
TRACE
(
"(%s %p %u %p %p)
\n
"
,
name
,
oemname
,
oemname_len
,
contains_spaces
,
is_legal
);
if
(
!
name
||
!
is_legal
)
return
FALSE
;
if
(
!
(
nameW
=
FILE_name_AtoW
(
name
,
FALSE
)))
return
FALSE
;
return
CheckNameLegalDOS8Dot3W
(
nameW
,
oemname
,
oemname_len
,
contains_spaces
,
is_legal
);
}
/*************************************************************************
* CheckNameLegalDOS8Dot3W (KERNEL32.@)
*/
BOOL
WINAPI
CheckNameLegalDOS8Dot3W
(
const
WCHAR
*
name
,
char
*
oemname
,
DWORD
oemname_len
,
BOOL
*
contains_spaces_ret
,
BOOL
*
is_legal
)
{
OEM_STRING
oem_str
;
UNICODE_STRING
nameW
;
BOOLEAN
contains_spaces
;
TRACE
(
"(%s %p %u %p %p)
\n
"
,
wine_dbgstr_w
(
name
),
oemname
,
oemname_len
,
contains_spaces_ret
,
is_legal
);
if
(
!
name
||
!
is_legal
)
return
FALSE
;
RtlInitUnicodeString
(
&
nameW
,
name
);
if
(
oemname
)
{
oem_str
.
Length
=
oemname_len
;
oem_str
.
MaximumLength
=
oemname_len
;
oem_str
.
Buffer
=
oemname
;
}
*
is_legal
=
RtlIsNameLegalDOS8Dot3
(
&
nameW
,
oemname
?
&
oem_str
:
NULL
,
&
contains_spaces
);
if
(
contains_spaces_ret
)
*
contains_spaces_ret
=
contains_spaces
;
return
TRUE
;
}
dlls/kernel32/tests/path.c
View file @
d9a27e9c
...
...
@@ -75,6 +75,9 @@ static BOOL (WINAPI *pDeactivateActCtx)(DWORD,ULONG_PTR);
static
BOOL
(
WINAPI
*
pGetCurrentActCtx
)(
HANDLE
*
);
static
void
(
WINAPI
*
pReleaseActCtx
)(
HANDLE
);
static
BOOL
(
WINAPI
*
pCheckNameLegalDOS8Dot3W
)(
const
WCHAR
*
,
char
*
,
DWORD
,
BOOL
*
,
BOOL
*
);
static
BOOL
(
WINAPI
*
pCheckNameLegalDOS8Dot3A
)(
const
char
*
,
char
*
,
DWORD
,
BOOL
*
,
BOOL
*
);
/* a structure to deal with wine todos somewhat cleanly */
typedef
struct
{
DWORD
shortlen
;
...
...
@@ -2058,6 +2061,8 @@ static void init_pointers(void)
MAKEFUNC
(
DeactivateActCtx
);
MAKEFUNC
(
GetCurrentActCtx
);
MAKEFUNC
(
ReleaseActCtx
);
MAKEFUNC
(
CheckNameLegalDOS8Dot3W
);
MAKEFUNC
(
CheckNameLegalDOS8Dot3A
);
#undef MAKEFUNC
}
...
...
@@ -2119,6 +2124,73 @@ static void test_relative_path(void)
RemoveDirectoryA
(
"bar"
);
}
static
void
test_CheckNameLegalDOS8Dot3
(
void
)
{
static
const
WCHAR
has_driveW
[]
=
{
'C'
,
':'
,
'\\'
,
'a'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
has_pathW
[]
=
{
'b'
,
'\\'
,
'a'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
too_longW
[]
=
{
'a'
,
'l'
,
'o'
,
'n'
,
'g'
,
'f'
,
'i'
,
'l'
,
'e'
,
'n'
,
'a'
,
'm'
,
'e'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
twodotsW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
longextW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
funnycharsW
[]
=
{
'!'
,
'#'
,
'$'
,
'%'
,
'&'
,
'\''
,
'('
,
')'
,
'.'
,
'-'
,
'@'
,
'^'
,
0
};
static
const
WCHAR
length8W
[]
=
{
't'
,
'e'
,
's'
,
't'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
WCHAR
length1W
[]
=
{
't'
,
0
};
static
const
WCHAR
withspaceW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
' '
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
static
const
struct
{
const
WCHAR
*
name
;
BOOL
should_be_legal
,
has_space
;
}
cases
[]
=
{
{
has_driveW
,
FALSE
,
FALSE
},
{
has_pathW
,
FALSE
,
FALSE
},
{
too_longW
,
FALSE
,
FALSE
},
{
twodotsW
,
FALSE
,
FALSE
},
{
longextW
,
FALSE
,
FALSE
},
{
emptyW
,
TRUE
/* ! */
,
FALSE
},
{
funnycharsW
,
TRUE
,
FALSE
},
{
length8W
,
TRUE
,
FALSE
},
{
length1W
,
TRUE
,
FALSE
},
{
withspaceW
,
TRUE
,
TRUE
},
};
BOOL
br
,
is_legal
,
has_space
;
char
astr
[
64
];
DWORD
i
;
if
(
!
pCheckNameLegalDOS8Dot3W
){
win_skip
(
"Missing CheckNameLegalDOS8Dot3, skipping tests
\n
"
);
return
;
}
br
=
pCheckNameLegalDOS8Dot3W
(
NULL
,
NULL
,
0
,
NULL
,
&
is_legal
);
ok
(
br
==
FALSE
,
"CheckNameLegalDOS8Dot3W should have failed
\n
"
);
br
=
pCheckNameLegalDOS8Dot3A
(
NULL
,
NULL
,
0
,
NULL
,
&
is_legal
);
ok
(
br
==
FALSE
,
"CheckNameLegalDOS8Dot3A should have failed
\n
"
);
br
=
pCheckNameLegalDOS8Dot3W
(
length8W
,
NULL
,
0
,
NULL
,
NULL
);
ok
(
br
==
FALSE
,
"CheckNameLegalDOS8Dot3W should have failed
\n
"
);
br
=
pCheckNameLegalDOS8Dot3A
(
"testtest.txt"
,
NULL
,
0
,
NULL
,
NULL
);
ok
(
br
==
FALSE
,
"CheckNameLegalDOS8Dot3A should have failed
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
cases
)
/
sizeof
(
*
cases
);
++
i
){
br
=
pCheckNameLegalDOS8Dot3W
(
cases
[
i
].
name
,
NULL
,
0
,
&
has_space
,
&
is_legal
);
ok
(
br
==
TRUE
,
"CheckNameLegalDOS8Dot3W failed for %s
\n
"
,
wine_dbgstr_w
(
cases
[
i
].
name
));
ok
(
is_legal
==
cases
[
i
].
should_be_legal
,
"Got wrong legality for %s
\n
"
,
wine_dbgstr_w
(
cases
[
i
].
name
));
if
(
is_legal
)
ok
(
has_space
==
cases
[
i
].
has_space
,
"Got wrong space for %s
\n
"
,
wine_dbgstr_w
(
cases
[
i
].
name
));
WideCharToMultiByte
(
CP_ACP
,
0
,
cases
[
i
].
name
,
-
1
,
astr
,
sizeof
(
astr
),
NULL
,
NULL
);
br
=
pCheckNameLegalDOS8Dot3A
(
astr
,
NULL
,
0
,
&
has_space
,
&
is_legal
);
ok
(
br
==
TRUE
,
"CheckNameLegalDOS8Dot3W failed for %s
\n
"
,
astr
);
ok
(
is_legal
==
cases
[
i
].
should_be_legal
,
"Got wrong legality for %s
\n
"
,
astr
);
if
(
is_legal
)
ok
(
has_space
==
cases
[
i
].
has_space
,
"Got wrong space for %s
\n
"
,
wine_dbgstr_w
(
cases
[
i
].
name
));
}
}
START_TEST
(
path
)
{
CHAR
origdir
[
MAX_PATH
],
curdir
[
MAX_PATH
],
curDrive
,
otherDrive
;
...
...
@@ -2151,4 +2223,5 @@ START_TEST(path)
test_SearchPathW
();
test_GetFullPathNameA
();
test_GetFullPathNameW
();
test_CheckNameLegalDOS8Dot3
();
}
include/winbase.h
View file @
d9a27e9c
...
...
@@ -1614,6 +1614,8 @@ WINBASEAPI BOOL WINAPI CancelIo(HANDLE);
WINBASEAPI
BOOL
WINAPI
CancelIoEx
(
HANDLE
,
LPOVERLAPPED
);
WINBASEAPI
BOOL
WINAPI
CancelTimerQueueTimer
(
HANDLE
,
HANDLE
);
WINBASEAPI
BOOL
WINAPI
CancelWaitableTimer
(
HANDLE
);
WINBASEAPI
BOOL
WINAPI
CheckNameLegalDOS8Dot3A
(
const
char
*
,
char
*
,
DWORD
,
BOOL
*
,
BOOL
*
);
WINBASEAPI
BOOL
WINAPI
CheckNameLegalDOS8Dot3W
(
const
WCHAR
*
,
char
*
,
DWORD
,
BOOL
*
,
BOOL
*
);
WINBASEAPI
BOOL
WINAPI
ChangeTimerQueueTimer
(
HANDLE
,
HANDLE
,
ULONG
,
ULONG
);
WINADVAPI
BOOL
WINAPI
CheckTokenMembership
(
HANDLE
,
PSID
,
PBOOL
);
WINBASEAPI
BOOL
WINAPI
ClearCommBreak
(
HANDLE
);
...
...
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