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
5f66cf3a
Commit
5f66cf3a
authored
Jan 21, 2003
by
Liu Spider
Committed by
Alexandre Julliard
Jan 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented GetFileTitleW; GetFileTitleA now is a call to
GetFileTitleW.
parent
aa3ba0b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
31 deletions
+29
-31
filetitle.c
dlls/commdlg/filetitle.c
+29
-31
No files found.
dlls/commdlg/filetitle.c
View file @
5f66cf3a
...
...
@@ -23,34 +23,53 @@
#include "winbase.h"
#include "winnls.h"
#include "winternl.h"
#include "commdlg.h"
#include "cdlg.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "heap.h"
/* Has to go */
WINE_DEFAULT_DEBUG_CHANNEL
(
commdlg
);
#include "cdlg.h"
/***********************************************************************
* GetFileTitleA (COMDLG32.@)
*
*/
short
WINAPI
GetFileTitleA
(
LPCSTR
lpFile
,
LPSTR
lpTitle
,
UINT
cbBuf
)
{
int
i
,
len
;
int
ret
;
UNICODE_STRING
strWFile
;
LPWSTR
lpWTitle
;
RtlCreateUnicodeStringFromAsciiz
(
&
strWFile
,
lpFile
);
lpWTitle
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
cbBuf
*
sizeof
(
WCHAR
));
ret
=
GetFileTitleW
(
strWFile
.
Buffer
,
lpWTitle
,
cbBuf
);
if
(
!
ret
)
WideCharToMultiByte
(
CP_ACP
,
0
,
lpWTitle
,
-
1
,
lpTitle
,
cbBuf
,
NULL
,
NULL
);
RtlFreeUnicodeString
(
&
strWFile
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
lpWTitle
);
return
ret
;
}
/***********************************************************************
* GetFileTitleW (COMDLG32.@)
*
*/
short
WINAPI
GetFileTitleW
(
LPCWSTR
lpFile
,
LPWSTR
lpTitle
,
UINT
cbBuf
)
{
int
i
,
len
;
static
const
WCHAR
brkpoint
[]
=
{
'*'
,
'['
,
']'
};
TRACE
(
"(%p %p %d);
\n
"
,
lpFile
,
lpTitle
,
cbBuf
);
if
(
lpFile
==
NULL
||
lpTitle
==
NULL
)
return
-
1
;
len
=
strlen
(
lpFile
);
len
=
strlen
W
(
lpFile
);
if
(
len
==
0
)
return
-
1
;
if
(
strpbrk
(
lpFile
,
"*[]"
))
if
(
strpbrk
W
(
lpFile
,
brkpoint
))
return
-
1
;
len
--
;
...
...
@@ -70,42 +89,21 @@ short WINAPI GetFileTitleA(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
if
(
i
==
-
1
)
i
++
;
TRACE
(
"---> '%s'
\n
"
,
&
lpFile
[
i
]
);
TRACE
(
"---> '%s'
\n
"
,
debugstr_w
(
&
lpFile
[
i
])
);
len
=
strlen
(
lpFile
+
i
)
+
1
;
len
=
strlen
W
(
lpFile
+
i
)
+
1
;
if
(
cbBuf
<
len
)
return
len
;
str
ncpy
(
lpTitle
,
&
lpFile
[
i
],
len
);
str
cpyW
(
lpTitle
,
&
lpFile
[
i
]
);
return
0
;
}
/***********************************************************************
* GetFileTitleW (COMDLG32.@)
*
*/
short
WINAPI
GetFileTitleW
(
LPCWSTR
lpFile
,
LPWSTR
lpTitle
,
UINT
cbBuf
)
{
LPSTR
file
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
lpFile
);
/* Has to go */
LPSTR
title
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbBuf
);
short
ret
;
ret
=
GetFileTitleA
(
file
,
title
,
cbBuf
);
if
(
cbBuf
>
0
&&
!
MultiByteToWideChar
(
CP_ACP
,
0
,
title
,
-
1
,
lpTitle
,
cbBuf
))
lpTitle
[
cbBuf
-
1
]
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
file
);
HeapFree
(
GetProcessHeap
(),
0
,
title
);
return
ret
;
}
/***********************************************************************
* GetFileTitle (COMMDLG.27)
*/
short
WINAPI
GetFileTitle16
(
LPCSTR
lpFile
,
LPSTR
lpTitle
,
UINT16
cbBuf
)
{
return
GetFileTitleA
(
lpFile
,
lpTitle
,
cbBuf
);
}
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