I am trying to register this file (mytest3.mof) :
#PRAGMA AUTORECOVER
#pragma namespace("\\\\.\\root\\subscription")
instance of __EventFilter as $EventFilter
{
Name = "Event Filter Instance Name";
EventNamespace = "Root\\Cimv2";
Query = "Select * From __InstanceCreationEvent Within 1 "
"Where TargetInstance Isa \"Cim_DirectoryContainsFile\" "
"and TargetInstance.GroupComponent=\"Win32_Directory.Name=\'C:\\\\test\'\"";
QueryLanguage = "WQL";
};
instance of ActiveScriptEventConsumer as $Consumer
{
Name = "TestConsumer";
ScriptingEngine = "VBScript";
ScriptFileName = "C:\\test\\test.vbs";
};
instance of __FilterToConsumerBinding
{
Filter = $EventFilter;
Consumer = $Consumer;
};
using the command PS C:\windows\system32\wbem> mofcomp mytest3.mof
And receiving this output :
Microsoft (R) MOF Compiler Version 6.2.9200.16398
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: mytest3.mof
MOF file has been successfully parsed
Storing data in the repository...
WARNING: File mytest3.mof does not contain #PRAGMA AUTORECOVER.
If the WMI repository is rebuilt in the future, the contents of this MOF file w
ill not be included in the new WMI repository.
To include this MOF file when the WMI Repository is automatically reconstructed
, place the #PRAGMA AUTORECOVER statement on the first line of the MOF file.
Done!
This has happened a few times now, and I can see that the event is not being registered.
Does anyone know why I am seeing the message about #PRAGMA AUTORECROVER? Youc an clearly see that this line has been included in the file, but the system still complains that it is not there ... I am not sure if this is part of the reason why the event is not being registered, but it seems like they may be related.
As an extra detail which may help to explain - when I save mytset3.mof in the wbem folder, the file cannot be found there until I enter the folder, create a new blank text file and save it as mytest3.mof. Until I do this (even though I have saved the document), the PC acts as if this file does not exist ... What is going on here? Could this be related to folder permissions?
It would appear that this issue is somehow being caused by Notepad++
When saving the file from Notepad++ I have to do the above process of creating a new blank file before it is made available to the system, and running mofcomp appears to do nothing (even though it says the data was saved to the repository) and complains about #PRAGMA AUTORECOVER.
After pasting the exact same file contents into a regular Notepad.exe instance and saving that, there are no issues whatsoever. The file is created after saving, and running mofcomp mytest4.mof not only returns a successful message in the terminal but I can also see that the event is now registered to monitor the C:\test folder.
Not quite sure what is happening with Notepad++ here but if anyone could shed some light that would be great!
Related
I am trying to update the PATH environment variable inside my C++ program using Qt on Windows 10. There is something wired in this scenario that I cannot understand. The strange point is that the value of PATH environment variable is getting different in the C++ code and in process explorer tool after dynamically loading a Matlab .dll file (i.e. MatlabEngine.dll). Here is a simplified version of the code:
QString new_path = getNewPath();
bool res = qputenv("PATH", new_path.toStdString().c_str());
assert(res);
auto applied_path = qgetenv("PATH"); // Line X of the code: process explorer shows the same value for PATH environment variable as applied_path variable
// load a Matlab .dll dynamically
if (!oneMatlabDll.load())
{
throw someException;
}
applied_path = qgetenv("PATH"); // Line Y of the code: process explorer does not show the updated value of PATH environment variable as before. But, the applied_path variable is exactly the same as line X.
Does anyone have any idea why the value of PATH environment variable retrieved by qgetenv() is different from the one showed by process explorer tool? Here are some thoughts:
An issue with process explorer tool
An issue with qgetenv() method
Dynamically loading the .dll file runs some hidden code that causes this problem. (?)
Update 1:
If I add this silly line of code after line Y, then the process explorer shows the same value as the output of qgetenv("PATH"):
qputenv("PATH", qgetenv("PATH")); // this line fixes the issue
I could not find any reason behind this problem. It seems that it can be an internal issues comes from Qt/Windows. So, the only workaround that I have found is to add the below line again:
qputenv("PATH", qgetenv("PATH")); // this line fixes the issue
Cannot load " file reference ": Domain object with ID " guid " has already been defined in this or another domain model.
The file to be loaded is a DevExpress xpo data model file and the file itself has successfully loaded on at least 3 prior occasions.
I have searched for the ID guid on the whole hard disk without any result.
How can I fix this?
The problem here is, you have already compiled the file. Look around in your build path for a compiled file, and either move or delete it. Whenever a file is already compiled in a location, the compiler tries to use its resources in the compilation of your new program. This then defines things multiple times, giving you this error.
I had made a source file data type change in source analyzer. I did realize that it had made the mapping invalid. I ran the mapping and it failed. Now I reverted the change, validated the mapping, check in the mapping, validated the workflow, check in the workflow.
Now I am getting the error:
Severity Timestamp Node Thread Message Code Message
INFO 7/23/2015 10:40:03 AM node01_CSADevelopment READER_1_4_1 FR_3055 Reading input filenames from the indirect file [<input_directory_folder>/<input_file>].
Severity Timestamp Node Thread Message Code Message
ERROR 7/23/2015 10:40:03 AM node01_CSADevelopment READER_1_4_1 FR_3000 Error opening file [<input_file_folder>/<header_of_the_input_file>]. Operating system error message [No such file or directory].
here the term "input file" is the file which I wanted to load and "header_of_the_input_file" is the header of the input file.
I don't understand, why it is happening. I had just made a small change and then reverted it.
The error is just saying the filenames mentioned in the indirect file are not found. So, you just need to make sure all the source files are there in the "input_file_folder"
There is a property in the session to configure the source file as indirect. An indirect file contains a list of source filenames. Informatica reads all the files listed and loads the data. If you think you have inadvertently made the source file indirect, you can change the option in session properties (mapping tab -> Source Qualifier)
It does not have anything to do with the datatype change and reverting it.
I need my program to start a new log file in each execution. I want to use PoCo as I am already using this library in the code.
From my point of view, I have two possibilities but I do not know how to configure any of them using a channel in Poco.
Just starting a new file each time the program starts
The atual file name (not the rolled but the one that is being writting) containing the timestamp when it was created.
If I am not wrong, using FileChannel is not possible any these possibilities. I guess I could write a new PoCo channel but, obviously, I prefer something already working.
Does anybody have any idea for this. I tried to figure out using two channels but I do not see how.
thank you
FileChannel has rotateOnOpen property. If you set this to true, it will create new file every time channel is opened. See FileChannel. If you do not have this property available, you are using an older version of Poco; in this case, you can simply open File channel with a newly generated name every time your application starts:
std::string name = yourCustomNameGenFunc();
AutoPtr<FileChannel> pChannel = new FileChannel(name);
I've spent all night researching this without a solution.
I'm trying to verify the digital signature of a file in the drives folder (C:\Windows\System32\drivers*.sys) pick whatever one you want. I know that the code is correct because if you move the file from that folder to C:\ the test works.
WinVerifyTrust gives error 80092003
http://pastebin.com/nLR7rvZe
CryptQueryObject gives error 80092009
http://pastebin.com/45Ra6eL4
What's the deal?
0x80092003 = CRYPT_E_FILE_ERROR = An error occurred while reading or writing to the file.
0x80092009 = CRYPT_E_NO_MATCH = No match when trying to find the object.
I'm guessing you're running on a 64-bit machine and WOW64 file system redirection is redirecting you to syswow64\drivers, which is empty. You can disable redirection with Wow64DisableWow64FsRedirection().
if you right click and view properties of file can you see a digital signature? most likely your file is part of a catalogue and you need to use the catalogue API to extract the cert from cert DB and verify it.