Solved

Code stops working after installing SP2 on WinXP

Posted on 2004-10-20
8
327 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

20 Experts available now in Live!

Get 1:1 Help Now