NS_NEWXPCOM(rc, nsRenderingContextWin);
if (gUseAFunctions) { NS_NEWXPCOM(rc, nsRenderingContextWinA); } else { NS_NEWXPCOM(rc, nsRenderingContextWin); }
nsresult nsGfxFactoryWin::CreateInstance(nsISupports *aOuter,                                            const nsIID &aIID,                                            void **aResult)  {    if (aResult == NULL) {      return NS_ERROR_NULL_POINTER;    }    *aResult = NULL;      nsISupports *inst = nsnull;  if (mClassID.Equals(kCFontMetrics)) {    nsFontMetricsWin* fm;    NS_NEWXPCOM(fm, nsFontMetricsWin);    inst = (nsISupports *)fm;  }  else if (mClassID.Equals(kCDeviceContext)) {    nsDeviceContextWin* dc;    NS_NEWXPCOM(dc, nsDeviceContextWin);    inst = (nsISupports *)dc;  }  else if (mClassID.Equals(kCRenderingContext)) {    nsRenderingContextWin*  rc;    NS_NEWXPCOM(rc, nsRenderingContextWin);    inst = (nsISupports *)((nsIRenderingContext*)rc);  }  else if (mClassID.Equals(kCImage)) {    nsImageWin* image;    NS_NEWXPCOM(image, nsImageWin);    inst = (nsISupports *)image;  }  else if (mClassID.Equals(kCRegion)) {    nsRegionWin*  region;    NS_NEWXPCOM(region, nsRegionWin);    inst = (nsISupports *)region;  }  else if (mClassID.Equals(kCBlender)) {    nsBlender* blender;    NS_NEWXPCOM(blender, nsBlender);    inst = (nsISupports *)blender;  }  else if (mClassID.Equals(kCDrawingSurface)) {    nsDrawingSurfaceWin* ds;    NS_NEWXPCOM(ds, nsDrawingSurfaceWin);    inst = (nsISupports *)((nsIDrawingSurface *)ds);  }  else if (mClassID.Equals(kCDeviceContextSpec)) {    nsDeviceContextSpecWin* dcs;    NS_NEWXPCOM(dcs, nsDeviceContextSpecWin);    inst = (nsISupports *)dcs;  }  else if (mClassID.Equals(kCDeviceContextSpecFactory)) {    nsDeviceContextSpecFactoryWin* dcs;    NS_NEWXPCOM(dcs, nsDeviceContextSpecFactoryWin);    inst = (nsISupports *)dcs;  }  if (inst == NULL) {      return NS_ERROR_OUT_OF_MEMORY;    }    nsresult res = inst->QueryInterface(aIID, aResult);  if (res != NS_OK) {      // We didn't get the right interface, so clean up      delete inst;    }  //  else {//    inst->Release();//  }  return res;  }  