[Base] Check success of sync primitive creation
- Mainly use `assert`s, since failure is very rare - Forward failure of `CreateSemaphore` to guests because it is more easy to trigger with invalid initial parameters.
This commit is contained in:
@@ -590,7 +590,13 @@ dword_result_t NtCreateSemaphore_entry(lpdword_t handle_ptr,
|
||||
}
|
||||
|
||||
auto sem = object_ref<XSemaphore>(new XSemaphore(kernel_state()));
|
||||
sem->Initialize((int32_t)count, (int32_t)limit);
|
||||
if (!sem->Initialize((int32_t)count, (int32_t)limit)) {
|
||||
if (handle_ptr) {
|
||||
*handle_ptr = 0;
|
||||
}
|
||||
sem->ReleaseHandle();
|
||||
return X_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// obj_attributes may have a name inside of it, if != NULL.
|
||||
if (obj_attributes_ptr) {
|
||||
|
||||
Reference in New Issue
Block a user