On 11/19/18 6:11 AM, Zhiyi Zhang wrote:
- length = strlenW(path);
- if (length + 1 > PATHCCH_MAX_CCH)
- {
*extension = NULL;
return E_INVALIDARG;
- }
This doesn't look right. If it takes buffer length, that's the limit we should use. So if you have to iterate you should probably stop at this give limit.
- next = path;
- while (*next)
- {
if (*next == '\\' || *next == ' ')
lastpoint = NULL;
else if (*next == '.')
lastpoint = next;
next++;
- }
We'll need a test for size < length, and probably for forward slash too.
- if (!pPathCchFindExtension)
- {
win_skip("PathCchFindExtension() is not available.\n");
return;
- }
Maybe we can get rid of this, because it will never trigger if kernelbase is available. Probably 'hmod' check is enough to skip everything.