Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Memory to IStream
Author:Arkon
Category:Win32API
File Size:304 Bytes
Uploaded at:19-Aug-06 06:31:39 am
Description:
  Sometimes you encounter functions which require an IStream instead of raw data. This snippet will show you how to convert raw data into an IStream.
  
IStream* pStream = NULL;
char buf[] = "hello IStream";
HGLOBAL hBlock = GlobalAlloc(PTR, sizeof(buf));
if (hBlock == NULL) // err
if (SUCCEEDED(CreateStreamOnHGlobal(hBlock, FALSE, &pStream)) {
 // Do something with pStream

 // Release
 pStream->Release();
}
// Free block
GlobalFree(hBlock);
User Contributed Comments(1)
 [1] Sim_might | 2011-02-16 22:53:53

Hi,Thank you for your open source tools,you know , OllyDBG 2.0 do'nt for Win 64. Last, My english is very poor.
  form Sim_might China.
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[106236]
2D Rotated Rectangles Collision Detection[79394]
Keyboard Hook[68784]
UDP[52867]
HTTP Proxy[36098]

::Top 5 Samples::
2D ColDet Rotated Rectangles[10613]
PS2 Mouse Driver[6098]
Wave Format Player[4984]
Reading FAT12[4870]
CodeGuru[4561]


All rights reserved to RageStorm © 2009