Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: installer/src/installer-lib/DLL.h

Issue 22887001: Custom action library, initial version (Closed)
Patch Set: Created Oct. 28, 2013, 9:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /**
2 * \file DLL.h The DLL as a Windows system module.
3 */
4
5 #ifndef DLL_H
6 #define DLL_H
7
8 #include <memory>
9 #include <string>
10
11 #include "windows.h"
12
13 /**
14 * Singleton representing the DLL module. This class is the source of the file n ame for the custom action library, used in logging.
15 * The choice to use a singleton reflects the design of the Windows API, which t reats the module handle as a global for the DLL instance,
16 * only appearing during the calls that manage the lifetime of the DLL.
17 */
18 class DLL_Module
19 {
20 public:
21 /**
22 * Accessor function for the singleton.
23 */
24 static DLL_Module & module();
25
26 /**
27 * Hook function to call on DLL attach.
28 */
29 static void attach( HINSTANCE handle );
30
31 /**
32 * Hook function to call on DLL detach.
33 */
34 static void detach();
35
36 /**
37 * Textual name of the DLL as an OS module.
38 */
39 std::wstring name();
40
41 private:
42 /**
43 * The singleton value.
44 */
45 static std::shared_ptr< DLL_Module > singleton;
46
47 /**
48 * Private constructor ensures use of accessor function only.
49 */
50 DLL_Module( HINSTANCE handle );
51
52 /**
53 * Windows handle for the instance of the DLL.
54 */
55 HINSTANCE handle;
56
57 /**
58 * The text name of the module.
59 *
60 * Implemented as a smart pointer for deferred evaluation of the system call t o get the module name.
61 */
62 std::shared_ptr< std::wstring > _name;
63 };
64
65 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld