summaryrefslogtreecommitdiff
path: root/rbutil/sansapatcher/sansaio-win32.c
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-01 13:23:47 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-01-01 15:06:41 +0100
commit163ab4617096edb6384aa8fc7a764d440aee3fb9 (patch)
treeca0e49f5c184aa4def60bcca7f17f0653f45eb6e /rbutil/sansapatcher/sansaio-win32.c
parenta8d291bd20428a59d29b886b7b1403261f9e5af3 (diff)
downloadrockbox-163ab4617096edb6384aa8fc7a764d440aee3fb9.tar.gz
rockbox-163ab4617096edb6384aa8fc7a764d440aee3fb9.zip
Provide dealloc function to sansapatcher.
Similar as done with ipodpatcher provide a function to free the allocated sector buffer. Change-Id: Ie51e82f7191496bb48973148af1cc35cd37993d3
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)
162 return 0; 162 return 0;
163} 163}
164 164
165int sansa_dealloc_buffer(struct sansa_t* sansa)
166{
167 if (sansa->sectorbuf == NULL) {
168 return -1;
169 }
170 if(!VirtualFree(sansa->sectorbuf, 0, MEM_RELEASE)) {
171 sansa_print_error(" Error releasing buffer ");
172 return -1;
173 }
174 sansa->sectorbuf = NULL;
175 return 0;
176}
177
165int sansa_seek(struct sansa_t* sansa, loff_t pos) 178int sansa_seek(struct sansa_t* sansa, loff_t pos)
166{ 179{
167 LARGE_INTEGER li; 180 LARGE_INTEGER li;