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.

61 lines
1.0 KiB

  1. //
  2. // TheApp.cpp
  3. //
  4. // Main entry point for NCXP32.DLL, part of the Home Networking Wizard.
  5. //
  6. // History:
  7. //
  8. // 9/28/1999 KenSh Created
  9. //
  10. #include "stdafx.h"
  11. #include "NetConn.h"
  12. #include "TheApp.h"
  13. // Global data
  14. //
  15. HINSTANCE g_hInstance;
  16. extern "C" int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved)
  17. {
  18. g_hInstance = hInstance;
  19. DisableThreadLibraryCalls(hInstance);
  20. TCHAR szDll32Path[MAX_PATH];
  21. if (!GetModuleFileName(g_hInstance, szDll32Path, _countof(szDll32Path)))
  22. return FALSE;
  23. TCHAR szDll16Path[MAX_PATH];
  24. lstrcpy(szDll16Path, szDll32Path);
  25. lstrcpy(FindFileTitle(szDll16Path), _T("NCXP16.DLL"));
  26. // Initialize thunk to NCxp16.dll, fail if not found
  27. if (!thk_ThunkConnect32(
  28. szDll16Path,
  29. szDll32Path,
  30. hInstance, dwReason))
  31. {
  32. return FALSE;
  33. }
  34. return TRUE;
  35. }
  36. LPVOID WINAPI NetConnAlloc(DWORD cbAlloc)
  37. {
  38. return HeapAlloc(GetProcessHeap(), 0, cbAlloc);
  39. }
  40. VOID WINAPI NetConnFree(LPVOID pMem)
  41. {
  42. if (pMem != NULL)
  43. {
  44. HeapFree(GetProcessHeap(), 0, pMem);
  45. }
  46. }