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
7d23d3ec
Commit
7d23d3ec
authored
Dec 28, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl100: Added support for typelibs in separate files in AtlLoadTypeLib.
parent
5c2005ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
8 deletions
+95
-8
atl.c
dlls/atl100/atl.c
+49
-7
Makefile.in
dlls/atl100/tests/Makefile.in
+1
-1
atl.c
dlls/atl100/tests/atl.c
+45
-0
No files found.
dlls/atl100/atl.c
View file @
7d23d3ec
...
...
@@ -22,9 +22,20 @@
#include "atlbase.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
atl100
);
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
ICatRegister
*
catreg
;
/***********************************************************************
...
...
@@ -268,25 +279,56 @@ void WINAPI AtlCallTermFunc(_ATL_MODULE *pM)
}
/***********************************************************************
* AtlLoadTypeLib [atl100.
@
]
* AtlLoadTypeLib [atl100.
56
]
*/
HRESULT
WINAPI
AtlLoadTypeLib
(
HINSTANCE
inst
,
LPCOLESTR
lpszIndex
,
BSTR
*
pbstrPath
,
ITypeLib
**
ppTypeLib
)
{
OLECHAR
path
[
MAX_PATH
+
8
];
/* leave some space for index */
size_t
path_len
,
index_len
;
ITypeLib
*
typelib
=
NULL
;
WCHAR
*
path
;
HRESULT
hres
;
static
const
WCHAR
tlb_extW
[]
=
{
'.'
,
't'
,
'l'
,
'b'
,
0
};
TRACE
(
"(%p %s %p %p)
\n
"
,
inst
,
debugstr_w
(
lpszIndex
),
pbstrPath
,
ppTypeLib
);
GetModuleFileNameW
(
inst
,
path
,
MAX_PATH
);
if
(
lpszIndex
)
lstrcatW
(
path
,
lpszIndex
);
index_len
=
lpszIndex
?
strlenW
(
lpszIndex
)
:
0
;
path
=
heap_alloc
((
MAX_PATH
+
index_len
)
*
sizeof
(
WCHAR
)
+
sizeof
(
tlb_extW
));
if
(
!
path
)
return
E_OUTOFMEMORY
;
path_len
=
GetModuleFileNameW
(
inst
,
path
,
MAX_PATH
);
if
(
!
path_len
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
if
(
index_len
)
memcpy
(
path
+
path_len
,
lpszIndex
,
(
index_len
+
1
)
*
sizeof
(
WCHAR
));
hres
=
LoadTypeLib
(
path
,
&
typelib
);
if
(
FAILED
(
hres
))
{
WCHAR
*
ptr
;
for
(
ptr
=
path
+
path_len
-
1
;
ptr
>
path
&&
*
ptr
!=
'\\'
&&
*
ptr
!=
'.'
;
ptr
--
);
if
(
*
ptr
!=
'.'
)
ptr
=
path
+
path_len
;
memcpy
(
ptr
,
tlb_extW
,
sizeof
(
tlb_extW
));
hres
=
LoadTypeLib
(
path
,
&
typelib
);
}
if
(
SUCCEEDED
(
hres
))
{
*
pbstrPath
=
SysAllocString
(
path
);
if
(
!*
pbstrPath
)
{
ITypeLib_Release
(
typelib
);
hres
=
E_OUTOFMEMORY
;
}
}
h
res
=
LoadTypeLib
(
path
,
ppTypeLib
);
h
eap_free
(
path
);
if
(
FAILED
(
hres
))
return
hres
;
*
p
bstrPath
=
SysAllocString
(
path
)
;
*
p
pTypeLib
=
typelib
;
return
S_OK
;
}
...
...
dlls/atl100/tests/Makefile.in
View file @
7d23d3ec
TESTDLL
=
atl100.dll
IMPORTS
=
atl100 ole32 advapi32
IMPORTS
=
atl100 ole
aut32 ole
32 advapi32
EXTRADEFS
=
-D_ATL_VER
=
_ATL_VER_100
C_SRCS
=
\
...
...
dlls/atl100/tests/atl.c
View file @
7d23d3ec
...
...
@@ -156,12 +156,57 @@ static void test_regcat(void)
test_key_exists
(
HKEY_CLASSES_ROOT
,
"CLSID
\\
{"
CLSID_TEST_STR
"}"
);
}
static
void
test_typelib
(
void
)
{
ITypeLib
*
typelib
;
HINSTANCE
inst
;
size_t
len
;
BSTR
path
;
HRESULT
hres
;
static
const
WCHAR
scrrun_dll_suffixW
[]
=
{
'\\'
,
's'
,
'c'
,
'r'
,
'r'
,
'u'
,
'n'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
mshtml_tlb_suffixW
[]
=
{
'\\'
,
'm'
,
's'
,
'h'
,
't'
,
'm'
,
'l'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
inst
=
LoadLibraryA
(
"scrrun.dll"
);
ok
(
inst
!=
NULL
,
"Could not load scrrun.dll
\n
"
);
typelib
=
NULL
;
hres
=
AtlLoadTypeLib
(
inst
,
NULL
,
&
path
,
&
typelib
);
ok
(
hres
==
S_OK
,
"AtlLoadTypeLib failed: %08x
\n
"
,
hres
);
FreeLibrary
(
inst
);
len
=
SysStringLen
(
path
);
ok
(
len
>
sizeof
(
scrrun_dll_suffixW
)
/
sizeof
(
WCHAR
)
&&
lstrcmpiW
(
path
+
len
-
sizeof
(
scrrun_dll_suffixW
)
/
sizeof
(
WCHAR
),
scrrun_dll_suffixW
),
"unexpected path %s
\n
"
,
wine_dbgstr_w
(
path
));
SysFreeString
(
path
);
ok
(
typelib
!=
NULL
,
"typelib == NULL
\n
"
);
ITypeLib_Release
(
typelib
);
inst
=
LoadLibraryA
(
"mshtml.dll"
);
ok
(
inst
!=
NULL
,
"Could not load mshtml.dll
\n
"
);
typelib
=
NULL
;
hres
=
AtlLoadTypeLib
(
inst
,
NULL
,
&
path
,
&
typelib
);
ok
(
hres
==
S_OK
,
"AtlLoadTypeLib failed: %08x
\n
"
,
hres
);
FreeLibrary
(
inst
);
len
=
SysStringLen
(
path
);
ok
(
len
>
sizeof
(
mshtml_tlb_suffixW
)
/
sizeof
(
WCHAR
)
&&
lstrcmpiW
(
path
+
len
-
sizeof
(
mshtml_tlb_suffixW
)
/
sizeof
(
WCHAR
),
mshtml_tlb_suffixW
),
"unexpected path %s
\n
"
,
wine_dbgstr_w
(
path
));
SysFreeString
(
path
);
ok
(
typelib
!=
NULL
,
"typelib == NULL
\n
"
);
ITypeLib_Release
(
typelib
);
}
START_TEST
(
atl
)
{
CoInitialize
(
NULL
);
test_winmodule
();
test_regcat
();
test_typelib
();
CoUninitialize
();
}
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