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); [DllImport("kernel32.dll",CharSet=CharSet.Ansi,SetLastError=true)] static extern IntPtr GetProcAddress(IntPtr h,IntPtr ord); static void Main(){ string[] dlls={"winspool.drv","spoolss.dll"}; string[] fns={"RemoteFindFirstPrinterChangeNotificationEx","RemoteFindFirstPrinterChangeNotification","RpcRemoteFindFirstPrinterChangeNotificationEx","OpenPrinter2W","AddPrinterConnectionW","RpcOpenPrinter","RpcClosePrinter","FindFirstPrinterChangeNotification","ClosePrinter"}; foreach(string d in dlls){ IntPtr h=LoadLibraryW(d); Console.WriteLine("DLL "+d); foreach(string f in fns){ IntPtr p=GetProcAddress(h,f); Console.WriteLine(" "+(p!=IntPtr.Zero?"FOUND ":" ")+f); } foreach(int o in new int[]{40,45,46,47,48,49,50}){ IntPtr p=GetProcAddress(h,(IntPtr)o); if(p!=IntPtr.Zero) Console.WriteLine(" ORD "+o+" present"); } } }}