Reading and Writing Partial ResourcesYou can use the
SetResourceSizeprocedures to work with a portion of a large resource that may not otherwise fit in memory.
When using partial resource routines, you should call the
loadparameter, before you call
GetResource. Using the
SetResLoadprocedure prevents the Resource Manager from reading the entire resource into memory. Be sure to restore the normal state by calling
SetResLoadagain, with the
loadparameter set to
TRUE, immediately after you call
ReadPartialResourceto read a portion of the resource into a buffer and
WritePartialResourceas needed to write a portion of the resource from a buffer
Note that the partial resources routines work with the data in the memory pointed to by the
bufferparameter, not the memory referenced through the resource's handle. Therefore, you may experience problems if you have a copy of a resource in memory when you are using the partial resource routines. If you have modified the copy in memory and then access the resource on disk using the
ReadPartialResourcereads the data on disk, not the data in memory, which is referenced through the resource's handle. Similarly,
WritePartialResourcewrites data from the specified buffer, not from the data in memory, which is referenced through the resource's handle.