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
dbbc40af
Commit
dbbc40af
authored
Oct 01, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version: Moved GetFileResourceSize16/GetFileResource16 to ver16.c.
parent
e84c42d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
58 deletions
+60
-58
resource.c
dlls/version/resource.c
+0
-58
ver16.c
dlls/version/ver16.c
+60
-0
No files found.
dlls/version/resource.c
View file @
dbbc40af
...
...
@@ -408,61 +408,3 @@ DWORD find_resource( HFILE lzfd, LPCSTR type, LPCSTR id, DWORD *reslen, DWORD *o
}
return
magic
;
}
/*************************************************************************
* GetFileResourceSize [VER.2]
*/
DWORD
WINAPI
GetFileResourceSize16
(
LPCSTR
lpszFileName
,
LPCSTR
lpszResType
,
LPCSTR
lpszResId
,
LPDWORD
lpdwFileOffset
)
{
HFILE
lzfd
;
OFSTRUCT
ofs
;
DWORD
reslen
=
0
;
TRACE
(
"(%s,type=%p,id=%p,off=%p)
\n
"
,
debugstr_a
(
lpszFileName
),
lpszResType
,
lpszResId
,
lpszResId
);
lzfd
=
LZOpenFileA
(
(
LPSTR
)
lpszFileName
,
&
ofs
,
OF_READ
);
if
(
lzfd
>=
0
)
{
if
(
!
find_resource
(
lzfd
,
lpszResType
,
lpszResId
,
&
reslen
,
lpdwFileOffset
))
reslen
=
0
;
LZClose
(
lzfd
);
}
return
reslen
;
}
/*************************************************************************
* GetFileResource [VER.3]
*/
DWORD
WINAPI
GetFileResource16
(
LPCSTR
lpszFileName
,
LPCSTR
lpszResType
,
LPCSTR
lpszResId
,
DWORD
dwFileOffset
,
DWORD
dwResLen
,
LPVOID
lpvData
)
{
HFILE
lzfd
;
OFSTRUCT
ofs
;
DWORD
reslen
=
dwResLen
;
TRACE
(
"(%s,type=%p,id=%p,off=%d,len=%d,data=%p)
\n
"
,
debugstr_a
(
lpszFileName
),
lpszResType
,
lpszResId
,
dwFileOffset
,
dwResLen
,
lpvData
);
lzfd
=
LZOpenFileA
(
(
LPSTR
)
lpszFileName
,
&
ofs
,
OF_READ
);
if
(
lzfd
<
0
)
return
0
;
if
(
!
dwFileOffset
)
{
if
(
!
find_resource
(
lzfd
,
lpszResType
,
lpszResId
,
&
reslen
,
&
dwFileOffset
))
{
LZClose
(
lzfd
);
return
0
;
}
}
LZSeek
(
lzfd
,
dwFileOffset
,
SEEK_SET
);
reslen
=
LZRead
(
lzfd
,
lpvData
,
min
(
reslen
,
dwResLen
)
);
LZClose
(
lzfd
);
return
reslen
;
}
dlls/version/ver16.c
View file @
dbbc40af
...
...
@@ -23,11 +23,71 @@
#include "windef.h"
#include "wine/winbase16.h"
#include "winver.h"
#include "lzexpand.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ver
);
extern
DWORD
find_resource
(
HFILE
lzfd
,
LPCSTR
type
,
LPCSTR
id
,
DWORD
*
reslen
,
DWORD
*
offset
);
/*************************************************************************
* GetFileResourceSize [VER.2]
*/
DWORD
WINAPI
GetFileResourceSize16
(
LPCSTR
lpszFileName
,
LPCSTR
lpszResType
,
LPCSTR
lpszResId
,
LPDWORD
lpdwFileOffset
)
{
HFILE
lzfd
;
OFSTRUCT
ofs
;
DWORD
reslen
=
0
;
TRACE
(
"(%s,type=%p,id=%p,off=%p)
\n
"
,
debugstr_a
(
lpszFileName
),
lpszResType
,
lpszResId
,
lpszResId
);
lzfd
=
LZOpenFileA
(
(
LPSTR
)
lpszFileName
,
&
ofs
,
OF_READ
);
if
(
lzfd
>=
0
)
{
if
(
!
find_resource
(
lzfd
,
lpszResType
,
lpszResId
,
&
reslen
,
lpdwFileOffset
))
reslen
=
0
;
LZClose
(
lzfd
);
}
return
reslen
;
}
/*************************************************************************
* GetFileResource [VER.3]
*/
DWORD
WINAPI
GetFileResource16
(
LPCSTR
lpszFileName
,
LPCSTR
lpszResType
,
LPCSTR
lpszResId
,
DWORD
dwFileOffset
,
DWORD
dwResLen
,
LPVOID
lpvData
)
{
HFILE
lzfd
;
OFSTRUCT
ofs
;
DWORD
reslen
=
dwResLen
;
TRACE
(
"(%s,type=%p,id=%p,off=%d,len=%d,data=%p)
\n
"
,
debugstr_a
(
lpszFileName
),
lpszResType
,
lpszResId
,
dwFileOffset
,
dwResLen
,
lpvData
);
lzfd
=
LZOpenFileA
(
(
LPSTR
)
lpszFileName
,
&
ofs
,
OF_READ
);
if
(
lzfd
<
0
)
return
0
;
if
(
!
dwFileOffset
)
{
if
(
!
find_resource
(
lzfd
,
lpszResType
,
lpszResId
,
&
reslen
,
&
dwFileOffset
))
{
LZClose
(
lzfd
);
return
0
;
}
}
LZSeek
(
lzfd
,
dwFileOffset
,
0
/* SEEK_SET */
);
reslen
=
LZRead
(
lzfd
,
lpvData
,
min
(
reslen
,
dwResLen
)
);
LZClose
(
lzfd
);
return
reslen
;
}
/*************************************************************************
* GetFileVersionInfoSize [VER.6]
*/
...
...
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