We probably need to check error value here:
```
if (* pError != ErrorNone)
  return NULL;
```