Changeset 13835 in vbox for trunk/src/VBox/Main/win
- Timestamp:
- Nov 5, 2008 2:34:43 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38826
- Location:
- trunk/src/VBox/Main/win
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/win/svchlp.cpp
r8155 r13835 38 38 * FALSE... This method ensures that at least VERR_GENERAL_FAILURE is returned 39 39 * in cases like that. Intended to be called immediately after a failed API 40 * call. 40 * call. 41 41 */ 42 42 static inline int rtErrConvertFromWin32OnFailure() … … 44 44 DWORD err = GetLastError(); 45 45 return err == NO_ERROR ? VERR_GENERAL_FAILURE 46 : RTErrConvertFromWin32 (err); 46 : RTErrConvertFromWin32 (err); 47 47 } 48 48 … … 97 97 98 98 Bstr pipeName = Utf8StrFmt ("\\\\.\\pipe\\%s", aName); 99 99 100 100 HANDLE pipe = CreateFile (pipeName, 101 101 GENERIC_READ | GENERIC_WRITE, … … 114 114 mWriteEnd = pipe; 115 115 mName = aName; 116 116 117 117 return VINF_SUCCESS; 118 118 } … … 148 148 mReadEnd = NULL; 149 149 } 150 150 151 151 mIsOpen = false; 152 152 mIsServer = false; 153 153 mName.setNull(); 154 154 155 155 return VINF_SUCCESS; 156 156 } … … 174 174 if (!mIsOpen) 175 175 return VERR_WRONG_ORDER; 176 176 177 177 /* write -1 for NULL strings */ 178 178 if (aVal.isNull()) 179 179 return write ((size_t) ~0); 180 180 181 181 size_t len = aVal.length(); 182 182 183 183 /* write string length */ 184 184 int vrc = write (len); 185 if ( VBOX_SUCCESS (vrc))185 if (RT_SUCCESS (vrc)) 186 186 { 187 187 /* write string data */ … … 216 216 if (!mIsOpen) 217 217 return VERR_WRONG_ORDER; 218 218 219 219 size_t len = 0; 220 220 221 221 /* read string length */ 222 222 int vrc = read (len); 223 if ( VBOX_FAILURE (vrc))223 if (RT_FAILURE (vrc)) 224 224 return vrc; 225 225 226 226 /* length -1 means a NULL string */ 227 227 if (len == (size_t) ~0) … … 230 230 return VINF_SUCCESS; 231 231 } 232 232 233 233 aVal.alloc (len + 1); 234 234 aVal.mutableRaw() [len] = 0; 235 235 236 236 /* read string data */ 237 237 vrc = read (aVal.mutableRaw(), len); … … 244 244 Utf8Str guidStr; 245 245 int vrc = read (guidStr); 246 if ( VBOX_SUCCESS (vrc))246 if (RT_SUCCESS (vrc)) 247 247 aGuid = Guid (guidStr); 248 248 return vrc; … … 259 259 int vrc = VINF_SUCCESS; 260 260 SVCHlpMsg::Code msgCode = SVCHlpMsg::Null; 261 261 262 262 do 263 { 263 { 264 264 vrc = read (msgCode); 265 if ( VBOX_FAILURE (vrc))265 if (RT_FAILURE (vrc)) 266 266 return vrc; 267 267 268 268 /* terminate request received */ 269 269 if (msgCode == SVCHlpMsg::Null) … … 283 283 VERR_GENERAL_FAILURE); 284 284 } 285 286 if ( VBOX_FAILURE (vrc))285 286 if (RT_FAILURE (vrc)) 287 287 return vrc; 288 288 } 289 289 while (1); 290 290 291 291 /* we never get here */ 292 292 AssertFailed(); -
trunk/src/VBox/Main/win/svcmain.cpp
r13580 r13835 243 243 vrc = VERR_INVALID_PARAMETER; 244 244 245 if ( VBOX_SUCCESS (vrc))245 if (RT_SUCCESS (vrc)) 246 246 { 247 247 /* do the helper job */ 248 248 SVCHlpServer server; 249 249 vrc = server.open (pipeName); 250 if ( VBOX_SUCCESS (vrc))250 if (RT_SUCCESS (vrc)) 251 251 vrc = server.run(); 252 252 } 253 if ( VBOX_FAILURE (vrc))253 if (RT_FAILURE (vrc)) 254 254 { 255 255 Utf8Str err = Utf8StrFmt (
Note:
See TracChangeset
for help on using the changeset viewer.