Solved

Code stops working after installing SP2 on WinXP

Posted on 2004-10-20
8
326 Views
Last Modified: 2008-02-01
I posted this question in the C++ section under "Programming" a couple of days ago, but haven't got a solution yet.  I guess I should try posting it in this section.

I have a client-server application.  The server is running in a WinXP Pro. machine, and the client is running in a Win2K machine.  Brefore SP2 was installed, everything was working fine.  However, after the install of SP2, I got a "RPC server is unavailable" error on the client.  I put the "RestrictRemoteClients" setting (DWORD) with value of 0 under \\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\RPC\ on the server machine.  It didn't help at all.

Basically, the client program needs to create a COM object on the server by doing the following:

CComPtr<IPrintJob> spPrintJob;
HRESULT hr = CoCreateInstance2( _T("Server"), CLSID_PRINTJOB, &spPrintJob, true );

The returned hr value is 0x800706BA.  The CoCreateInstance2 function is below:

template <class Q>
static HRESULT CoCreateInstance2( LPTSTR lpszHost,
const CLSID& clsid, Q** ppq, bool bUnAuthenticated = false, DWORD dwClsCtx = CLSCTX_SERVER )
{
     (*ppq) = 0;
   
     if (lpszHost)
     {
          USES_CONVERSION;

          COAUTHINFO cai = { RPC_C_AUTHN_NONE, 0, 0, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, 0, 0 };
          COSERVERINFO csi = { 0, T2W(lpszHost), 0, 0 };

          if ( bUnAuthenticated )
          {
                  csi.pAuthInfo = &cai;
          }

          MULTI_QI mqi = { &(__uuidof(Q)), 0, 0 };
           
          HRESULT hr = ::CoCreateInstanceEx( clsid, 0, dwClsCtx, &csi, 1, &mqi );

          if (FAILED(hr)) return hr;
           
          (*ppq) = (Q*)(mqi.pItf);
          return S_OK;
     }

     return ::CoCreateInstance( clsid, 0, dwClsCtx, __uuidof(Q), (void**)(ppq) );
}


Please advise.  Thanks.
0
Comment
Question by:cmsdiginet
  • 4
  • 2
8 Comments
 
LVL 2

Expert Comment

by:tomasg18
ID: 12367312
Have you tried disabling the firewall on the Windows XP SP2 machine?  If the application works with the firewall disabled, then you need to open ports for your application to work.  
0
 

Author Comment

by:cmsdiginet
ID: 12371101
I turned off the firewall on XP machine.  That didn't help at all.
0
 
LVL 27

Accepted Solution

by:
Asta Cu earned 500 total points
ID: 12373631
Microsoft has offered FREE support for Windows XP SP2; here's some info on that, used it and very much helped some problems that couldn't be resolved directly.  

Hopefully Experts here can help you, but it may be worth some time to check out your FREE options here in the event it is an issue that requires escalation to Microsoft for a solution that doesn't yet exist.  I'm not sure how long this will be free, and have used the Tech Chat interface and been happy.  But as always, your call.

http://support.microsoft.com/oas/default.aspx?LN=en-us&gprid=6794&x=16&y=11

Asta
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:cmsdiginet
ID: 12438846
I sent an email to Microsoft Support yesterday, but hasn't got any reply yet.
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12438888
I use the TECH CHAT option instead because it is immediate.
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12735850
Thank you, I am happy I could be of some help to you here; although a "C" grade typically means you didn't get what you hoped to achieve, in my humble opinion.  Sorry for the delay in responding, have been ill....  Best wishes, ":0) Asta
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12763752
Thank you for the Feedback on this issue; I do appreciate it and commented there as well.   Personally speaking, the fact that Microsoft still offers free support for the Windows XP SP2 update, is a win-win scenario from a couple of perspectives.  First, in my humble opinion, the developers for Windows benefit by hearing from the end-users on problems found and roadblocks to the new releases so they can address the issues and rollout fixes in future releases and secondly, we all benefit anytime we can interact with developers to share our problems and workarounds and also get the added benefits on future releases which incorporate these fixes.  Best wishes, ":0) Asta
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now