You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "adamdebreceni (via GitHub)" <gi...@apache.org> on 2023/06/09 08:36:41 UTC

[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1564: MINIFICPP-2081 - Read windows events from log file

adamdebreceni commented on code in PR #1564:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1564#discussion_r1224014765


##########
extensions/windows-event-log/tests/CWELTestUtils.h:
##########
@@ -94,3 +94,13 @@ class OutputFormatTestController : public TestController {
   std::string output_format_;
   std::optional<std::string> json_format_;
 };
+
+void generateLogFile(const std::wstring& channel, const std::filesystem::path& path) {
+  HANDLE event_log = OpenEventLog(NULL, std::string(channel.begin(), channel.end()).c_str());

Review Comment:
   done



##########
extensions/windows-event-log/wel/EventPath.h:
##########
@@ -0,0 +1,49 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <windows.h>
+#include <winevt.h>
+#include <string>
+
+namespace org::apache::nifi::minifi::wel {
+
+class EventPath {
+ public:
+  enum class Kind {
+    CHANNEL,
+    FILE
+  };
+
+  EventPath() = default;
+  explicit EventPath(std::wstring wstr);
+  explicit EventPath(std::string str);
+  const std::wstring& wstr() const;
+  const std::string& str() const;
+  EVT_QUERY_FLAGS getQueryFlags() const;
+  Kind kind() const;

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org