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.

42 lines
1.1 KiB

  1. #include "windows.h"
  2. __cdecl main(int argc, char **argv)
  3. {
  4. char szSystemPath[_MAX_PATH];
  5. char szFilename[_MAX_PATH];
  6. char szCurPath[_MAX_PATH+1];
  7. int len;
  8. UINT dwFilename = sizeof(szFilename)/sizeof(szFilename[0]);;
  9. DWORD dwstatus;
  10. if (GetSystemDirectory(szSystemPath, sizeof(szSystemPath)/sizeof(szSystemPath[0])) == 0)
  11. {
  12. return (dwstatus = GetLastError());
  13. }
  14. //Get the path to the install source directory
  15. if ((len = GetModuleFileName(NULL, szCurPath, sizeof(szCurPath)/sizeof(szCurPath[0]))) == 0)
  16. {
  17. return (dwstatus =GetLastError());
  18. }
  19. szCurPath[sizeof(szCurPath)/sizeof(szCurPath[0])-1] = '\0';
  20. while (szCurPath[--len] != '\\')
  21. continue;
  22. szCurPath[len+1] = '\0';
  23. // install the file to the system directory
  24. dwstatus = VerInstallFile(0,"DFLAYOUT.DLL", "DFLAYOUT.DLL",
  25. szCurPath, szSystemPath, szSystemPath,
  26. szFilename, &dwFilename);
  27. return dwstatus;
  28. }