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

Side by Side Diff: installer/src/installer-lib/test/test-installer-lib-ca.cpp

Issue 29329159: Issue #1185 - Fix formatting in installer-lib and its tests (Closed)
Patch Set: Created Oct. 15, 2015, 7:03 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
1 /** 1 /**
2 * \file abp_ca.cpp Top-level source for custom actions. Includes DLL initializa tion. 2 * \file abp_ca.cpp Top-level source for custom actions. Includes DLL initializa tion.
3 */ 3 */
4 #include "DLL.h" 4 #include "DLL.h"
5 #include <stdexcept> 5 #include <stdexcept>
6 6
7 /** 7 /**
8 * DllMain is the standard entry point call when the DLL is loaded or unloaded. 8 * DllMain is the standard entry point call when the DLL is loaded or unloaded.
9 * 9 *
10 * \param[in] module_handle 10 * \param[in] module_handle
11 * Handle for this instance of the DLL; same as the module handle. 11 * Handle for this instance of the DLL; same as the module handle.
12 * This handle allows us to get the DLL file name for logging. 12 * This handle allows us to get the DLL file name for logging.
13 * \param[in] reason 13 * \param[in] reason
14 * The point in the DLL life cycle at which this call is made. Called "reason code" by Microsoft. 14 * The point in the DLL life cycle at which this call is made. Called "reason code" by Microsoft.
15 * \param[in] reserved 15 * \param[in] reserved
16 * No longer reserved, since it contains a point in the thread life cycle. 16 * No longer reserved, since it contains a point in the thread life cycle.
17 * We aren't using it, though. 17 * We aren't using it, though.
18 18
19 * \sa { http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583%28v=vs .85%29.aspx } 19 * \sa { http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583%28v=vs .85%29.aspx }
20 * Documentation on DLL entry points in Windows. 20 * Documentation on DLL entry points in Windows.
21 */ 21 */
22 extern "C" BOOL WINAPI DllMain( 22 extern "C" BOOL WINAPI DllMain(
23 IN HINSTANCE module_handle, 23 IN HINSTANCE module_handle,
24 IN ULONG reason, 24 IN ULONG reason,
25 IN LPVOID reserved ) 25 IN LPVOID reserved)
26 { 26 {
27 /* 27 /*
28 * Because this is an external API, we must ensure that there is a catch-all b lock for each execution path. There are two of these below. 28 * Because this is an external API, we must ensure that there is a catch-all b lock for each execution path. There are two of these below.
29 */ 29 */
30 switch ( reason ) 30 switch (reason)
31 { 31 {
32 case DLL_PROCESS_ATTACH: 32 case DLL_PROCESS_ATTACH:
33 try 33 try
34 { 34 {
35 DllModule::Attach( module_handle ); 35 DllModule::Attach(module_handle);
36 return TRUE;
37 }
38 catch (...)
39 {
40 // We can't log to the installation log yet, and this couldn't shouldn't be executed except in rare cases such as out-of-memory.
41 // Since it's a lot of code to do something useful (such as logging to t he Windows system event log), we don't do anything but return a failure.
42 return FALSE;
43 }
44 break;
45
46 case DLL_PROCESS_DETACH:
47 try
48 {
49 DllModule::Detach();
50 return TRUE;
51 }
52 catch (...)
53 {
54 // See comment above in parallel catch-block.
55 return FALSE;
56 }
57 break;
58
59 /*
60 * This entry point is called for each thread after the first in a process w ith this DLL loaded. Note "after the first".
61 * The process life cycle is always called, and we do our global initializat ion there. So even though this DLL
62 * doesn't support asynchronous operation, this entry point gets called anyw ay. We need to ignore these calls.
63 */
64 case DLL_THREAD_ATTACH:
65 case DLL_THREAD_DETACH:
36 return TRUE; 66 return TRUE;
37 } 67
38 catch(...) 68 default:
39 {
40 // We can't log to the installation log yet, and this couldn't shouldn't b e executed except in rare cases such as out-of-memory.
41 // Since it's a lot of code to do something useful (such as logging to the Windows system event log), we don't do anything but return a failure.
42 return FALSE; 69 return FALSE;
43 }
44 break;
45
46 case DLL_PROCESS_DETACH:
47 try
48 {
49 DllModule::Detach();
50 return TRUE;
51 }
52 catch(...)
53 {
54 // See comment above in parallel catch-block.
55 return FALSE;
56 }
57 break;
58
59 /*
60 * This entry point is called for each thread after the first in a process wit h this DLL loaded. Note "after the first".
61 * The process life cycle is always called, and we do our global initializatio n there. So even though this DLL
62 * doesn't support asynchronous operation, this entry point gets called anyway . We need to ignore these calls.
63 */
64 case DLL_THREAD_ATTACH:
65 case DLL_THREAD_DETACH:
66 return TRUE;
67
68 default:
69 return FALSE;
70 } 70 }
71 } 71 }
OLDNEW
« no previous file with comments | « installer/src/installer-lib/test/record_test.cpp ('k') | installer/src/installer-lib/test/test-installer-lib-ca.rc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld