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
e2386665
Commit
e2386665
authored
May 27, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics: formatting, indentation.
parent
d5294ea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
32 deletions
+30
-32
projects/activex/main.cpp
projects/activex/main.cpp
+30
-32
No files found.
projects/activex/main.cpp
View file @
e2386665
...
@@ -48,9 +48,12 @@ using namespace std;
...
@@ -48,9 +48,12 @@ using namespace std;
/*
/*
** MingW headers & libs do not declare those
** MingW headers & libs do not declare those
*/
*/
static
DEFINE_GUID
(
_CATID_InternetAware
,
0x0DE86A58
,
0x2BAA
,
0x11CF
,
0xA2
,
0x29
,
0x00
,
0xAA
,
0x00
,
0x3D
,
0x73
,
0x52
);
static
DEFINE_GUID
(
_CATID_InternetAware
,
\
static
DEFINE_GUID
(
_CATID_SafeForInitializing
,
0x7DD95802
,
0x9882
,
0x11CF
,
0x9F
,
0xA9
,
0x00
,
0xAA
,
0x00
,
0x6C
,
0x42
,
0xC4
);
0x0DE86A58
,
0x2BAA
,
0x11CF
,
0xA2
,
0x29
,
0x00
,
0xAA
,
0x00
,
0x3D
,
0x73
,
0x52
);
static
DEFINE_GUID
(
_CATID_SafeForScripting
,
0x7DD95801
,
0x9882
,
0x11CF
,
0x9F
,
0xA9
,
0x00
,
0xAA
,
0x00
,
0x6C
,
0x42
,
0xC4
);
static
DEFINE_GUID
(
_CATID_SafeForInitializing
,
\
0x7DD95802
,
0x9882
,
0x11CF
,
0x9F
,
0xA9
,
0x00
,
0xAA
,
0x00
,
0x6C
,
0x42
,
0xC4
);
static
DEFINE_GUID
(
_CATID_SafeForScripting
,
\
0x7DD95801
,
0x9882
,
0x11CF
,
0x9F
,
0xA9
,
0x00
,
0xAA
,
0x00
,
0x6C
,
0x42
,
0xC4
);
static
LONG
i_class_ref
=
0
;
static
LONG
i_class_ref
=
0
;
static
HINSTANCE
h_instance
=
0
;
static
HINSTANCE
h_instance
=
0
;
...
@@ -66,10 +69,10 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
...
@@ -66,10 +69,10 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
*
ppv
=
NULL
;
*
ppv
=
NULL
;
if
(
(
CLSID_VLCPlugin
==
rclsid
)
if
(
(
CLSID_VLCPlugin
==
rclsid
)
||
(
CLSID_VLCPlugin2
==
rclsid
)
)
||
(
CLSID_VLCPlugin2
==
rclsid
)
)
{
{
VLCPluginClass
*
plugin
=
new
VLCPluginClass
(
&
i_class_ref
,
h_instance
,
rclsid
);
VLCPluginClass
*
plugin
=
new
VLCPluginClass
(
&
i_class_ref
,
h_instance
,
rclsid
);
hr
=
plugin
->
QueryInterface
(
riid
,
ppv
);
hr
=
plugin
->
QueryInterface
(
riid
,
ppv
);
plugin
->
Release
();
plugin
->
Release
();
}
}
...
@@ -85,24 +88,25 @@ static inline HKEY keyCreate(HKEY parentKey, LPCTSTR keyName)
...
@@ -85,24 +88,25 @@ static inline HKEY keyCreate(HKEY parentKey, LPCTSTR keyName)
{
{
HKEY
childKey
;
HKEY
childKey
;
if
(
ERROR_SUCCESS
==
RegCreateKeyEx
(
parentKey
,
keyName
,
0
,
NULL
,
if
(
ERROR_SUCCESS
==
RegCreateKeyEx
(
parentKey
,
keyName
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
childKey
,
NULL
)
)
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
childKey
,
NULL
)
)
{
{
return
childKey
;
return
childKey
;
}
}
return
NULL
;
return
NULL
;
};
};
static
inline
HKEY
keySet
(
HKEY
hKey
,
LPCTSTR
valueName
,
const
void
*
s
,
size_t
len
,
DWORD
dwType
=
REG_SZ
)
static
inline
HKEY
keySet
(
HKEY
hKey
,
LPCTSTR
valueName
,
const
void
*
s
,
size_t
len
,
DWORD
dwType
=
REG_SZ
)
{
{
if
(
NULL
!=
hKey
)
if
(
NULL
!=
hKey
)
{
{
RegSetValueEx
(
hKey
,
valueName
,
0
,
dwType
,
RegSetValueEx
(
hKey
,
valueName
,
0
,
dwType
,
(
const
BYTE
*
)
s
,
len
);
(
const
BYTE
*
)
s
,
len
);
}
}
return
hKey
;
return
hKey
;
};
};
static
inline
HKEY
keySetDef
(
HKEY
hKey
,
const
void
*
s
,
size_t
len
,
DWORD
dwType
=
REG_SZ
)
static
inline
HKEY
keySetDef
(
HKEY
hKey
,
const
void
*
s
,
size_t
len
,
DWORD
dwType
=
REG_SZ
)
{
{
return
keySet
(
hKey
,
NULL
,
s
,
len
,
dwType
);
return
keySet
(
hKey
,
NULL
,
s
,
len
,
dwType
);
};
};
...
@@ -193,8 +197,7 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -193,8 +197,7 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
keySetDef
(
hProgKey
,
description
);
keySetDef
(
hProgKey
,
description
);
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CLSID"
)),
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CLSID"
)),
szCLSID
,
szCLSID
,
sizeof
(
szCLSID
)));
sizeof
(
szCLSID
)));
//hSubKey = keyClose(keyCreate(hBaseKey, "Insertable"));
//hSubKey = keyClose(keyCreate(hBaseKey, "Insertable"));
...
@@ -209,11 +212,10 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -209,11 +212,10 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
keySetDef
(
hProgKey
,
description
);
keySetDef
(
hProgKey
,
description
);
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CLSID"
)),
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CLSID"
)),
szCLSID
,
szCLSID
,
sizeof
(
szCLSID
)));
sizeof
(
szCLSID
)));
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CurVer"
)),
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CurVer"
)),
progId
));
progId
));
}
}
}
}
hClassKey
=
keyCreate
(
hParent
,
szCLSID
);
hClassKey
=
keyCreate
(
hParent
,
szCLSID
);
...
@@ -257,36 +259,30 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -257,36 +259,30 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
#endif
#endif
// MiscStatus key value
// MiscStatus key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
TEXT
(
"MiscStatus
\\
1"
)),
TEXT
(
"MiscStatus
\\
1"
)),
TEXT
(
MISC_STATUS
),
sizeof
(
TEXT
(
MISC_STATUS
))));
TEXT
(
MISC_STATUS
),
sizeof
(
TEXT
(
MISC_STATUS
))));
// Programmable key value
// Programmable key value
keyClose
(
keyCreate
(
hClassKey
,
TEXT
(
"Programmable"
)));
keyClose
(
keyCreate
(
hClassKey
,
TEXT
(
"Programmable"
)));
// ProgID key value
// ProgID key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
TEXT
(
"ProgID"
)),
progId
));
TEXT
(
"ProgID"
)),
progId
));
// VersionIndependentProgID key value
// VersionIndependentProgID key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
TEXT
(
"VersionIndependentProgID"
)),
TEXT
(
"VersionIndependentProgID"
)),
TEXT
(
PROGID_STR
),
sizeof
(
TEXT
(
PROGID_STR
))));
TEXT
(
PROGID_STR
),
sizeof
(
TEXT
(
PROGID_STR
))));
// Version key value
// Version key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
TEXT
(
"Version"
)),
TEXT
(
"1.0"
)));
TEXT
(
"Version"
)),
TEXT
(
"1.0"
)));
// TypeLib key value
// TypeLib key value
OLECHAR
szLIBID
[
GUID_STRLEN
];
OLECHAR
szLIBID
[
GUID_STRLEN
];
StringFromGUID2
(
LIBID_AXVLC
,
szLIBID
,
GUID_STRLEN
);
StringFromGUID2
(
LIBID_AXVLC
,
szLIBID
,
GUID_STRLEN
);
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
TEXT
(
"TypeLib"
)),
TEXT
(
"TypeLib"
)),
szLIBID
,
sizeof
(
szLIBID
)));
szLIBID
,
sizeof
(
szLIBID
)));
RegCloseKey
(
hClassKey
);
RegCloseKey
(
hClassKey
);
}
}
...
@@ -304,7 +300,8 @@ STDAPI DllRegisterServer(VOID)
...
@@ -304,7 +300,8 @@ STDAPI DllRegisterServer(VOID)
HKEY
hBaseKey
;
HKEY
hBaseKey
;
if
(
ERROR_SUCCESS
!=
RegOpenKeyEx
(
HKEY_CLASSES_ROOT
,
TEXT
(
"CLSID"
),
0
,
KEY_CREATE_SUB_KEY
,
&
hBaseKey
)
)
if
(
ERROR_SUCCESS
!=
RegOpenKeyEx
(
HKEY_CLASSES_ROOT
,
TEXT
(
"CLSID"
),
0
,
KEY_CREATE_SUB_KEY
,
&
hBaseKey
)
)
return
SELFREG_E_CLASS
;
return
SELFREG_E_CLASS
;
RegisterClassID
(
hBaseKey
,
CLSID_VLCPlugin
,
1
,
FALSE
,
DllPath
,
DllPathLen
);
RegisterClassID
(
hBaseKey
,
CLSID_VLCPlugin
,
1
,
FALSE
,
DllPath
,
DllPathLen
);
...
@@ -373,7 +370,8 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
...
@@ -373,7 +370,8 @@ STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
IUnknown
*
classProc
=
NULL
;
IUnknown
*
classProc
=
NULL
;
if
(
FAILED
(
DllGetClassObject
(
CLSID_VLCPlugin
,
IID_IUnknown
,
(
LPVOID
*
)
&
classProc
))
)
if
(
FAILED
(
DllGetClassObject
(
CLSID_VLCPlugin
,
IID_IUnknown
,
(
LPVOID
*
)
&
classProc
))
)
return
0
;
return
0
;
DWORD
dwRegisterClassObject
;
DWORD
dwRegisterClassObject
;
...
...
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