BUG: ????? ???? "0xC0000005" ??? ????? ??? ????? ??? ???? ?? unhooked

?????? ????????? ?????? ?????????
???? ???????: 811193 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

??? ????? ????? __raise ?? unhook ??????? (__unhook) ?????? ?? ??? ??????? ??? ???? ?? ????? ????? ????? ???????:
unhandled ????????? ?? virtual address ?? executable: 0xC0000005: ????? ???? virtual address ??? ??????
??? virtual address "?" executable ????? ?????? ??????? ????? ??.

?????

????? ??? ??????? ??? ????? ????? ???? ????? ???? ?????? ???. ?? ??? ????? ????? ????? ??????? ?? ???? ???? ????? ?? ????? ????????? ???????? ???? ?? ???????. ????? ???? ??? ???? ??? ?????? ??? ??????? ??? ?????.

???? ??????

??????? ?????? ??? ??? ??????? ?????? ???? ????? ???????:

??????? ??????

????? ????? ???? ????? ?? ????? ???. ?????? ????? ?? ???????? ????????? ???????? ????????: ?????
struct A {
	__event void Event(); 
	A(); 
	void bar(){} 
};
//Constructor defined outside class scope.
A::A() { } 
???????? ????????? ???????? ???????: ?????
struct A {
	__event void Event(); 
	A() { }; //Contructor defined in class scope.
	void bar(){} 
};

??????? ???????

????? ??? ??????? eventHandlerList ?? ???? ???? ?????. ????? ??? ?? ????? .cpp ???? ????? ??? ????? ??? ???? ????? event.cpp. ???? ????? ????? ????????? ???????? ???? ?? ?????? ?????? ?????? ??????? ???? ?? ??????? ?? ??? ?????? ?? ??????? ???? ?????? ??????? ??????? /Fx ??? ???????.
  1. ?? ???? ???????? ???? ????? ??????:
    cl /Fx event.cpp
    ??? ??? ????? ????????? ???????? ???? ?? ?????? ?????? ?????? ??????? ???? ?? ??????? ?? ??? ??. ???? mrg.cpp. ??????? event.cpp ? ?? ????? ???? ????? ??? ????? ????????? ???????? ???? ?? ??????? event.mrg.cpp.
  2. ?? ??? ???????? ???? ??? ?????? (event.mrg.cpp) ????? ???????? ???????? ??????? ??? ????? ???? ?????:
    • ??? ?? ????? ??? ???? ????? ???? ???? A ?? ????? ??? X ? ?? ?????? ????????? ???????? ???????:
      __eventHandlerList_X_A_Event = 0;
      ????? ??? ??.
    • ??? ?? ??? ????? ??? ???? ????? ???? ???? A ?? ?? ????? ??? ?????? ???????? ???????? ???????:
      __eventHandlerList_A_Event = 0;
      ????? ??? ??.
    ??? A ??? ???? ????? X ?? ????? ??? ??? ?? ???? ??? ?? ????? ????? ?????? ?????? ???????? __event ????? ??? ????.
  3. ????? ??? ???????? ?? ???? ??????? ???????? ????? ??????:
    cl event.mrg.cpp

?????

???? Microsoft ?? ??? ??? ?? ?????? Microsoft ??????? ?? ????? ??? ???????.

??????? ????

????? ????? ????? ?? ????


???? ????? ????? ??????? ?? ?? ?? ????? ????????? ????? ???????:

????????? 1

????? ???? ??? ???? ????? ???. ???????? ??? ???? ??? ????? ???? ????? ???????? ????? ?????? ??? ????? ?? ??????. ?????? ????? ???? ??????? ???????:
  1. ?? Visual Studio .NET ? ????? ???? ???? Win32 C++ Visual ??????? ???????.
  2. ?? .cpp ??? ????????? ???? ?? ?????? ??????? ????? ??, ?????? ????????? ???????? ???????? ???????? ???????? ???????:
    #include "stdafx.h"
    namespace X 
    { 
    //Both event source and event receiver
    	struct A {
    	 	__event void Event(); 
    		A(); 
    		void bar(){} 
    	};
    }
     
    X::A::A() { } 
    
    int main()
    { 
    	X::A a; 
    	__hook(&X::A::Event, &a, &X::A::bar, &a); 
    	a.Event(); 
    	__unhook(&X::A::Event, &a, &X::A::bar, &a); 
    } 
  3. ?????? ??????? ???????.
???? ????? ????? ??????? ?? ??? "???????" ?? ??? ???????.

????????? 2

????? ???? ????? ???????? ????? ?? ???? ?????? ?? ???????. ?????? ????? ???? ??????? ???????:
  1. ?? Visual Studio .NET ? ????? ???? ???? Win32 C++ Visual ??????? ???????.
  2. ?? .cpp ??? ????????? ???? ?? ?????? ??????? ????? ??, ?????? ????????? ???????? ???????? ???????? ???????? ???????:
    #include "stdafx.h"
    //Event source
    struct A {
    	__event void Event();
    	A();
    };
     
    //Event Receiver
    struct B
    {
    	void bar();
    };
    
    void B::bar(){} 
    A::A() { } 
    
    int main()
    {
    	A a;
    	B b;
    	__hook(&A::Event, &a, &B::bar, &b);
    	a.Event();
    	__unhook(&A::Event, &a, &B::bar, &b); 
    }
  3. ?????? ??????? ???????.
???? ????? ????? ??????? ?? ??? "???????" ?? ??? ???????.

????? ??? ??????? ??? ?????? ??????? ?????? ??? ???? ????? ????????? ???????? ?? ????? ???? ????? ???? ?? ???????. ???? ????? ????????? ???????? ???? ?? ?????? ?????? ?????? ??????? ???? ?? ??????? ????? ????????? ???????? ??????? ?? ???? ??????? ??? ???:
cl /Fx event.cpp
??? ?? ??? ????????? ???????? ?? event.cpp. ????? ????????? ???????? ???? ??? ??????? ?????? ?????? ??????? ?? ??? ???? event.mrg.cpp. ?? ????? ????? ??? ????? ??? ???????? ???????? ??????? ????? ??????? eventHandlerList ??? ????? ???? ??? ????? ???? ???? ?????:
  • ????? ??? ????? ??? ???? ????? ???? ???? A ?? ????? ??? X
    __eventHandlerList_X_A_Event = 0;
  • ????? ?? ??? ????? ??? ???? ????? ???? ???? A ?? ?? ????? ???
    __eventHandlerList_A_Event = 0;
??? ??? A ??? ???? ????? ? X ?? ????? ??? ??? ????? ?? ????? ??????? ??? ?????? ???????? __event ?????? ??? ?????.

?????? ????? ?????? ???????? __raise ????? ???? ??? ?????? ???? ??? ???? ??? ?????? ???????? ????? __unhook.

?????

?????? ??? ??????? ?????? ??? ????? ?????? ?????? ??????? ???????? "?" ???? ???? ???? MSDN ??????:
??????? ???????? ?????? ?????
http://msdn2.microsoft.com/en-us/library/6f01ek09(vs.71).aspx

???????

???? ???????: 811193 - ????? ??? ??????: 03/?? ??????/1428 - ??????: 1.3
????? ???
  • Microsoft Visual C++ .NET 2002 Standard Edition
????? ??????: 
kbmt kbcompiler kberrmsg kbbug KB811193 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????811193

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com