summaryrefslogtreecommitdiffstats
path: root/rbutil/sansapatcher/sansaio-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/sansapatcher/sansaio-win32.c')
-rw-r--r--rbutil/sansapatcher/sansaio-win32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rbutil/sansapatcher/sansaio-win32.c b/rbutil/sansapatcher/sansaio-win32.c
index 256712fe20..ee6a8cd93d 100644
--- a/rbutil/sansapatcher/sansaio-win32.c
+++ b/rbutil/sansapatcher/sansaio-win32.c
@@ -162,6 +162,19 @@ int sansa_alloc_buffer(struct sansa_t* sansa, int bufsize)
return 0;
}
+int sansa_dealloc_buffer(struct sansa_t* sansa)
+{
+ if (sansa->sectorbuf == NULL) {
+ return -1;
+ }
+ if(!VirtualFree(sansa->sectorbuf, 0, MEM_RELEASE)) {
+ sansa_print_error(" Error releasing buffer ");
+ return -1;
+ }
+ sansa->sectorbuf = NULL;
+ return 0;
+}
+
int sansa_seek(struct sansa_t* sansa, loff_t pos)
{
LARGE_INTEGER li;