Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 206 of file dbgchnl.c.
Referenced by DebugChannels_FillList(), and DebugChannels_OnNotify().
{ struct dll_option_layout dol; int ret = 1; void* buf_addr; WCHAR buffer[32]; void* addr; WCHAR** cache = NULL; unsigned i, j, num_cache, used_cache; addr = get_symbol(hProcess, "first_dll", "libwine.so"); if (!addr) return -1; if (unique) cache = HeapAlloc(GetProcessHeap(), 0, (num_cache = 32) * sizeof(WCHAR*)); else num_cache = 0; used_cache = 0; for (; ret && addr && ReadProcessMemory(hProcess, addr, &dol, sizeof(dol), NULL); addr = dol.next) { for (i = 0; i < dol.nb_channels; i++) { if (ReadProcessMemory(hProcess, (void*)(dol.channels + i), &buf_addr, sizeof(buf_addr), NULL) && ReadProcessMemory(hProcess, buf_addr, buffer, sizeof(buffer), NULL)) { if (unique) { /* since some channels are defined in multiple compilation units, * they will appear several times... * so cache the channel's names we already reported and don't report * them again */ for (j = 0; j < used_cache; j++) if (!wcscmp(cache[j], buffer + 1)) break; if (j != used_cache) continue; if (used_cache == num_cache) cache = HeapReAlloc(GetProcessHeap(), 0, cache, (num_cache *= 2) * sizeof(WCHAR*)); cache[used_cache++] = wcscpy(HeapAlloc(GetProcessHeap(), 0, (wcslen(buffer + 1) + 1) * sizeof(WCHAR)), buffer + 1); } ret = ce(hProcess, buf_addr, buffer, user); } } } if (unique) { for (j = 0; j < used_cache; j++) HeapFree(GetProcessHeap(), 0, (WCHAR*)cache[j]); HeapFree(GetProcessHeap(), 0, cache); } return 0; }