Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8 KiB

  1. #pragma once
  2. typedef PVOID PLHCOBJECT_DESCRIPTOR;
  3. typedef PLHCOBJECT_DESCRIPTOR (APIENTRY *PLHC_OPENPROC)(PCWSTR);
  4. typedef BOOL (APIENTRY *PLHC_READPROC)(PLHCOBJECT_DESCRIPTOR,PVOID,DWORD,PDWORD);
  5. typedef BOOL (APIENTRY *PLHC_WRITEPROC)(PLHCOBJECT_DESCRIPTOR,PVOID,DWORD);
  6. typedef BOOL (APIENTRY *PLHC_CLOSEPROC)(PLHCOBJECT_DESCRIPTOR);
  7. typedef DWORD (APIENTRY *PLHC_GETLIBRARYNAMEPROC)(PWSTR, DWORD);
  8. typedef void (APIENTRY *PLHC_USAGEPROC)();
  9. typedef struct __LIBRARY_DESCRIPTOR
  10. {
  11. HMODULE m_hModule; // Handle to the loaded DLL
  12. // Now come the pointers to functions in the DLL
  13. PLHC_OPENPROC m_fpOpen; // lchOpen function
  14. PLHC_READPROC m_fpRead; // lhcRead function
  15. PLHC_WRITEPROC m_fpWrite; // lhcWrite function
  16. PLHC_CLOSEPROC m_fpClose; // lhcClose function
  17. PLHC_GETLIBRARYNAMEPROC m_fpGetLibraryName; // lhcGetLibraryName function
  18. PLHC_USAGEPROC m_fpUsage;
  19. } LIBRARY_DESCRIPTOR, *PLIBRARY_DESCRIPTOR;
  20. PLIBRARY_DESCRIPTOR lhclLoadLibrary(
  21. PCWSTR pcszPathName);
  22. void lhclFreeLibrary(
  23. PLIBRARY_DESCRIPTOR pLibrary);
  24. PLHCOBJECT_DESCRIPTOR lhclOpen(
  25. PLIBRARY_DESCRIPTOR pLibrary,
  26. PCWSTR pcszPortSpec);
  27. BOOL lhclRead(
  28. PLIBRARY_DESCRIPTOR pLibrary,
  29. PLHCOBJECT_DESCRIPTOR pObject,
  30. PVOID pBuffer,
  31. DWORD dwBufferSize,
  32. PDWORD pdwBytesRead);
  33. BOOL lhclWrite(
  34. PLIBRARY_DESCRIPTOR pLibrary,
  35. PLHCOBJECT_DESCRIPTOR pObject,
  36. PVOID pBuffer,
  37. DWORD dwBufferSize);
  38. BOOL lhclClose(
  39. PLIBRARY_DESCRIPTOR pLibrary,
  40. PLHCOBJECT_DESCRIPTOR pObject);
  41. DWORD lhclGetLibraryName(
  42. PLIBRARY_DESCRIPTOR pLibrary,
  43. PWSTR pszBuffer,
  44. DWORD dwBufferSize);
  45. void lhclUsage();