SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path
-
I've got DLL which invokes SHGetSpecialFolderPath() function with CSIDL_LOCAL_APPDATA parameter in DLL load handler. When the DLL is loaded from windows application, ASP.NET application, or windows service and queried that special folder, it returns different locations for that special folder. Moreover in XP and Vista those locations are different. Is there a way to find out these locations with some specific function when invoked from windows application?
Чесноков
-
I've got DLL which invokes SHGetSpecialFolderPath() function with CSIDL_LOCAL_APPDATA parameter in DLL load handler. When the DLL is loaded from windows application, ASP.NET application, or windows service and queried that special folder, it returns different locations for that special folder. Moreover in XP and Vista those locations are different. Is there a way to find out these locations with some specific function when invoked from windows application?
Чесноков
-
Correct me if im wrong but SHGetSpecialFolderPath() returns a userrelated folder. The organization of users is different on XP then under Vista. This is the reason you will get different folders. But what is your problem with that? Rozis
yes, user related folder, I know it is different. >>Is there a way to find out these 3 locations with some specific function when invoked from windows application?
Чесноков
-
yes, user related folder, I know it is different. >>Is there a way to find out these 3 locations with some specific function when invoked from windows application?
Чесноков
Chesnokov Yuriy wrote:
>>Is there a way to find out these 3 locations with some specific function when invoked from windows application?
No function may be available to do this. Because you are trying to access a different user's profile directory, what if the user is an Active Directory user account, and user profile's directory is on a network drive? What are you trying to implement? there should be some better solution than accessing another user's profile directory.
-Suhredayan
-
Chesnokov Yuriy wrote:
>>Is there a way to find out these 3 locations with some specific function when invoked from windows application?
No function may be available to do this. Because you are trying to access a different user's profile directory, what if the user is an Active Directory user account, and user profile's directory is on a network drive? What are you trying to implement? there should be some better solution than accessing another user's profile directory.
-Suhredayan
I need a special folder that already has r/w access for particular user on that computer (either ASP.NET user, service application user, windows application user)
Чесноков
-
I need a special folder that already has r/w access for particular user on that computer (either ASP.NET user, service application user, windows application user)
Чесноков
Chesnokov Yuriy wrote:
I need a special folder that already has r/w access for particular user on that computer (either ASP.NET user, service application user, windows application user)
Do you mean a user_profile directory where all the three users have read/write access? if then use: CSIDL_COMMON_APPDATA with SHGetSpecialFolderPath()
-Suhredayan
-
Chesnokov Yuriy wrote:
I need a special folder that already has r/w access for particular user on that computer (either ASP.NET user, service application user, windows application user)
Do you mean a user_profile directory where all the three users have read/write access? if then use: CSIDL_COMMON_APPDATA with SHGetSpecialFolderPath()
-Suhredayan
in Vista it points to c:\ProgramData and it is not write access enabled :)
Чесноков
-
in Vista it points to c:\ProgramData and it is not write access enabled :)
Чесноков
Chesnokov Yuriy wrote:
in Vista it points to c:\ProgramData and it is not write access enabled Smile
My bad, I assumed it being all user's profile folder, every user may have read/write permission to it. But on a second thought if that was true - then it would introduces security issues - imagine if a non-admin user logs in to the machine and installs an .exe into all_user's_startup folder. Next time administrator logs-in, the same .exe would run under administrator's security privilege. This might be one reason the default location/name of this folder is changed in Vista, to make more sense. :) It seems you may need to create/identify a folder, and have the permission set during the installation - either through your program, or as instruction to the person installing your app. That is the best I can think of - I know that might be something you may already have in your mind as a last option.
-Suhredayan