summaryrefslogtreecommitdiffstats
path: root/private/unimodem/new/mic/dev.h
blob: 695571f355c7f472fd60533ba224eef93e62f2a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//
//		Copyright (c) 1996 Microsoft Corporation
//
//
//		DEV.H		-- Header for Classes:
//							CInfDevice
//							
//
//		History:
//			05/22/96	JosephJ		Created
//
//


class	CInfDevice;


///////////////////////////////////////////////////////////////////////////
//		CLASS CInfDevice
///////////////////////////////////////////////////////////////////////////
//
//	Represents a single device, as specified by an inf (device information)
//	file.
//

class CInfDevice
{

public:

	CInfDevice(const CInfDevice *pNext)
		:	m_pNext(pNext),
			m_sync(),

			m_pvInfSession(NULL),
			m_pInfFile(NULL),
			m_pManufacturerEntry(NULL),
			m_pModelEntry(NULL),
			m_pVersion(NULL),
			m_pSymManufacturerName(NULL),
			m_pSymDeviceName(NULL),
			m_pAddRegList(NULL),
			m_pCopyFilesList(NULL),

			m_dwSigVersion(101),
			m_dwSigManuAndModel(102),
			m_dwSigFlags(103),
			m_dwSigAddReg(104),
			m_dwSigCopyFiles(105),
			m_dwSigDup(106),
			m_dwSigRank0(107),
			m_dwSigRanks(108),
			m_dwSigAll(109)
		{}

	~CInfDevice()	{}

	// ---------------	Dump	---------------
	// Dump state
	void Dump(void) const;

	// ---------------	Load	---------------
	// Load (init) the device specifed by the inf file and model entry.
	BOOL	Load (
					const CInfFile *pInf,
					const CInfManufacturerEntry *pManuE,
					const CInfModelEntry	*pModelE
				 );

	//--------------	Unload			------------------
	// Unloads a previously loaded file. If there are open sessions to this
	// object, Unload returns a handle which will be signalled when all
	// sessions are closed. New sessions will not be allowed after this
	// function returns. The call should free the handle.
	HANDLE Unload	(void);

	//--------------	WriteInf		------------------
	// Creates an inf file with all the information of this device.
	BOOL	WriteInf(LPCTSTR lpctszIniFile) const;

	//--------------	GetRank0Checksum		----------
	// Returns signature of the rank0 ID
	DWORD	Rank0Checksum(void) const {return m_dwSigRank0;}

	//--------------	Checksum		    --------------
	// Returns combined checksum for this device.
	DWORD	Checksum(void) const		{return m_dwSigAll;}

	#if (TODO)
	UpdateInisSection
	UninstallSection
	NoResDupIDList
	PosDupIDList
	#endif // (TODO)


private:

	const	CInfDevice			* m_pNext;
	CSync						m_sync;

	const	void				* m_pvInfSession;

	const	CInfFile 			* m_pInfFile;
	const	CInfManufacturerEntry *m_pManufacturerEntry;
	const	CInfModelEntry		* m_pModelEntry;

	const	CInfVersionSection	* m_pVersion;
	const	CInfSymbol 			* m_pSymManufacturerName;
	const	CInfSymbol 			* m_pSymDeviceName;

	const	CInfList			* m_pAddRegList;
	const	CInfList			* m_pCopyFilesList;

	BOOL	mfn_CreateAddRegList	(const	CInfModelEntry	*);
	BOOL 	mfn_CreateCopyFilesList	(const	CInfModelEntry	*);
	void	mfn_AddToAddRegList		(const CInfAddRegEntry *);
	void	mfn_AddToCopyFilesList	(const CInfCopyFilesEntry *);
	void	mfn_Cleanup				(void);
	BOOL	mfn_write_header		(LPCTSTR lpctszIniFile) const;

	void mfn_EnterCrit(void)	const	{m_sync.EnterCrit();}
	void mfn_LeaveCrit(void)	const	{m_sync.LeaveCrit();}

	DWORD	m_dwSigVersion;		// Checksum of version section
	DWORD	m_dwSigManuAndModel;// Checksum of manufacturer name & model name
	DWORD	m_dwSigFlags;		// Group-checksum of control flags.
	DWORD	m_dwSigAddReg;		// Group-checksum of add reg section
	DWORD	m_dwSigCopyFiles;	// Group-checksum of copyfile section
	DWORD	m_dwSigDup;			// Group-checksum of NoResDup and PosDup.
	DWORD	m_dwSigRank0;		// Group-checksum of all ranks.
	DWORD	m_dwSigRanks;		// Group-checksum of all ranks.
	DWORD	m_dwSigAll;			// Checksum of all the info of this device
								// including version, manufacturer-name &
								// model-name
};