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.

109 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-1999.
  5. //
  6. // File: N O T I F V A L . C P P
  7. //
  8. // Contents: Validation routines for the INetCfgNotify interfaces.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 14 Apr 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include <pch.h>
  16. #pragma hdrstop
  17. #include "netcfgn.h"
  18. #include "notifval.h"
  19. //+---------------------------------------------------------------------------
  20. // INetCfgNotify
  21. //
  22. BOOL FBadArgs_INetCfgNotify_Initialize (INetCfgComponent* a, INetCfg* b, BOOL c)
  23. {
  24. return FBadInPtr(a) || FBadInPtr(b);
  25. }
  26. BOOL FBadArgs_INetCfgNotify_ReadAnswerFile (PCWSTR c, PCWSTR d)
  27. {
  28. return FBadInPtr(c) || FBadInPtr(d);
  29. }
  30. BOOL FBadArgs_INetCfgNotify_Validate (HWND a)
  31. {
  32. return a && !IsWindow(a);
  33. }
  34. //+---------------------------------------------------------------------------
  35. // INetCfgProperties
  36. //
  37. BOOL FBadArgs_INetCfgProperties_MergePropPages (DWORD* a, LPBYTE* b, UINT* c, HWND hwnd, PCWSTR *psz)
  38. {
  39. BOOL fRet = FALSE;
  40. if (!FBadOutPtr (b))
  41. {
  42. *b = NULL;
  43. }
  44. else
  45. {
  46. fRet = TRUE;
  47. }
  48. if (!FBadOutPtr (c))
  49. {
  50. *c = 0;
  51. }
  52. else
  53. {
  54. fRet = TRUE;
  55. }
  56. if (psz)
  57. {
  58. if (!FBadOutPtr(psz))
  59. {
  60. *psz = NULL;
  61. }
  62. else
  63. {
  64. fRet = TRUE;
  65. }
  66. }
  67. return fRet || FBadInPtr (a) || FBadOutPtr (a) || (hwnd && !IsWindow(hwnd));
  68. }
  69. BOOL FBadArgs_INetCfgProperties_ValidateProperties(HWND a)
  70. {
  71. return a && !IsWindow(a);
  72. }
  73. //+---------------------------------------------------------------------------
  74. // INetCfgSystemNotify
  75. //
  76. BOOL FBadArgs_INetCfgSystemNotify_GetSupportedNotifications (DWORD* a)
  77. {
  78. BOOL fRet = FALSE;
  79. if (!FBadOutPtr(a))
  80. {
  81. *a = 0;
  82. }
  83. else
  84. {
  85. fRet = TRUE;
  86. }
  87. return fRet;
  88. }