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
dbecf5c9
Commit
dbecf5c9
authored
Mar 26, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the windows and system directories as long path names.
Moved GetTempPath and GetTempDrive to dlls/kernel.
parent
d5a1e761
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
0 deletions
+104
-0
file16.c
dlls/kernel/file16.c
+21
-0
path.c
dlls/kernel/path.c
+83
-0
directory.c
files/directory.c
+0
-0
No files found.
dlls/kernel/file16.c
View file @
dbecf5c9
...
@@ -348,6 +348,27 @@ UINT16 WINAPI WIN16_lread( HFILE16 hFile, SEGPTR buffer, UINT16 count )
...
@@ -348,6 +348,27 @@ UINT16 WINAPI WIN16_lread( HFILE16 hFile, SEGPTR buffer, UINT16 count )
/***********************************************************************
/***********************************************************************
* GetTempDrive (KERNEL.92)
* A closer look at krnl386.exe shows what the SDK doesn't mention:
*
* returns:
* AL: driveletter
* AH: ':' - yes, some kernel code even does stosw with
* the returned AX.
* DX: 1 for success
*/
UINT
WINAPI
GetTempDrive
(
BYTE
ignored
)
{
WCHAR
buffer
[
8
];
BYTE
ret
;
if
(
GetTempPathW
(
8
,
buffer
))
ret
=
(
BYTE
)
toupperW
(
buffer
[
0
]);
else
ret
=
'C'
;
return
MAKELONG
(
ret
|
(
':'
<<
8
),
1
);
}
/***********************************************************************
* GetTempFileName (KERNEL.97)
* GetTempFileName (KERNEL.97)
*/
*/
UINT16
WINAPI
GetTempFileName16
(
BYTE
drive
,
LPCSTR
prefix
,
UINT16
unique
,
UINT16
WINAPI
GetTempFileName16
(
BYTE
drive
,
LPCSTR
prefix
,
UINT16
unique
,
...
...
dlls/kernel/path.c
View file @
dbecf5c9
...
@@ -426,6 +426,89 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, DWORD shortlen
...
@@ -426,6 +426,89 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, DWORD shortlen
/***********************************************************************
/***********************************************************************
* GetTempPathA (KERNEL32.@)
*/
UINT
WINAPI
GetTempPathA
(
UINT
count
,
LPSTR
path
)
{
WCHAR
pathW
[
MAX_PATH
];
UINT
ret
;
ret
=
GetTempPathW
(
MAX_PATH
,
pathW
);
if
(
!
ret
)
return
0
;
if
(
ret
>
MAX_PATH
)
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
pathW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
ret
<=
count
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
pathW
,
-
1
,
path
,
count
,
NULL
,
NULL
);
ret
--
;
/* length without 0 */
}
return
ret
;
}
/***********************************************************************
* GetTempPathW (KERNEL32.@)
*/
UINT
WINAPI
GetTempPathW
(
UINT
count
,
LPWSTR
path
)
{
static
const
WCHAR
tmp
[]
=
{
'T'
,
'M'
,
'P'
,
0
};
static
const
WCHAR
temp
[]
=
{
'T'
,
'E'
,
'M'
,
'P'
,
0
};
WCHAR
tmp_path
[
MAX_PATH
];
UINT
ret
;
TRACE
(
"%u,%p
\n
"
,
count
,
path
);
if
(
!
(
ret
=
GetEnvironmentVariableW
(
tmp
,
tmp_path
,
MAX_PATH
)))
if
(
!
(
ret
=
GetEnvironmentVariableW
(
temp
,
tmp_path
,
MAX_PATH
)))
if
(
!
(
ret
=
GetCurrentDirectoryW
(
MAX_PATH
,
tmp_path
)))
return
0
;
if
(
ret
>
MAX_PATH
)
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
ret
=
GetFullPathNameW
(
tmp_path
,
MAX_PATH
,
tmp_path
,
NULL
);
if
(
!
ret
)
return
0
;
if
(
ret
>
MAX_PATH
-
2
)
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
if
(
tmp_path
[
ret
-
1
]
!=
'\\'
)
{
tmp_path
[
ret
++
]
=
'\\'
;
tmp_path
[
ret
]
=
'\0'
;
}
ret
++
;
/* add space for terminating 0 */
if
(
count
)
{
lstrcpynW
(
path
,
tmp_path
,
count
);
if
(
count
>=
ret
)
ret
--
;
/* return length without 0 */
else
if
(
count
<
4
)
path
[
0
]
=
0
;
/* avoid returning ambiguous "X:" */
}
TRACE
(
"returning %u, %s
\n
"
,
ret
,
debugstr_w
(
path
));
return
ret
;
}
/***********************************************************************
* contains_pathW
* contains_pathW
*
*
* Check if the file name contains a path; helper for SearchPathW.
* Check if the file name contains a path; helper for SearchPathW.
...
...
files/directory.c
View file @
dbecf5c9
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