I am creating virtual drive using Windows Cloud Filter API. The delete callback stopped working as expected on Windows Home 21H1 19043.1165 (cldflt.sys 10.0.19041.1110). If I return an error code from the CF_CALLBACK_TYPE_NOTIFY_DELETE, the dehydrated placeholder is deleted anyway, regardless of the error code that I return:
void CALLBACK FakeCloudProvider::OnNotifyDelete(
_In_ CONST CF_CALLBACK_INFO* callbackInfo,
_In_ CONST CF_CALLBACK_PARAMETERS* callbackParameters)
{
CF_OPERATION_INFO opInfo = { 0 };
opInfo.StructSize = sizeof(CF_OPERATION_INFO);
opInfo.Type = CF_OPERATION_TYPE_ACK_DELETE;
opInfo.ConnectionKey = callbackInfo->ConnectionKey;
opInfo.TransferKey = callbackInfo->TransferKey;
opInfo.CorrelationVector = callbackInfo->CorrelationVector;
opInfo.RequestKey = callbackInfo->RequestKey;
CF_SYNC_STATUS_MSG* syncStatus = new CF_SYNC_STATUS_MSG;
syncStatus->Code = STATUS_FILE_LOCKED_WITH_WRITERS;
syncStatus->SetMsg(L"MY TEST");
opInfo.SyncStatus = syncStatus;
CF_OPERATION_PARAMETERS params = {0};
params.ParamSize = sizeof(CF_OPERATION_PARAMETERS);
params.AckDelete.Flags = CF_OPERATION_ACK_DELETE_FLAG_NONE;
// I have also tested many other error codes.
params.AckDelete.CompletionStatus = STATUS_FILE_LOCKED_WITH_WRITERS;
HRESULT res = CfExecute(&opInfo, ¶ms);
}
I have tested delete from both Windows Explorer and from command prompt on Windows 21H1. The result is identical - placeholder is deleted.
I have also retested delete on the older version - Windows 10 Pro 1909 (18363.1556) (cldflt.sys 10.0.18362.1533) and everything worked as expected - if I return an error from the delete callback the file is NOT deleted.
I guess this is a bug in latest Windows update. Was anybody able to find a solution for this behavior?
This is a known issue in Windows cloud filter API. It affects Windows 20H1 and later versions. Here is the discussion about this issue: https://learn.microsoft.com/en-us/answers/questions/75240/bug-report-cfapi-ackdelete-borken-on-win10-2004.html There is no any real solution for now as far as I know. Returning any specific error code does not help. The only possible solution would be recreating the deleted file in the local file system during synchronization at some later time.
Just tested on Windows 11 (build 10.0.22000.194), it seems this bug has finally been fixed.
Related
I'm working in Chrome for MacOS (108.0.5359.124) and Microsoft Edge (107.0.1418.62) on MacOS 12.6.1 (though confirmed the same issue on 13.0.1 as well), and the reset() method of WebUSB does not seem to work - I get no error on the console, but the device also doesn't see the reset.
Meanwhile, the same code does generate a USB reset in Chrome on Linux (same version, 108.0.5359.124, under Ubuntu 18.04 with kernel 5.4.0).
The code is here:
const connectButton = document.getElementById("connect");
const resetButton = document.getElementById("reset");
let device;
connectButton.onclick = async () => {
device = await navigator.usb.requestDevice({
filters: []
});
await device.open();
console.log("open:", device);
await device.selectConfiguration(1);
console.log("select config 1:", device);
await device.claimInterface(0);
console.log("claim interface 0:", device);
};
resetButton.onclick = async () => {
console.log("Device before reset: ", device);
await device.reset();
console.log("Device after reset:", device);
}
I see all the console logging, and no errors are thrown. (If I try to claim one of the HID interfaces on this device, I do get errors - but I believe that's expected). I've also tried without the device.selectConfiguration() and device.claimInterface() calls - exactly the same behavior (ie, no errors, but it doesn't work).
Is there something under MacOS preventing it from sending the reset? I can get similar code working on MacOS under node.js using WebUSB calls, but I suspect it's actually using libusb under the hood... I should say that the device in question has firmware written in Zephyr 3.0 (I wrote a substantial part of it). I haven't gotten resets to work with other devices either, though.
According to https://bugs.chromium.org/p/chromium/issues/detail?id=1189418, it seems like USBDevice.reset() does not work properly on macOS.
Even though a patch was submitted to fix this behaviour, it was reverted due to an expected libusb issue: https://chromium-review.googlesource.com/c/chromium/src/+/2936179
I've pinged the Chromium team at https://bugs.chromium.org/p/chromium/issues/detail?id=1189418#c15. We may want to follow up there.
Is there any way to remove a record from Launch Services database which was added using LSRegisterURL?
I have several apps that can open the same URL and I want to manage which one of them should open it. Unfortunately now I face a problem that at some point LSRegisterURL stop working. E.g. it works until some point, then, I guess, Launch Services database (or cache) gets overflown and subsequent calls to LSRegisterURL don't have any effect.
So my idea is to clean up Launch Services database by removing old records, but I can't find any related function.
I came across a private API in LaunchServices today that appears to do the trick. It seems to work on Mac OS X 10.7 thru 10.11. I've barely tested it yet, so YMMV:
extern void _LSUnregisterURL(CFURLRef url) __attribute__((weak_import));
- (void) unregisterAppAtURL:(NSURL *)appURL
{
if( _LSUnregisterURL != NULL )
{
CFURLRef urlRef = (__bridge CFURLRef)appURL;
if( urlRef )
{
_LSUnregisterURL( urlRef );
}
}
}
There are several other private API's similar to this (which you can find by using nm). Keep in mind that if you go private, you can't submit to the App Store. Hope that helps someone.
As it comes from the further tests OS X frees the Launch Services database itself. The exact algorithm is not clear, but rebooting Mac in most cases helps to remove the records to the missed applications and/or make the app specified by the most recent call to LSRegisterURL to become the default one.
I have an application for Motorola MC9500 series that uses the device camera.
I use the following method to init the Imager:
Symbol.Generic.Device MyDevice;
int i = 0;
if (imager == null)
{
MyDevice = (Symbol.Generic.Device)Symbol.Imaging.Device.AvailableDevices.GetValue(0);
for (i = 1; MyDevice != null; i++)
{
if (MyDevice.FriendlyName.Equals("Image Capture Driver for Color Camera"))
break;
MyDevice = (Symbol.Generic.Device)Symbol.Imaging.Device.AvailableDevices.GetValue(i);
}
if (MyDevice == null)
{
MessageBox.Show("Camera não foi encontrada.");
this.Close();
return;
}
imager = new Symbol.Imaging.Imager(MyDevice);
}
It works fine on WM6.1 but not on WM6.5, where the last line throws the following exception:
Failed to create Imager: IMAGE_Open failed: E_IMG_INVALIDDEVICE
According to the manufacturer documentation, this means: "The physical device driver (PDD). DLL did not contain the required entry points.". However, I have all the drivers up-to-date. They can be found on: http://support.symbol.com/support/search.do?cmd=displayKC&docType=kc&externalId=12683&sliceId=&dialogID=469856149&stateId=1%200%20469852171
When I'm running the program, I have no other tasks running, since I thought this could be due to another process locking the camera to itself.
Relevant fact is that the camera doesn't seem to work/start in any other application that uses it. However, they seem to work on my client's device (also WM6.5, same device).
Anyone got any suggestion or idea of why this happens, or how to solve it?
I had the same problem, but mine was caused because I also had a Barcode scanner active, disabling the Barcode scanner fixed this for me.
barcode2.Disable()
You have to download and install a CAB to enable second source camera from motorola site (SPR23173).
I had this problem with a Motorola MC75A. Turns out it was the Datawedge application that was also installed on the device that was stopping it from working correctly. The camera and the barcode scanner appear to be kind of linked. You can only use one at once and as the DataWedge was already running, my code/project was producing the IMAGE_Open failed: E_IMG_INVALIDDEVICE. Simply going into DataWedge and stopping the process fixed this instantly.
In my SenchaTouch 2 app the first lines in app.js read:
Ext.Loader.setConfig( {enabled: true, disableCaching: false} );
Ext.data.Connection.disableCaching = false;
Ext.data.JsonP.disableCaching = false;
Ext.data.proxy.Server.prototype.noCache = false;
Ext.Ajax.disableCaching = false;
The app compiles to the production version without errors or warnings. It loads and runs from the server. When I try to run it offline in Chrome, those 404 errors occur
GET http://myServer/m/Override/...=1346682646496 /m/Override/slider/Slider.js?_dc=1346682646496:1
GET http://myServer/m/app.json?1346682646693 /m/:6
which indicate that the timestamp of the disableCache parameter is appended to the GET requests. Therefore the application does not load offline. It hangs at the "Application is being loaded..." screen. How can I enable caching and avoid this _dc parameter?
The SDK version is 2.0.1.1
-- update: Found workaround. Integrated Slider.js in app.js
This is a known bug or rather the feature was not implemented properly. It didnt work for me in sencha 2.1 either.
I'm dipping my toes into Windows Azure, and I'm running into something that has to be simple, but I just can't see it.
I have this small test to play with Azure queues:
public void CanPublishSillyLittleMessageOnQueue()
{
var queueClient = CloudStorageAccount.DevelopmentStorageAccount.CreateCloudQueueClient();
var testQueue = queueClient.GetQueueReference("testqueue1");
testQueue.CreateIfNotExist();
var message = new CloudQueueMessage("This is a test");
testQueue.AddMessage(message);
CloudQueueMessage received;
int sleepCount = 0;
while((received = testQueue.GetMessage()) == null)
{
++sleepCount;
Thread.Sleep(25);
}
testQueue.DeleteMessage(received);
Assert.Equal(message.AsString, received.AsString);
}
It sends the message just fine - I can see it in the SQL table. However, when it hits the "testQueue.DeleteMessage(received)" method, I get this:
TestCase 'AzureExploratory.PlayingWithQueues.CanPublishSillyLittleMessageOnQueue'
failed: System.ArgumentNullException : Value cannot be null.
Parameter name: str
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImplWithRetry(Func`1 impl, RetryPolicy policy)
at Microsoft.WindowsAzure.StorageClient.CloudQueue.DeleteMessage(CloudQueueMessage message)
PlayingWithQueues.cs(75,0): at AzureExploratory.PlayingWithQueues.CanPublishSillyLittleMessageOnQueue()
which appears to be a failure somewhere down inside the guts of the Azure SDK.
I'm using VS 2010, .NET 4.0, the Azure SDK V1.2, 64-bit Win 7. The developer store service is running; I can see the messages go into the queue, I just can't delete them.
Anyone ever seen anything like this?
I figured out what's going on. The code in question was running in a xUnit test harness. Turns out that the xUnit runner doesn't set up an appdomain with a config file path by default. System.UriBuilder now hits the config file, so it blows up.
The workaround was to add an empty app.config to the test project. Now it works.
ARGH!