Debian Codegraph @

sys/qsv/libmfx/dispatcher/windows/mfx_driver_store_loader.h

raw symbols SCIP
1 /*############################################################################
2 # Copyright (C) Intel Corporation
3 #
4 # SPDX-License-Identifier: MIT
5 ############################################################################*/
6
7 #ifndef DISPATCHER_WINDOWS_MFX_DRIVER_STORE_LOADER_H_
8 #define DISPATCHER_WINDOWS_MFX_DRIVER_STORE_LOADER_H_
9
10 #include <windows.h>
11
12 #include <cfgmgr32.h>
13
14 // support building in MinGW environments with older versions of cfgmgr32
15 #ifdef __MINGW32__
16 #if !defined(CM_GETIDLIST_FILTER_PRESENT)
17 #define CM_GETIDLIST_FILTER_PRESENT 0x00000100
18 #endif
19 #if !defined(CM_GETIDLIST_FILTER_CLASS)
20 #define CM_GETIDLIST_FILTER_CLASS 0x00000200
21 #endif
22 #endif
23
24 #include <devguid.h>
25
26 #include "windows/mfx_dispatcher_defs.h"
27
28 namespace MFX {
29
30 typedef CONFIGRET(WINAPI *Func_CM_Get_Device_ID_List_SizeW)(PULONG pulLen,
31 PCWSTR pszFilter,
32 ULONG ulFlags);
33 typedef CONFIGRET(WINAPI *Func_CM_Get_Device_ID_ListW)(PCWSTR pszFilter,
34 PZZWSTR Buffer,
35 ULONG BufferLen,
36 ULONG ulFlags);
37 typedef CONFIGRET(WINAPI *Func_CM_Locate_DevNodeW)(PDEVINST pdnDevInst,
38 DEVINSTID_W pDeviceID,
39 ULONG ulFlags);
40 typedef CONFIGRET(WINAPI *Func_CM_Open_DevNode_Key)(DEVINST dnDevNode,
41 REGSAM samDesired,
42 ULONG ulHardwareProfile,
43 REGDISPOSITION Disposition,
44 PHKEY phkDevice,
45 ULONG ulFlags);
46
47 class DriverStoreLoader {
48 public:
49 DriverStoreLoader(void);
50 ~DriverStoreLoader(void);
51
52 bool GetDriverStorePath(wchar_t *path,
53 DWORD dwPathSize,
54 mfxU32 deviceID,
55 const wchar_t *driverKey);
56
57 protected:
58 bool LoadCfgMgr();
59 bool LoadCmFuncs();
60
61 mfxModuleHandle m_moduleCfgMgr;
62 Func_CM_Get_Device_ID_List_SizeW m_pCM_Get_Device_ID_List_Size;
63 Func_CM_Get_Device_ID_ListW m_pCM_Get_Device_ID_List;
64 Func_CM_Locate_DevNodeW m_pCM_Locate_DevNode;
65 Func_CM_Open_DevNode_Key m_pCM_Open_DevNode_Key;
66
67 private:
68 // unimplemented by intent to make this class non-copyable
69 DriverStoreLoader(const DriverStoreLoader &);
70 void operator=(const DriverStoreLoader &);
71 };
72
73 } // namespace MFX
74
75 #endif // DISPATCHER_WINDOWS_MFX_DRIVER_STORE_LOADER_H_