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.

46 lines
1.3 KiB

  1. /***************************************************************************
  2. **
  3. ** File: odbcexec.h
  4. ** Purpose: Contains defines used by both the 16 and 32 bit ends
  5. ** of the ODBC communication channel.
  6. **
  7. ** Notes: This header files contains code, so it cannot be
  8. ** included in more than one compilation unit. The
  9. ** reason it contains code is that GetTransferFileName()
  10. ** is used on both the 16 and 32 bit sides, and this is
  11. ** simpler than creating a shared .cpp file just for it.
  12. **
  13. ****************************************************************************/
  14. #ifndef ODBCEXEC_H
  15. #define ODBCEXEC_H
  16. #include <string.h>
  17. #define EXE_NAME "ODBCEXEC.EXE"
  18. #define SZ_TRANSFER_FILE_NAME "SendODBC"
  19. #define ODBC_BUFFER_SIZE 256
  20. /*
  21. * Returns the name of the file used to pass information from the 32 bit
  22. * process to the 16 bit process. This file is in the Windows dir,
  23. * and has name SZ_TRANSFER_FILE_NAME (defined in ODBCEXEC.H).
  24. */
  25. char *GetTransferFileName()
  26. {
  27. static char rgchImage[128];
  28. UINT cb=GetWindowsDirectory(rgchImage, sizeof rgchImage);
  29. // Add a slash unless it's the root
  30. if (cb > 3)
  31. {
  32. rgchImage[cb] = '\\';
  33. rgchImage[cb+1] = '\0';
  34. }
  35. strcat(rgchImage, SZ_TRANSFER_FILE_NAME);
  36. return rgchImage;
  37. }
  38. #endif /* ODBCEXEC_H */