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
7918c59f
Commit
7918c59f
authored
Jan 07, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add a stub implementation for GetVolumeNameForVolumeMountPoint{A, W}.
parent
a7c99707
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
6 deletions
+83
-6
kernel32.spec
dlls/kernel32/kernel32.spec
+2
-2
volume.c
dlls/kernel32/tests/volume.c
+44
-0
volume.c
dlls/kernel32/volume.c
+37
-4
No files found.
dlls/kernel32/kernel32.spec
View file @
7918c59f
...
@@ -649,8 +649,8 @@
...
@@ -649,8 +649,8 @@
@ stdcall GetVersionExW(ptr)
@ stdcall GetVersionExW(ptr)
@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long)
@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long)
@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long)
@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long)
@ st
ub GetVolumeNameForVolumeMountPointA
@ st
dcall GetVolumeNameForVolumeMountPointA(str ptr long)
@ stdcall GetVolumeNameForVolumeMountPointW(wstr
long
long)
@ stdcall GetVolumeNameForVolumeMountPointW(wstr
ptr
long)
@ stdcall GetVolumePathNameA(str ptr long)
@ stdcall GetVolumePathNameA(str ptr long)
@ stdcall GetVolumePathNameW(wstr ptr long)
@ stdcall GetVolumePathNameW(wstr ptr long)
# @ stub GetVolumePathNamesForVolumeNameA
# @ stub GetVolumePathNamesForVolumeNameA
...
...
dlls/kernel32/tests/volume.c
View file @
7918c59f
...
@@ -45,7 +45,51 @@ static void test_query_dos_deviceA(void)
...
@@ -45,7 +45,51 @@ static void test_query_dos_deviceA(void)
}
}
}
}
static
void
test_GetVolumeNameForVolumeMountPointA
(
void
)
{
BOOL
ret
;
char
volume
[
MAX_PATH
],
path
[]
=
"c:
\\
"
;
DWORD
len
=
sizeof
(
volume
);
ret
=
GetVolumeNameForVolumeMountPointA
(
path
,
volume
,
0
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointA succeeded
\n
"
);
if
(
0
)
{
/* these crash on XP */
ret
=
GetVolumeNameForVolumeMountPointA
(
path
,
NULL
,
len
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointA succeeded
\n
"
);
ret
=
GetVolumeNameForVolumeMountPointA
(
NULL
,
volume
,
len
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointA succeeded
\n
"
);
}
ret
=
GetVolumeNameForVolumeMountPointA
(
path
,
volume
,
len
);
ok
(
ret
==
TRUE
,
"GetVolumeNameForVolumeMountPointA failed
\n
"
);
}
static
void
test_GetVolumeNameForVolumeMountPointW
(
void
)
{
BOOL
ret
;
WCHAR
volume
[
MAX_PATH
],
path
[]
=
{
'c'
,
':'
,
'\\'
,
0
};
DWORD
len
=
sizeof
(
volume
)
/
sizeof
(
WCHAR
);
ret
=
GetVolumeNameForVolumeMountPointW
(
path
,
volume
,
0
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointA succeeded
\n
"
);
if
(
0
)
{
/* these crash on XP */
ret
=
GetVolumeNameForVolumeMountPointW
(
path
,
NULL
,
len
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointW succeeded
\n
"
);
ret
=
GetVolumeNameForVolumeMountPointW
(
NULL
,
volume
,
len
);
ok
(
ret
==
FALSE
,
"GetVolumeNameForVolumeMountPointW succeeded
\n
"
);
}
ret
=
GetVolumeNameForVolumeMountPointW
(
path
,
volume
,
len
);
ok
(
ret
==
TRUE
,
"GetVolumeNameForVolumeMountPointW failed
\n
"
);
}
START_TEST
(
volume
)
START_TEST
(
volume
)
{
{
test_query_dos_deviceA
();
test_query_dos_deviceA
();
test_GetVolumeNameForVolumeMountPointA
();
test_GetVolumeNameForVolumeMountPointW
();
}
}
dlls/kernel32/volume.c
View file @
7918c59f
...
@@ -748,14 +748,47 @@ BOOL WINAPI SetVolumeLabelA(LPCSTR root, LPCSTR volname)
...
@@ -748,14 +748,47 @@ BOOL WINAPI SetVolumeLabelA(LPCSTR root, LPCSTR volname)
/***********************************************************************
/***********************************************************************
* GetVolumeNameForVolumeMountPoint
W
(KERNEL32.@)
* GetVolumeNameForVolumeMountPoint
A
(KERNEL32.@)
*/
*/
BOOL
WINAPI
GetVolumeNameForVolumeMountPoint
W
(
LPCWSTR
str
,
LPWSTR
dst
,
DWORD
size
)
BOOL
WINAPI
GetVolumeNameForVolumeMountPoint
A
(
LPCSTR
path
,
LPSTR
volume
,
DWORD
size
)
{
{
FIXME
(
"(%s, %p, %x): stub
\n
"
,
debugstr_w
(
str
),
dst
,
size
);
BOOL
ret
;
return
0
;
WCHAR
volumeW
[
50
],
*
pathW
=
NULL
;
DWORD
len
=
min
(
sizeof
(
volumeW
)
/
sizeof
(
WCHAR
),
size
);
TRACE
(
"(%s, %p, %x)
\n
"
,
debugstr_a
(
path
),
volume
,
size
);
if
(
!
path
||
!
(
pathW
=
FILE_name_AtoW
(
path
,
TRUE
)))
return
FALSE
;
if
((
ret
=
GetVolumeNameForVolumeMountPointW
(
pathW
,
volumeW
,
len
)))
FILE_name_WtoA
(
volumeW
,
-
1
,
volume
,
len
);
HeapFree
(
GetProcessHeap
(),
0
,
pathW
);
return
ret
;
}
}
/***********************************************************************
* GetVolumeNameForVolumeMountPointW (KERNEL32.@)
*/
BOOL
WINAPI
GetVolumeNameForVolumeMountPointW
(
LPCWSTR
path
,
LPWSTR
volume
,
DWORD
size
)
{
BOOL
ret
=
FALSE
;
static
const
WCHAR
fmt
[]
=
{
'\\'
,
'\\'
,
'?'
,
'\\'
,
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'{'
,
'%'
,
'0'
,
'2'
,
'x'
,
'}'
,
'\\'
,
0
};
TRACE
(
"(%s, %p, %x)
\n
"
,
debugstr_w
(
path
),
volume
,
size
);
if
(
!
path
||
!
path
[
0
])
return
FALSE
;
if
(
size
>=
sizeof
(
fmt
)
/
sizeof
(
WCHAR
))
{
/* FIXME: will break when we support volume mounts */
sprintfW
(
volume
,
fmt
,
tolowerW
(
path
[
0
]
)
-
'a'
);
ret
=
TRUE
;
}
return
ret
;
}
/***********************************************************************
/***********************************************************************
* DefineDosDeviceW (KERNEL32.@)
* DefineDosDeviceW (KERNEL32.@)
...
...
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