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

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

Issue 5281597276291072: Issue #1187 - Do not use MsiViewClose to close view handles (Closed)
Patch Set: Created Jan. 7, 2015, 10:23 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * \file database.h MSI database 2 * \file database.h MSI database
3 */ 3 */
4 4
5 #ifndef DATABASE_H 5 #ifndef DATABASE_H
6 #define DATABASE_H 6 #define DATABASE_H
7 7
8 #include <string> 8 #include <string>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 //------------------------------------------------------- 133 //-------------------------------------------------------
134 /* 134 /*
135 * The MSI database is accessible through a cut-down version of SQL. 135 * The MSI database is accessible through a cut-down version of SQL.
136 * There's no distinction between view and query in this dialect. 136 * There's no distinction between view and query in this dialect.
137 * 137 *
138 * \sa 138 * \sa
139 * - MSDN [Working with Queries](http://msdn.microsoft.com/en-us/library/aa3728 79%28v=vs.85%29.aspx) 139 * - MSDN [Working with Queries](http://msdn.microsoft.com/en-us/library/aa3728 79%28v=vs.85%29.aspx)
140 */ 140 */
141 class View 141 class View
142 { 142 {
143 /** 143 typedef handle< MSIHANDLE, Disallow_Null, MSI_Generic_Destruction > handle_typ e ;
144 * Policy class to close a view handle.
145 * View handles don't get closed with the generic close function for other MSI handles.
146 */
147 template< class T >
148 struct View_Destruction
149 {
150 /**
151 * \sa MSDN [MsiViewClose function](http://msdn.microsoft.com/en-us/library/a a370510%28v=vs.85%29.aspx)
152 */
153 inline static void close( T handle )
154 {
155 ::MsiViewClose( handle ) ;
156 }
157 } ;
158
159 typedef handle< MSIHANDLE, Disallow_Null, View_Destruction > handle_type ;
160 144
161 /** 145 /**
162 * Handle for the MSI view object 146 * Handle for the MSI view object
163 */ 147 */
164 handle_type _handle; 148 handle_type _handle;
165 149
166 public: 150 public:
167 /** 151 /**
168 * Ordinary constructor 152 * Ordinary constructor
169 */ 153 */
(...skipping 25 matching lines...) Expand all
195 * End marker 179 * End marker
196 */ 180 */
197 inline Record end() 181 inline Record end()
198 { 182 {
199 return Record( Record::null_t() ) ; 183 return Record( Record::null_t() ) ;
200 } 184 }
201 } ; 185 } ;
202 186
203 187
204 #endif 188 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld