locked
Updateresource problems RRS feed

  • Question

  • I am using updateresource function with my vb.net program. Nut it dosnt work i get access is denied error .

     

    I have searched all over internet people are also having many problems with updateresource api on vista/7

     

    I want to update the resources of imageres.dll file . It's language id is 1033(english) and i know resource name etc. Everything is correct. The problem is with the security i think.

    I want to directly update the resources of this file. I have seen many program doing this task like stardock's logon studio . I also kill explorer.exe process which uses imageres.dll file but still i get access is denied error . SO what really is the problem

    i AM running program as administrator. I have taken the ownership of file and disabled uac .

    • Moved by Jesse Jiang Tuesday, October 26, 2010 6:41 AM (From:Visual C++ General)
    Sunday, October 24, 2010 9:51 AM

All replies

  • Not sure why you post here instead of the Windows Security Programming Forum, your question has nothing to do with VB.Net or C++.

    Disabling UAC only remove the prompt. It does not grant you any security permissions or close a running process that use the dll. What do you mean "run as administrator"? log in as administrator is not enough. You need to run your program elevated and make sure it is not locked by running programs.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Sunday, October 24, 2010 1:52 PM
  • I also ran process explorer to see if the file is in use . It was in use of explorer.exe i killed it and then tried  still same error

    Sunday, October 24, 2010 3:35 PM
  • Besides the Windows Permissions you also need .Net full trust permission to call native functions.  Not sure if you have that permission.

    The forum for .Net security is the CLR forum under the .Net development category.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Sunday, October 24, 2010 3:38 PM
  • "Besides the Windows Permissions you also need .Net full trust permission to call native functions.  Not sure if you have that permission."

    What do you mean by .net full trust permission ?

    Sunday, October 24, 2010 4:04 PM
  • "Besides the Windows Permissions you also need .Net full trust permission to call native functions.  Not sure if you have that permission."

    What do you mean by .net full trust permission ?

    Sunday, October 24, 2010 4:05 PM
  • http://msdn.microsoft.com/en-us/library/system.security.permissions.securityaction.aspx

    You can isolate the cause by writing a small native program that calls UpdateResource (or just use a program that calls UpdateResource, such as Visual Studio 2008). If you have the same issue in a native program then it is Windows permission, if you don't then it is .Net permission.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Sunday, October 24, 2010 4:09 PM
  • It's very confsing for me can you show me an exmple i am only 14
    Sunday, October 24, 2010 4:11 PM
  • and also is there any tool  on this earth which allows me to see changes made a selected application when running.

    Like which files does it create

    which registry values it change

    Sunday, October 24, 2010 4:16 PM
  • Can you use Process Moniter to verify access to the file is denied by Windows?  If you cannot find an access denied log then the cause could be locking or .Net permission.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Sunday, October 24, 2010 4:22 PM
  • nice program what next to do ?

    Sunday, October 24, 2010 4:31 PM
  • In the filter menu select filters.. then add a filter that includes only logs that has a path containing the file name you are interested in. Run your program and when UpdateResource failed, check the access log in the monitor window. There is a result column that should say access denied or share violation if the denial is from Windows's file system.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Sunday, October 24, 2010 4:35 PM
  • thank you i will be updating you
    Sunday, October 24, 2010 4:48 PM
  • @sheng it is complicated i mean program . I go to filter menu - filter - add option . What do i select from dropdown lists and what name should i give .
    Monday, October 25, 2010 9:27 AM
  • Path, contains, enter file name.

    If the file is under Windows File protection then you should not update the file - your change can be lost during the next Windows update.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Monday, October 25, 2010 10:33 AM
  • Okay 1 more thing let's say i want to test if a program called logonstudio creates any fille on my computer what do i need to do
    Monday, October 25, 2010 12:45 PM
  • it is wiered . for imageres.dll there are so many files . How dio i figute out which file ?
    Monday, October 25, 2010 12:50 PM