| |
| |
| |
| |
| |
| |
| #include <ntapi/nt_status.h> |
| #include <ntapi/nt_blitter.h> |
| #include <ntapi/nt_sync.h> |
| #include <ntapi/ntapi.h> |
| #include "ntapi_blitter.h" |
| #include "ntapi_impl.h" |
| |
| int32_t __fastcall __ntapi_blt_free(nt_blitter * blt_ctx) |
| { |
| int32_t status; |
| void * region_addr; |
| size_t region_size; |
| |
| |
| if (!blt_ctx) return NT_STATUS_INVALID_PARAMETER; |
| |
| |
| region_addr = blt_ctx->info.region_addr; |
| region_size = blt_ctx->info.region_size; |
| |
| if (region_size && !blt_ctx->params.region) { |
| status = __ntapi->zw_free_virtual_memory( |
| NT_CURRENT_PROCESS_HANDLE, |
| ®ion_addr, |
| ®ion_size, |
| NT_MEM_RELEASE); |
| |
| if (status) return status; |
| } |
| |
| |
| region_addr = blt_ctx->addr; |
| region_size = blt_ctx->size; |
| |
| status = __ntapi->zw_free_virtual_memory( |
| NT_CURRENT_PROCESS_HANDLE, |
| ®ion_addr, |
| ®ion_size, |
| NT_MEM_RELEASE); |
| |
| return status; |
| } |