PSM Modify
#4
Posted 30 March 2009 - 01:44 AM
Here's a Visual C++ 6 example project I whipped up for you.
Attached File(s)
-
WLMSetPSMExample.zip (12.7K)
Number of downloads: 37
#7
Posted 30 March 2009 - 10:00 AM
The UUIDs are the same for the older versions, but in the older versions, IMSNMsgrObject is locked.
I will not directly tell you how to unlock it (that would be too easy for you), but the link there tells you about it and I'm sure you will get it to work if you put forth effort.
Good luck! :w00t:
I will not directly tell you how to unlock it (that would be too easy for you), but the link there tells you about it and I'm sure you will get it to work if you put forth effort.
Good luck! :w00t:
#10
Posted 30 March 2009 - 12:15 PM
You can use the same product id and key that messenger uses for it's internal protocol.
http://msnpiki.msnfa...NP13:Challenges
8.0.0812.00's key *should* still work.
http://msnpiki.msnfa...NP13:Challenges
8.0.0812.00's key *should* still work.
#12
Posted 30 March 2009 - 07:11 PM
I try that :
But ... it will crash .. ( access violation ) ( When Requestchallenge is launch)
struct DECLSPEC_UUID("BF9E04D9-1C43-453e-BD39-86D39CB63DBC") IMSNMsgrLock : IMSNMsgrObject
{
public:
virtual HRESULT RequestChallenge(long lCookie);
};
IMSNMsgrLock * msnlock = 0;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
hr = CoCreateInstance(CLSID_MSNMsgrObject,0,CLSCTX_LOCAL_SERVER,__uuidof(IMSNMsgrLock
),(LPVOID*)&msnlock);
if (FAILED(hr))
{
MessageBox(0,"Failed to create a instance of the MSNMsgrObject class","Error",MB_OK|MB_IConerror);
CoUninitialize();
return -1;
}
long test_result = msnlock->RequestChallenge(12345);
}But ... it will crash .. ( access violation ) ( When Requestchallenge is launch)
This post has been edited by TheSteve: 31 March 2009 - 12:16 AM
#13
Posted 31 March 2009 - 12:41 AM
You have a few problems here.
Problems:
1. You never called CoInitialize. (I will assume you cut that out to make it shorter.)
2. You need a window for a single threaded COM program to work. (same as above)
3. The IID for IMSNMsgrLock is correct, but the definition is not correct.
3a. IMSNMsgrLock does not inherit from IMSNMsgrObject, it inherits from IUnknown.
3b. IMSNMsgrLock has three functions. The order in which they are defined and their call type matters.
4. You should create the IMSNMsgrObject first, then use QueryInterface to get IMSNMsgrLock for this specific object. If you use CoCreateInstance again, it won't work.
5. Don't forget to release objects when you're done with them.
Problems:
1. You never called CoInitialize. (I will assume you cut that out to make it shorter.)
2. You need a window for a single threaded COM program to work. (same as above)
3. The IID for IMSNMsgrLock is correct, but the definition is not correct.
3a. IMSNMsgrLock does not inherit from IMSNMsgrObject, it inherits from IUnknown.
3b. IMSNMsgrLock has three functions. The order in which they are defined and their call type matters.
typedef enum LockStatus
{
LOCK_NOTINITIALIZED = 1,
LOCK_INITIALIZED = 2,
LOCK_PENDINGRESULT = 3,
LOCK_UNLOCKED = 4,
LOCK_UNLOCKFAILED = 5,
LOCK_DISABLED = 6
};
struct DECLSPEC_UUID("BF9E04D9-1C43-453e-BD39-86D39CB63DBC") IMSNMsgrLock : IUnknown
{
virtual HRESULT _stdcall Status(LockStatus* peStatus);
virtual HRESULT _stdcall RequestChallenge(long lCookie);
virtual HRESULT _stdcall SendResponse(BSTR bstrAppStrId, BSTR bstrResponse, long lCookie);
};4. You should create the IMSNMsgrObject first, then use QueryInterface to get IMSNMsgrLock for this specific object. If you use CoCreateInstance again, it won't work.
5. Don't forget to release objects when you're done with them.
#14
Posted 31 March 2009 - 09:35 AM
I try (the file in attachment) ...
I use QueryInterface on the Msn object ... and then i launch RequestChallenge .. the function will not crash , but it return 0 , is it normal ?
I use QueryInterface on the Msn object ... and then i launch RequestChallenge .. the function will not crash , but it return 0 , is it normal ?
Attached File(s)
-
WLMSetPSMExample.zip (22.91K)
Number of downloads: 10
#15
Posted 01 April 2009 - 04:41 AM
duchnoun, on Mar 31 2009, 06:35 PM, said:
and then i launch RequestChallenge .. the function will not crash , but it return 0 , is it normal ?
Yes, that is normal. S_OK == 0
Of course by calling RequestChallenge, all that will happen is messenger will attempt to challenge you. But you're not handling events at all, so you need to do that first.

Sign In
Register
Help


MultiQuote