InternetCrackUrl( ) fails with error # 12006: ERROR_SXS_ACTIVATION_CONTEXT_DISABLED

Win2K, MSVC++ 6 SP5

I am using the InternetCrackUrl( ) function, and I have noticed that
when I pass a URL without a protocol like ?www.rooz.net?, it returns
FALSE and GetLastError( ) retrieves error number 12006,
ERROR_SXS_ACTIVATION_CONTEXT_DISABLED :
The application attempted to activate a disabled activation context.

But when I pass a URL with an invalid protocol, like
?abc://www.rooz.net/?, it doesn?t fail, and it returns
INTERNET_SCHEME_UNKNOWN in the URL_COMPONENTS parameter.

This is my function call:
bResult = ::InternetCrackUrl( pszURL,
::_tcslen(pszURL),
ICU_DECODE | ICU_ESCAPE,
&URLComponents );
I have fully initialized the URLComponents variable already.

Is this behavior normal, or am I doing something incorrectly? Should I
myself parse the string before passing it to InternetCrackUrl( ) to
check if it has any protocol or not?

I am asking this because in the INTERNET_SCHEME enum, there is a value
named INTERNET_SCHEME_DEFAULT. I imagined that when there?s no protocol
in the URL, it should assume the default scheme, which may be HTTP in
most cases. This is logic like I don?t have to specify the port number,
to make InternetCrackUrl( ) to use the default port. Is this assumption
wrong?

Thanks for any help.

Ehsan Akhgari
?
?xxxxx@BeginThread.com
?xxxxx@Rooz.net
?http://www.BeginThread.com/Contributors/Ehsan
?http://www.rooz.net


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com