VCustomVolumeObject::~VCustomVolumeObject()
{ 
  if(!m_bCreatedFromEditor)
  {
    Deregister();
  }
}
Пример #2
0
Window::~Window()
{
    if ( _application != NULL )
    {
        Application *app = _application;
        app->lock();
        app->RemoveWindow( this );
        app->unlock();
    }


    while ( CountChildren() > 0 )
    {
        View* child = RemoveChild(0);
        delete child;
    }

    Deregister();

    if ( m_pulser != NULL )
    {
        m_pulser->Terminate( true );
        delete m_pulser;
    }

    free( m_title );
}
BOOL CNTEventLogSource::Attach(HANDLE hEventSource)
{
  if (m_hEventSource != hEventSource)
    Deregister();

  m_hEventSource = hEventSource;
  return TRUE;
}
Пример #4
0
// Simple Version
BOOL CEventLog::LogEvent(DWORD dwEventID,   WORD     wEventType,
                         WORD  wCategory,   PSID     lpUserSid)
{
   Register();
   BOOL b = ReportEvent(m_hes, wEventType, wCategory,
                                      dwEventID, lpUserSid, 0, 0, NULL, NULL);
   Deregister();
   return b;
}
Пример #5
0
// Send Data Version
BOOL CEventLog::LogEvent(DWORD  dwEventID,  DWORD    dwDataSize,
                         LPVOID lpRawData,  WORD     wEventType,
                         WORD   wCategory,  PSID     lpUserSid)
{
   Register();
   BOOL b = ReportEvent(m_hes, wEventType, wCategory, dwEventID,
                                   lpUserSid, 0, dwDataSize, NULL, lpRawData);
   Deregister();
   return b;
}
Пример #6
0
// Multiple String Version
BOOL CEventLog::LogEvent(DWORD dwEventID,   LPCTSTR* lpStrings,
                         WORD wNumStrings,  WORD     wEventType,
                         WORD wCategory,    PSID     lpUserSid)
{
   Register();
   BOOL b = ReportEvent(m_hes, wEventType, wCategory, dwEventID,
                                  lpUserSid, wNumStrings, 0, lpStrings, NULL);
   Deregister();
   return b;
}
Пример #7
0
int main(int argc, char * argv[])
{
   int result = 0;
   SLPToolCommandLine cmdline;

   /* zero out the cmdline */
   memset(&cmdline, 0, sizeof(cmdline));

   /* Parse the command line */
   if (ParseCommandLine(argc, argv, &cmdline) == 0)
      switch (cmdline.cmd)
      {
         case FINDSRVS:
            FindSrvs(&cmdline);
            break;

         case FINDATTRS:
            FindAttrs(&cmdline);
            break;

         case FINDSRVTYPES:
            FindSrvTypes(&cmdline);
            break;

         case FINDSCOPES:
            FindScopes(&cmdline);
            break;

         case GETPROPERTY:
            GetProperty(&cmdline);
            break;

         case REGISTER:
            Register(&cmdline);
            break;

         case DEREGISTER:
            Deregister(&cmdline);
            break;

         case PRINT_VERSION:
            PrintVersion(&cmdline);
	    break;

	 case DUMMY:
	    break;
      }
   else
   {
      DisplayUsage();
      result = 1;
   }

   return result;
}
Пример #8
0
// Single String Version
BOOL CEventLog::LogEvent(DWORD dwEventID,   LPCTSTR  lpString,
                         WORD  wEventType,  WORD     wCategory,
                         PSID  lpUserSid)
{
   const TCHAR* rgsz[] = {lpString};

   Register();
   BOOL b = ReportEvent(m_hes, wEventType, wCategory, dwEventID,
                                                 lpUserSid, 1, 0, rgsz, NULL);
   Deregister();
   return b;
}
Пример #9
0
void FShader::Release()
{
	check(NumRefs != 0);
	if(--NumRefs == 0)
	{
		DEC_DWORD_STAT_BY(STAT_Shaders_ShaderMemory, GetSizeBytes());
		DEC_DWORD_STAT_BY(STAT_Shaders_NumShadersLoaded,1);

		// Deregister the shader now to eliminate references to it by the type's ShaderIdMap
		Deregister();

		BeginCleanup(this);
	}
}
Пример #10
0
// Does anything version
BOOL CEventLog::LogEvent(DWORD dwEventID,   LPCTSTR* lpStrings,
                         WORD  wNumStrings, LPVOID   lpRawData,
                         DWORD dwDataSize,  WORD     wEventType,
                         WORD  wCategory,   PSID     lpUserSid)
{
   if(wNumStrings == 0 && lpStrings != NULL)
      return FALSE;
   if(lpStrings == NULL && wNumStrings != 0)
      return FALSE;

   Register();
   BOOL b = ReportEvent(m_hes, wEventType, wCategory, dwEventID, lpUserSid,
                               wNumStrings, dwDataSize, lpStrings, lpRawData);
   Deregister();
   return b;
}
Пример #11
0
void FShader::Release()
{
	// Lock the shader id map. Note that we don't necessarily have to deregister at this point but
	// the shader id map has to be locked while we remove references to this shader so that nothing
	// can find the shader in the map after we remove the final reference but before we deregister the shader
	LockShaderIdMap();
	if(--NumRefs == 0)
	{
		DEC_DWORD_STAT_BY(STAT_Shaders_ShaderMemory, GetSizeBytes());
		DEC_DWORD_STAT_BY(STAT_Shaders_NumShadersLoaded,1);

		// Deregister the shader now to eliminate references to it by the type's ShaderIdMap
		Deregister();

		Canary = ShaderMagic_CleaningUp;
		BeginCleanup(this);
	}
	UnlockShaderIdMap();
}
BOOL CNTEventLogSource::Report(WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid,
                               WORD wNumStrings, DWORD dwDataSize, LPCTSTR* lpStrings, LPVOID lpRawData)
{
  ATL::CComCritSecLock<ATL::CComAutoCriticalSection> sl(m_csReport, true);

  ATLASSERT(m_hEventSource == NULL);
#ifdef CNTSERVICE_MFC_EXTENSIONS
  if (!Register(m_sServerName, m_sSourceName))
#else
  if (!Register(m_sServerName.c_str(), m_sSourceName.c_str()))
#endif
    return FALSE;
  ATLASSUME(m_hEventSource != NULL);

  //Call the SDK version of the function
  BOOL bSuccess = ReportEvent(m_hEventSource, wType,	wCategory, dwEventID, lpUserSid,
                              wNumStrings, dwDataSize, lpStrings, lpRawData);
  Deregister();  

  return bSuccess;
}
Пример #13
0
// Log a Win32 error
BOOL CEventLog::LogWin32Error(DWORD dwEventID,
                                           LPCTSTR szString, DWORD dwErrorNum)
{
   LPVOID lpvMsgBuf;
   TCHAR szErrorDesc[1024];
   if(!FormatMessage(
                  FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
                  0, dwErrorNum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                  (LPTSTR)&lpvMsgBuf, 0, 0))
   {
      if(szString != NULL)
         wsprintf(szErrorDesc,
                  NTEXT("Function: %s returned Win32 Error: %d, Unknown Error"),
                  szString, dwErrorNum);
      else
         wsprintf(szErrorDesc,
                  NTEXT("Win32 Error: %d, Unknown Error"),
                  dwErrorNum);
   }
   else
   {
      if(szString != NULL)
         wsprintf(szErrorDesc,
                  NTEXT("Function: %s returned Win32 Error: %d Description: %s"),
                  szString, dwErrorNum, lpvMsgBuf);
      else
         wsprintf(szErrorDesc,
                  NTEXT("Win32 Error: %d Description: %s"),
                  dwErrorNum, lpvMsgBuf);
      LocalFree(lpvMsgBuf);
   }

   const TCHAR* rgsz[] = { szErrorDesc };

   Register();
   BOOL b = ReportEvent(m_hes, EVENTLOG_ERROR_TYPE, NULL, dwEventID,
                                                      NULL, 1, 0, rgsz, NULL);
   Deregister();
   return b;
}
Пример #14
0
stat_t
SelfHealingSessionServer::HandleDisconnect(const L4_ThreadId_t& tid,
                                           L4_Msg_t& msg)
{
    SessionControlBlock*    c;
    addr_t                  base;

    ENTER;

    base = L4_Get(&msg, 0);
    c = Search(tid, base);
    if (c == 0) {
        return ERR_NOT_FOUND;
    }

    DOUT("shm release @ %.8lX\n", base);
    shmfree(base, c->size);
    Deregister(c);
    L4_Clear(&msg);
    EXIT;
    return ERR_NONE;
}
VCustomVolumeObject::~VCustomVolumeObject()
{ 
  Deregister();
}
BOOL CNTEventLogSource::Register(LPCTSTR lpUNCServerName, LPCTSTR lpSourceName)
{
  Deregister();
  m_hEventSource = RegisterEventSource(lpUNCServerName, lpSourceName);
  return (m_hEventSource != NULL);
}
Пример #17
0
	~Sample_Impl()
	{
		Deregister();
	}
CNTEventLogSource::~CNTEventLogSource()
{
  Deregister();
}