Discussion:
GetFileAttributes bug in App Verifier 3.4.0158
(too old to reply)
marko
2007-11-27 17:16:11 UTC
Permalink
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);
}
Prasad Kakulamarri [MSFT]
2007-12-05 01:55:00 UTC
Permalink
Hi,
I am not able to reproduce this problem on my machine. What checks did you
enable in AppVerifier?
Thanks,
Prasad
Post by marko
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);
}
marko
2007-12-05 05:48:00 UTC
Permalink
I enabled the default checks (via Ctrl-E) and then disabled LuaPriv. so all
checks were enabled except for Low Resource Simulation and LuaPriv.

thanks,
Mark
Post by Prasad Kakulamarri [MSFT]
Hi,
I am not able to reproduce this problem on my machine. What checks did you
enable in AppVerifier?
Thanks,
Prasad
Post by marko
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);
}
Loading...