Source code of Windows XP (NT5)
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.

53 lines
1.6 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 struct __LIBRARY_DESCRIPTOR
  9. {
  10. HMODULE m_hModule; // Handle to the loaded DLL
  11. // Now come the pointers to functions in the DLL
  12. PLHC_OPENPROC m_fpOpen; // lchOpen function
  13. PLHC_READPROC m_fpRead; // lhcRead function
  14. PLHC_WRITEPROC m_fpWrite; // lhcWrite function
  15. PLHC_CLOSEPROC m_fpClose; // lhcClose function
  16. PLHC_GETLIBRARYNAMEPROC m_fpGetLibraryName; // lhcGetLibraryName function
  17. } LIBRARY_DESCRIPTOR, *PLIBRARY_DESCRIPTOR;
  18. PLIBRARY_DESCRIPTOR lhclLoadLibrary(
  19. PCWSTR pcszPathName);
  20. void lhclFreeLibrary(
  21. PLIBRARY_DESCRIPTOR pLibrary);
  22. PLHCOBJECT_DESCRIPTOR lhclOpen(
  23. PLIBRARY_DESCRIPTOR pLibrary,
  24. PCWSTR pcszPortSpec);
  25. BOOL lhclRead(
  26. PLIBRARY_DESCRIPTOR pLibrary,
  27. PLHCOBJECT_DESCRIPTOR pObject,
  28. PVOID pBuffer,
  29. DWORD dwBufferSize,
  30. PDWORD pdwBytesRead);
  31. BOOL lhclWrite(
  32. PLIBRARY_DESCRIPTOR pLibrary,
  33. PLHCOBJECT_DESCRIPTOR pObject,
  34. PVOID pBuffer,
  35. DWORD dwBufferSize);
  36. BOOL lhclClose(
  37. PLIBRARY_DESCRIPTOR pLibrary,
  38. PLHCOBJECT_DESCRIPTOR pObject);
  39. DWORD lhclGetLibraryName(
  40. PLIBRARY_DESCRIPTOR pLibrary,
  41. PWSTR pszBuffer,
  42. DWORD dwBufferSize);