Skip to content

[drmingw] Patch to add ability to set the Report File location in exchndl.dll #38

@GoogleCodeExporter

Description

@GoogleCodeExporter
exchndl.dll currently will produces a `modulename.RPT` crash report file in the 
same directory as the executable that launched the process.

This is problematic on Windows Vista / 7 due to the new permissions model for 
installed applications (user processes are not allowed to write to Program 
Files, etc.).

The attached patch adds a new function to exchndl.c that can be used to set the 
target location for the report file.

Here is an example of how it can be used:

HMODULE hmod;
if ((hmod = LoadLibraryW(L"exchndl.dll"))) {
    FARPROC proc;
    char debug_dir[MAX_PATH];
    printf("Loaded exchndl.dll\n");
    proc = GetProcAddress(hmod, "SetLogFile");
    if (proc) {
        if (GetTempPathA(sizeof(debug_dir) * sizeof(char), debug_dir) != 0) {
            strcat(debug_dir, "crash.RPT");
            printf(" Setting exchndl.dll LogFile to %s\n",
                debug_dir);
            (proc)(debug_dir);
        }
    }
}

Original issue reported on code.google.com by daniel.a...@gmail.com on 28 Aug 2010 at 1:30

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions