Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
722b1c1a
Commit
722b1c1a
authored
Mar 16, 2005
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main.cpp: fixed bug regarding TypeLib registration
plugin.cpp: some minor cleanup
parent
0183572d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
activex/main.cpp
activex/main.cpp
+27
-8
activex/plugin.cpp
activex/plugin.cpp
+5
-3
No files found.
activex/main.cpp
View file @
722b1c1a
...
...
@@ -72,7 +72,8 @@ STDAPI DllCanUnloadNow(VOID)
return
(
0
==
i_class_ref
)
?
S_OK
:
S_FALSE
;
};
static
LPCTSTR
TStrFromGUID
(
REFGUID
clsid
)
{
static
LPCTSTR
TStrFromGUID
(
REFGUID
clsid
)
{
LPOLESTR
oleStr
;
if
(
FAILED
(
StringFromIID
(
clsid
,
&
oleStr
))
)
...
...
@@ -160,7 +161,7 @@ STDAPI DllRegisterServer(VOID)
char
DllPath
[
MAX_PATH
];
DWORD
DllPathLen
=
GetModuleFileName
(
h_instance
,
DllPath
,
sizeof
(
DllPath
))
;
if
(
0
==
DllPathLen
)
return
E_
FAIL
;
return
E_
UNEXPECTED
;
LPCTSTR
psz_CLSID
=
TStrFromGUID
(
CLSID_VLCPlugin
);
...
...
@@ -170,7 +171,7 @@ STDAPI DllRegisterServer(VOID)
HKEY
hBaseKey
;
if
(
ERROR_SUCCESS
!=
RegOpenKeyEx
(
HKEY_CLASSES_ROOT
,
TEXT
(
"CLSID"
),
0
,
KEY_CREATE_SUB_KEY
,
&
hBaseKey
)
)
return
E_FAIL
;
return
SELFREG_E_CLASS
;
HKEY
hClassKey
=
keyCreate
(
hBaseKey
,
psz_CLSID
);
if
(
NULL
!=
hClassKey
)
...
...
@@ -185,6 +186,13 @@ STDAPI DllRegisterServer(VOID)
hSubKey
=
keyCreate
(
hClassKey
,
TEXT
(
"Control"
));
RegCloseKey
(
hSubKey
);
#ifdef BUILD_LOCALSERVER
// LocalServer32 key value
hSubKey
=
keyCreate
(
hClassKey
,
TEXT
(
"LocalServer32"
));
RegSetValueEx
(
hSubKey
,
NULL
,
0
,
REG_SZ
,
(
const
BYTE
*
)
DllPath
,
DllPathLen
);
RegCloseKey
(
hSubKey
);
#else
// InprocServer32 key value
hSubKey
=
keyCreate
(
hClassKey
,
TEXT
(
"InprocServer32"
));
RegSetValueEx
(
hSubKey
,
NULL
,
0
,
REG_SZ
,
...
...
@@ -192,6 +200,7 @@ STDAPI DllRegisterServer(VOID)
RegSetValueEx
(
hSubKey
,
TEXT
(
"ThreadingModel"
),
0
,
REG_SZ
,
(
const
BYTE
*
)
THREADING_MODEL
,
sizeof
(
THREADING_MODEL
));
RegCloseKey
(
hSubKey
);
#endif
// MiscStatus key value
hSubKey
=
keyCreate
(
hClassKey
,
TEXT
(
"MiscStatus
\\
1"
));
...
...
@@ -299,18 +308,20 @@ STDAPI DllRegisterServer(VOID)
// register type lib into the registry
ITypeLib
*
typeLib
;
#ifndef OLE2ANSI
size_t
typeLibPathLen
=
MultiByteToWideChar
(
CP_ACP
,
0
,
DllPath
,
DllPathLen
,
NULL
,
0
);
size_t
typeLibPathLen
=
MultiByteToWideChar
(
CP_ACP
,
0
,
DllPath
,
-
1
,
NULL
,
0
);
if
(
typeLibPathLen
>
0
)
{
LPOLESTR
typeLibPath
=
(
LPOLESTR
)
CoTaskMemAlloc
(
typeLibPathLen
*
sizeof
(
wchar_t
));
MultiByteToWideChar
(
CP_ACP
,
0
,
DllPath
,
DllPathLen
,
typeLibPath
,
typeLibPathLen
);
if
(
SUCCEEDED
(
LoadTypeLibEx
(
typeLibPath
,
REGKIND_REGISTER
,
&
typeLib
))
)
typeLib
->
Release
();
if
(
FAILED
(
LoadTypeLibEx
(
typeLibPath
,
REGKIND_REGISTER
,
&
typeLib
))
)
return
SELFREG_E_TYPELIB
;
typeLib
->
Release
();
CoTaskMemFree
((
void
*
)
typeLibPath
);
}
#else
if
(
SUCCEEDED
(
LoadTypeLibEx
((
LPOLESTR
)
DllPath
,
REGKIND_REGISTER
,
&
typeLib
))
)
typeLib
->
Release
();
if
(
FAILED
(
LoadTypeLibEx
((
LPOLESTR
)
DllPath
,
REGKIND_REGISTER
,
&
typeLib
))
)
return
SELFREG_E_TYPELIB
;
typeLib
->
Release
();
#endif
CoTaskMemFree
((
void
*
)
psz_CLSID
);
...
...
@@ -335,6 +346,14 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
return
1
;
}
h_instance
=
hInst
;
if
(
FAILED
(
DllRegisterServer
())
)
{
cerr
<<
"cannot register Local Server"
<<
endl
;
return
1
;
}
IUnknown
*
classProc
=
NULL
;
if
(
FAILED
(
DllGetClassObject
(
CLSID_VLCPlugin
,
IID_IUnknown
,
(
LPVOID
*
)
&
classProc
))
)
...
...
activex/plugin.cpp
View file @
722b1c1a
...
...
@@ -484,13 +484,15 @@ void VLCPlugin::calcPositionChange(LPRECT lprPosRect, LPCRECT lprcClipRect)
}
};
#include <iostream>
HRESULT
VLCPlugin
::
onInit
(
BOOL
isNew
)
{
if
(
0
==
_i_vlc
)
{
#ifdef ACTIVEX_DEBUG
char
*
ppsz_argv
[]
=
{
"vlc"
,
"-vvv"
,
"--fast-mutex"
,
"--win9x-cv-method=1"
};
#else
char
*
ppsz_argv
[]
=
{
"vlc"
,
"-vv"
};
#endif
HKEY
h_key
;
DWORD
i_type
,
i_data
=
MAX_PATH
+
1
;
char
p_data
[
MAX_PATH
+
1
];
...
...
@@ -514,7 +516,7 @@ HRESULT VLCPlugin::onInit(BOOL isNew)
#endif
_i_vlc
=
VLC_Create
();
if
(
VLC_Init
(
_i_vlc
,
sizeof
(
ppsz_argv
)
/
sizeof
(
char
*
),
ppsz_argv
)
)
{
VLC_Destroy
(
_i_vlc
);
...
...
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