marko
2007-11-27 17:16:11 UTC
I have found cases where AV's GetFileAttributes hook incorrectly generates a
"Used a Start menu directory path that was not obtained using an approved
method" warning. see sample code below to reproduce the problem.
my intention is to check if a particular folder exists in the current user's
Start Menu, but doing so causes the false warning.
#include <windows.h>
#include <shlobj.h>
/*--------------------------------------------------------------------------
| WinMain
--------------------------------------------------------------------------*/
int WINAPI WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR pszCmdLine,
int nCmdShow)
{
char sz[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_PROGRAMS, NULL, SHGFP_TYPE_CURRENT, sz);
strcat(sz, "\\bogus folder");
GetFileAttributes(sz);
return (0);
}
"Used a Start menu directory path that was not obtained using an approved
method" warning. see sample code below to reproduce the problem.
my intention is to check if a particular folder exists in the current user's
Start Menu, but doing so causes the false warning.
#include <windows.h>
#include <shlobj.h>
/*--------------------------------------------------------------------------
| WinMain
--------------------------------------------------------------------------*/
int WINAPI WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR pszCmdLine,
int nCmdShow)
{
char sz[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_PROGRAMS, NULL, SHGFP_TYPE_CURRENT, sz);
strcat(sz, "\\bogus folder");
GetFileAttributes(sz);
return (0);
}