using System; using System.Runtime.InteropServices; class P{ [DllImport("kernel32.dll",CharSet=CharSet.Unicode,SetLastError=true)] static extern IntPtr LoadLibraryW(string n); [DllImport("kernel32.dll",CharSet=CharSet.Ansi,SetLastError=true)] static extern IntPtr GetProcAddress(IntPtr h,string n); static void Main(){ string[] dlls={"spoolss.dll","winspool.drv","rpcrt4.dll","C:\\Windows\\System32\\spoolss.dll"}; string[] fns={"RpcOpenPrinter","RpcOpenPrinterEx","RpcRemoteFindFirstPrinterChangeNotification","RpcRemoteFindFirstPrinterChangeNotificationEx","OpenPrinterW","RpcClosePrinter","RpcBindingFromStringBindingW","RpcStringBindingComposeW"}; foreach(string d in dlls){ IntPtr h=LoadLibraryW(d); Console.WriteLine("DLL "+d+" h="+h); if(h==IntPtr.Zero) continue; foreach(string f in fns){ IntPtr p=GetProcAddress(h,f); if(p!=IntPtr.Zero) Console.WriteLine(" FOUND "+f); } } }}