1 |
jeremyd2019 |
239 |
// CTivoChunk.h : Declaration of the CTivoChunk
|
2 |
|
|
|
3 |
|
|
#pragma once
|
4 |
|
|
#include "resource.h" // main symbols
|
5 |
|
|
|
6 |
|
|
#include "tivocom.h"
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
|
10 |
|
|
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
|
11 |
|
|
#endif
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
// CTivoChunk
|
16 |
|
|
|
17 |
|
|
class ATL_NO_VTABLE CTivoChunk :
|
18 |
|
|
public CComObjectRootEx<CComSingleThreadModel>,
|
19 |
|
|
// public CComCoClass<CTivoChunk, &CLSID_TivoChunk>,
|
20 |
|
|
public IDispatchImpl<ITivoChunk, &IID_ITivoChunk, &LIBID_tivocomLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
|
21 |
|
|
{
|
22 |
|
|
tivo_stream_chunk* m_chunk;
|
23 |
|
|
off_t m_chunkstart;
|
24 |
|
|
CComPtr<ITivoChunk> m_chunk0;
|
25 |
|
|
std::string m_mak;
|
26 |
|
|
bool m_decrypted;
|
27 |
|
|
public:
|
28 |
|
|
CTivoChunk()
|
29 |
|
|
: m_chunk (NULL)
|
30 |
|
|
, m_decrypted (false)
|
31 |
|
|
{
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
BEGIN_COM_MAP(CTivoChunk)
|
36 |
|
|
COM_INTERFACE_ENTRY(ITivoChunk)
|
37 |
|
|
COM_INTERFACE_ENTRY(IDispatch)
|
38 |
|
|
END_COM_MAP()
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
43 |
|
|
|
44 |
|
|
HRESULT FinalConstruct()
|
45 |
|
|
{
|
46 |
|
|
return S_OK;
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
void FinalRelease()
|
50 |
|
|
{
|
51 |
|
|
if (m_chunk)
|
52 |
|
|
free(m_chunk);
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
STDMETHOD(Init)(const std::string & mak, ITivoChunk* chunk0, FILE* fh);
|
56 |
|
|
|
57 |
|
|
public:
|
58 |
|
|
|
59 |
|
|
STDMETHOD(get_chunk_size)(UINT* pVal);
|
60 |
|
|
STDMETHOD(get_data_size)(UINT* pVal);
|
61 |
|
|
STDMETHOD(get_chunk_id)(USHORT* pVal);
|
62 |
|
|
STDMETHOD(get_chunk_type)(USHORT* pVal);
|
63 |
|
|
STDMETHOD(get_data)(BSTR* pVal);
|
64 |
|
|
};
|
65 |
|
|
|
66 |
|
|
//OBJECT_ENTRY_AUTO(__uuidof(TivoChunk), CTivoChunk)
|