On 07/13/2017 08:22 PM, FoxyBrown wrote:
res = EnumServicesStatusExW(schSCManager, SC_ENUM_TYPE.SC_ENUM_PROCESS_INFO, servicesType, SERVICE_STATE_ALL, cast(ubyte*)buf, 50000, &dwBytesNeeded, &dwCount, &resume, cast(const(char)*)null);

The cast to `char*` here looks odd. The 'W' suffix in the function name indicates that it's the UTF-16 variant. It should be taking a `wchar*`, not of a `char*`. This might hint at a wrong declaration which could lead to memory corruption.

(The cast shouldn't be necessary anyway. `null` converts to all pointer types.)

Reply via email to