buffer dump analysis

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ssylee

    buffer dump analysis

    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_pvTrueT ypeFontFile (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(cons t char *text, ...)
    {
    FILE *stream = NULL;
    va_list argu;
    va_start(argu, text);

    // file logging feature
    stream = fopen("c:\\Buff erDump.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((con st 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.
  • ssylee

    #2
    Re: buffer dump analysis

    On Aug 11, 3:15 pm, ssylee <staniga...@gma il.comwrote:
    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_pvTrueT ypeFontFile (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(cons t char *text, ...)
    {
            FILE *stream = NULL;
            va_list argu;
            va_start(argu, text);
    >
            // file logging feature
            stream = fopen("c:\\Buff erDump.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((con st 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).

    Comment

    Working...