createCacheRequest method
Creates a cache request.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomation-createcacherequest.
Implementation
IUIAutomationCacheRequest? createCacheRequest() {
final cacheRequest = adaptiveCalloc<VTablePointer>();
final hr$ = HRESULT(_CreateCacheRequestFn(ptr, cacheRequest));
if (hr$.isError) {
free(cacheRequest);
throw WindowsException(hr$);
}
final result$ = cacheRequest.value;
free(cacheRequest);
if (result$.isNull) return null;
return .new(result$);
}