"James Hawkins" truiken@gmail.com writes:
+HRESULT WINAPI SetPerUserSecValuesA(PERUSERSECTIONA* pPerUser) +{
- PERUSERSECTIONW perUserW;
- if (!pPerUser)
return E_INVALIDARG;
- TRACE("(%p)\n", pPerUser);
- /* lengths copied from PERUSERSECTION structure definition */
- MultiByteToWideChar(CP_ACP, 0, pPerUser->szGUID, 59, perUserW.szGUID, 59);
- MultiByteToWideChar(CP_ACP, 0, pPerUser->szDispName, 128, perUserW.szDispName, 128);
- MultiByteToWideChar(CP_ACP, 0, pPerUser->szLocale, 10, perUserW.szLocale, 10);
- MultiByteToWideChar(CP_ACP, 0, pPerUser->szStub, MAX_PATH * 4, perUserW.szStub, MAX_PATH * 4);
- MultiByteToWideChar(CP_ACP, 0, pPerUser->szVersion, 32, perUserW.szVersion, 32);
- MultiByteToWideChar(CP_ACP, 0, pPerUser->szCompID, 128, perUserW.szCompID, 128);
The source lengths are wrong, these are null-terminated strings. Also please use sizeof() instead of hardcoding the constants.