buffer dump analysis

S

ssylee

I'm trying to view the contents of a buffer by dumping it into a log
file. I'm trying to view the content of a PVOID structure that comes
from the return structure of FONTOBJ_pvTrueTypeFontFile (http://
msdn.microsoft.com/en-us/library/ms797533.aspx), but I think I'm
having mainly a programming language problem rather than a problem
dealing with Windows API.

void BufferDump(const char *text, ...)
{
FILE *stream = NULL;
va_list argu;
va_start(argu, text);

// file logging feature
stream = fopen("c:\\BufferDump.txt", "a");
fprintf(stream, text, argu);
// append new lines
fprintf(stream, "\n");
fclose(stream);
}

The result on the logfile is that I am not seeing any output on the
logfile. I'm calling the function by using this line

BufferDump((const char*) fontBuffer);

First of all, am I using this function properly? If yes, do you think
this has to do with a Windows API problem? If not, how would you
suggest me to use this function? Thanks in advance for the advices.
 
S

ssylee

I'm trying to view the contents of a buffer by dumping it into a log
file. I'm trying to view the content of a PVOID structure that comes
from the return structure of FONTOBJ_pvTrueTypeFontFile (http://
msdn.microsoft.com/en-us/library/ms797533.aspx), but I think I'm
having mainly a programming language problem rather than a problem
dealing with Windows API.

void BufferDump(const char *text, ...)
{
        FILE *stream = NULL;
        va_list argu;
        va_start(argu, text);

        // file logging feature
        stream = fopen("c:\\BufferDump.txt", "a");
        fprintf(stream, text, argu);
        // append new lines
        fprintf(stream, "\n");
        fclose(stream);

}

The result on the logfile is that I am not seeing any output on the
logfile. I'm calling the function by using this line

BufferDump((const char*) fontBuffer);

First of all, am I using this function properly? If yes, do you think
this has to do with a Windows API problem? If not, how would you
suggest me to use this function? Thanks in advance for the advices.

Nvm on my previous question. I used the wrong function in the first
place (should've used fwrite).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,170
Messages
2,570,925
Members
47,466
Latest member
DrusillaYa

Latest Threads

Top